From c3c73bdd6e323ceb52f808cc31686cf3a6799ea7 Mon Sep 17 00:00:00 2001 From: Cory Date: Thu, 13 Oct 2022 09:33:33 -0700 Subject: [PATCH 01/17] docs: fix images on Baskets RFC (#1544) Images were not loading when we did some renaming of folders. This fixes the Baskets RFC to render images properly. --- specs/rfcs/002-basket-functionality/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/specs/rfcs/002-basket-functionality/README.md b/specs/rfcs/002-basket-functionality/README.md index cb1d83a908..1a6c6c89b4 100644 --- a/specs/rfcs/002-basket-functionality/README.md +++ b/specs/rfcs/002-basket-functionality/README.md @@ -50,7 +50,7 @@ credits within the specific batch they were issued in. #### Credit Class & Batch Hierarchy (Fig. 1) -![](media/002-fig-1.jpg) +![](assets/002-fig-1.jpg) ## Use Case @@ -122,11 +122,11 @@ An ecocredit holder has the ability to retire, transfer, or hold their ecocredit #### Ecocredit Basket Depositing (Fig. 2) -![](media/002-fig-2.jpg) +![](assets/002-fig-2.jpg) #### Ecocredit Basket Redemption (Fig. 3) -![](media/002-fig-3.jpg) +![](assets/002-fig-3.jpg) ## Prior Art From d6368a12ab6a77c5199af36fa56d4c427ec4853d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Oct 2022 07:52:15 -0700 Subject: [PATCH 02/17] build(deps): Bump gotest.tools/v3 from 3.3.0 to 3.4.0 (#1536) * build(deps): Bump gotest.tools/v3 from 3.3.0 to 3.4.0 in /types Bumps [gotest.tools/v3](https://github.com/gotestyourself/gotest.tools) from 3.3.0 to 3.4.0. - [Release notes](https://github.com/gotestyourself/gotest.tools/releases) - [Commits](https://github.com/gotestyourself/gotest.tools/compare/v3.3.0...v3.4.0) --- updated-dependencies: - dependency-name: gotest.tools/v3 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * make tidy Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: ryanchristo <12519942+ryanchristo@users.noreply.github.com> --- go.sum | 2 +- types/go.mod | 2 +- types/go.sum | 4 ++-- x/data/go.mod | 2 +- x/data/go.sum | 4 ++-- x/ecocredit/go.mod | 2 +- x/ecocredit/go.sum | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/go.sum b/go.sum index 06db6048e0..554d8b13c8 100644 --- a/go.sum +++ b/go.sum @@ -1634,7 +1634,7 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.3.0 h1:MfDY1b1/0xN1CyMlQDac0ziEy9zJQd9CXBRRDHw2jJo= +gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/types/go.mod b/types/go.mod index 328a7cc791..77c67a4031 100644 --- a/types/go.mod +++ b/types/go.mod @@ -21,7 +21,7 @@ require ( github.com/tendermint/tm-db v0.6.7 google.golang.org/grpc v1.49.0 google.golang.org/protobuf v1.28.1 - gotest.tools/v3 v3.3.0 + gotest.tools/v3 v3.4.0 pgregory.net/rapid v0.5.3 ) diff --git a/types/go.sum b/types/go.sum index 113d0c4c65..ac7e879b8a 100644 --- a/types/go.sum +++ b/types/go.sum @@ -1429,8 +1429,8 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.3.0 h1:MfDY1b1/0xN1CyMlQDac0ziEy9zJQd9CXBRRDHw2jJo= -gotest.tools/v3 v3.3.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= +gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= +gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/x/data/go.mod b/x/data/go.mod index 4d9411e0a4..8be013b5fe 100644 --- a/x/data/go.mod +++ b/x/data/go.mod @@ -24,7 +24,7 @@ require ( google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959 google.golang.org/grpc v1.49.0 google.golang.org/protobuf v1.28.1 - gotest.tools/v3 v3.3.0 + gotest.tools/v3 v3.4.0 ) require ( diff --git a/x/data/go.sum b/x/data/go.sum index 0d9c4e8cf6..4e3231d870 100644 --- a/x/data/go.sum +++ b/x/data/go.sum @@ -1634,8 +1634,8 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.3.0 h1:MfDY1b1/0xN1CyMlQDac0ziEy9zJQd9CXBRRDHw2jJo= -gotest.tools/v3 v3.3.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= +gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= +gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/x/ecocredit/go.mod b/x/ecocredit/go.mod index 203b6d7d87..02c643c980 100644 --- a/x/ecocredit/go.mod +++ b/x/ecocredit/go.mod @@ -25,7 +25,7 @@ require ( google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959 google.golang.org/grpc v1.49.0 google.golang.org/protobuf v1.28.1 - gotest.tools/v3 v3.3.0 + gotest.tools/v3 v3.4.0 pgregory.net/rapid v0.5.3 ) diff --git a/x/ecocredit/go.sum b/x/ecocredit/go.sum index ccae1213ef..80fc7ba697 100644 --- a/x/ecocredit/go.sum +++ b/x/ecocredit/go.sum @@ -1638,8 +1638,8 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.3.0 h1:MfDY1b1/0xN1CyMlQDac0ziEy9zJQd9CXBRRDHw2jJo= -gotest.tools/v3 v3.3.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= +gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= +gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From 90c66cf71c2fd9e35de95283036b935dd7b1d5a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Oct 2022 08:07:38 -0700 Subject: [PATCH 03/17] build(deps): Bump github.com/spf13/cobra from 1.5.0 to 1.6.0 (#1538) * build(deps): Bump github.com/spf13/cobra from 1.5.0 to 1.6.0 Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.5.0 to 1.6.0. - [Release notes](https://github.com/spf13/cobra/releases) - [Commits](https://github.com/spf13/cobra/compare/v1.5.0...v1.6.0) --- updated-dependencies: - dependency-name: github.com/spf13/cobra dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * bump version in all modules Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: ryanchristo <12519942+ryanchristo@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 7 ++++--- types/go.mod | 4 ++-- types/go.sum | 7 ++++--- x/data/go.mod | 4 ++-- x/data/go.sum | 7 ++++--- x/ecocredit/go.mod | 4 ++-- x/ecocredit/go.sum | 7 ++++--- 8 files changed, 24 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index 9c1e1f37e1..1a2dfab0a2 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/regen-network/regen-ledger/x/ecocredit v1.1.0 github.com/rs/zerolog v1.28.0 github.com/spf13/cast v1.5.0 - github.com/spf13/cobra v1.5.0 + github.com/spf13/cobra v1.6.0 github.com/stretchr/testify v1.8.0 github.com/tendermint/tendermint v0.34.21 github.com/tendermint/tm-db v0.6.7 @@ -105,7 +105,7 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect - github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/klauspost/compress v1.15.9 // indirect diff --git a/go.sum b/go.sum index 554d8b13c8..297412ea52 100644 --- a/go.sum +++ b/go.sum @@ -599,8 +599,9 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= +github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= @@ -920,8 +921,8 @@ github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= -github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= +github.com/spf13/cobra v1.6.0 h1:42a0n6jwCot1pUmomAp4T7DeMD+20LFv4Q54pxLf2LI= +github.com/spf13/cobra v1.6.0/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= diff --git a/types/go.mod b/types/go.mod index 77c67a4031..a8f9bec464 100644 --- a/types/go.mod +++ b/types/go.mod @@ -15,7 +15,7 @@ require ( github.com/regen-network/gocuke v0.6.2 github.com/regen-network/regen-ledger/api v0.8.0 github.com/rs/zerolog v1.28.0 - github.com/spf13/cobra v1.5.0 + github.com/spf13/cobra v1.6.0 github.com/stretchr/testify v1.8.0 github.com/tendermint/tendermint v0.34.21 github.com/tendermint/tm-db v0.6.7 @@ -88,7 +88,7 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect - github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/klauspost/compress v1.15.9 // indirect github.com/lib/pq v1.10.6 // indirect diff --git a/types/go.sum b/types/go.sum index ac7e879b8a..0f71ca960c 100644 --- a/types/go.sum +++ b/types/go.sum @@ -536,8 +536,9 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= +github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= @@ -852,8 +853,8 @@ github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= -github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= +github.com/spf13/cobra v1.6.0 h1:42a0n6jwCot1pUmomAp4T7DeMD+20LFv4Q54pxLf2LI= +github.com/spf13/cobra v1.6.0/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= diff --git a/x/data/go.mod b/x/data/go.mod index 8be013b5fe..f1a4233ce2 100644 --- a/x/data/go.mod +++ b/x/data/go.mod @@ -16,7 +16,7 @@ require ( github.com/regen-network/gocuke v0.6.2 github.com/regen-network/regen-ledger/api v0.8.0 github.com/regen-network/regen-ledger/types v1.0.0 - github.com/spf13/cobra v1.5.0 + github.com/spf13/cobra v1.6.0 github.com/stretchr/testify v1.8.0 github.com/tendermint/tendermint v0.34.21 github.com/tendermint/tm-db v0.6.7 @@ -105,7 +105,7 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect - github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/klauspost/compress v1.15.9 // indirect diff --git a/x/data/go.sum b/x/data/go.sum index 4e3231d870..a6ab685a36 100644 --- a/x/data/go.sum +++ b/x/data/go.sum @@ -601,8 +601,9 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= +github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= @@ -922,8 +923,8 @@ github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= -github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= +github.com/spf13/cobra v1.6.0 h1:42a0n6jwCot1pUmomAp4T7DeMD+20LFv4Q54pxLf2LI= +github.com/spf13/cobra v1.6.0/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= diff --git a/x/ecocredit/go.mod b/x/ecocredit/go.mod index 02c643c980..04b1f2ecb6 100644 --- a/x/ecocredit/go.mod +++ b/x/ecocredit/go.mod @@ -17,7 +17,7 @@ require ( github.com/regen-network/gocuke v0.6.2 github.com/regen-network/regen-ledger/api v0.8.0 github.com/regen-network/regen-ledger/types v1.0.0 - github.com/spf13/cobra v1.5.0 + github.com/spf13/cobra v1.6.0 github.com/stretchr/testify v1.8.0 github.com/tendermint/tendermint v0.34.21 github.com/tendermint/tm-db v0.6.7 @@ -106,7 +106,7 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect - github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/klauspost/compress v1.15.9 // indirect diff --git a/x/ecocredit/go.sum b/x/ecocredit/go.sum index 80fc7ba697..1c76baa509 100644 --- a/x/ecocredit/go.sum +++ b/x/ecocredit/go.sum @@ -603,8 +603,9 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= +github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= @@ -924,8 +925,8 @@ github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= -github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= +github.com/spf13/cobra v1.6.0 h1:42a0n6jwCot1pUmomAp4T7DeMD+20LFv4Q54pxLf2LI= +github.com/spf13/cobra v1.6.0/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= From f1b3bdb07217ea232083bdbc2d40532086118db2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Oct 2022 08:22:44 -0700 Subject: [PATCH 04/17] build(deps): Bump github.com/cosmos/cosmos-proto from 1.0.0-alpha7 to 1.0.0-alpha8 in /api (#1545) * build(deps): Bump github.com/cosmos/cosmos-proto in /api Bumps [github.com/cosmos/cosmos-proto](https://github.com/cosmos/cosmos-proto) from 1.0.0-alpha7 to 1.0.0-alpha8. - [Release notes](https://github.com/cosmos/cosmos-proto/releases) - [Commits](https://github.com/cosmos/cosmos-proto/compare/v1.0.0-alpha7...v1.0.0-alpha8) --- updated-dependencies: - dependency-name: github.com/cosmos/cosmos-proto dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * make tidy Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> --- api/go.mod | 2 +- api/go.sum | 14 ++++++-------- go.mod | 2 +- go.sum | 5 ++--- types/go.mod | 4 ++-- types/go.sum | 11 ++++------- x/data/go.mod | 4 ++-- x/data/go.sum | 8 ++++---- x/ecocredit/go.mod | 2 +- x/ecocredit/go.sum | 5 ++--- 10 files changed, 25 insertions(+), 32 deletions(-) diff --git a/api/go.mod b/api/go.mod index 73b431170e..a02538ad7d 100644 --- a/api/go.mod +++ b/api/go.mod @@ -3,7 +3,7 @@ module github.com/regen-network/regen-ledger/api go 1.18 require ( - github.com/cosmos/cosmos-proto v1.0.0-alpha7 + github.com/cosmos/cosmos-proto v1.0.0-alpha8 github.com/cosmos/cosmos-sdk/api v0.1.0 github.com/cosmos/cosmos-sdk/orm v1.0.0-alpha.12 github.com/cosmos/gogoproto v1.4.2 diff --git a/api/go.sum b/api/go.sum index 0439502cb6..3668c956e8 100644 --- a/api/go.sum +++ b/api/go.sum @@ -24,8 +24,8 @@ github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZ github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/cosmos/cosmos-proto v1.0.0-alpha7 h1:yqYUOHF2jopwZh4dVQp3xgqwftE5/2hkrwIV6vkUbO0= -github.com/cosmos/cosmos-proto v1.0.0-alpha7/go.mod h1:dosO4pSAbJF8zWCzCoTWP7nNsjcvSUBQmniFxDg5daw= +github.com/cosmos/cosmos-proto v1.0.0-alpha8 h1:d3pCRuMYYvGA5bM0ZbbjKn+AoQD4A7dyNG2wzwWalUw= +github.com/cosmos/cosmos-proto v1.0.0-alpha8/go.mod h1:6/p+Bc4O8JKeZqe0VqUGTX31eoYqemTT4C1hLCWsO7I= github.com/cosmos/cosmos-sdk/api v0.1.0 h1:xfSKM0e9p+EJTMQnf5PbWE6VT8ruxTABIJ64Rd064dE= github.com/cosmos/cosmos-sdk/api v0.1.0/go.mod h1:CupqQBskAOiTXO1XDZ/wrtWzN/wTxUvbQmOqdUhR8wI= github.com/cosmos/cosmos-sdk/errors v1.0.0-beta.5 h1:9ebZL9/nCkaxer3kWWHs0YT8OOmHd7xohULM8Weep7M= @@ -96,8 +96,7 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= @@ -146,7 +145,7 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca h1:Ld/zXl5t4+D69SiV4JoN7kkfvJdOWlPpfxrzxpLMoUk= github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= github.com/tendermint/tm-db v0.6.7 h1:fE00Cbl0jayAoqlExN6oyQJ7fR/ZtoVOmvPJ//+shu8= @@ -272,10 +271,9 @@ gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gotest.tools/v3 v3.1.0 h1:rVV8Tcg/8jHUkPUorwjaMTtemIMVXfIPKiOqnhEhakk= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -pgregory.net/rapid v0.4.7 h1:MTNRktPuv5FNqOO151TM9mDTa+XHcX6ypYeISDVD14g= -pgregory.net/rapid v0.4.7/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= +pgregory.net/rapid v0.5.3 h1:163N50IHFqr1phZens4FQOdPgfJscR7a562mjQqeo4M= diff --git a/go.mod b/go.mod index 1a2dfab0a2..5b53d9e0b8 100644 --- a/go.mod +++ b/go.mod @@ -48,7 +48,7 @@ require ( github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect github.com/confio/ics23/go v0.7.0 // indirect github.com/cosmos/btcutil v1.0.4 // indirect - github.com/cosmos/cosmos-proto v1.0.0-alpha7 // indirect + github.com/cosmos/cosmos-proto v1.0.0-alpha8 // indirect github.com/cosmos/cosmos-sdk/api v0.1.0 // indirect github.com/cosmos/cosmos-sdk/errors v1.0.0-beta.5 // indirect github.com/cosmos/cosmos-sdk/orm v1.0.0-alpha.12 // indirect diff --git a/go.sum b/go.sum index 297412ea52..bc546a48b4 100644 --- a/go.sum +++ b/go.sum @@ -235,8 +235,8 @@ github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1 github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44= github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= -github.com/cosmos/cosmos-proto v1.0.0-alpha7 h1:yqYUOHF2jopwZh4dVQp3xgqwftE5/2hkrwIV6vkUbO0= -github.com/cosmos/cosmos-proto v1.0.0-alpha7/go.mod h1:dosO4pSAbJF8zWCzCoTWP7nNsjcvSUBQmniFxDg5daw= +github.com/cosmos/cosmos-proto v1.0.0-alpha8 h1:d3pCRuMYYvGA5bM0ZbbjKn+AoQD4A7dyNG2wzwWalUw= +github.com/cosmos/cosmos-proto v1.0.0-alpha8/go.mod h1:6/p+Bc4O8JKeZqe0VqUGTX31eoYqemTT4C1hLCWsO7I= github.com/cosmos/cosmos-sdk v0.46.2 h1:3dUNqbLas94ud5aTcJKCwxVOmNXpuGBtVQTMrYczTwY= github.com/cosmos/cosmos-sdk v0.46.2/go.mod h1:0aUPGPU6PWaDEaHNjtgrpNhgxo9bAUrQ7BO7XCvFOfs= github.com/cosmos/cosmos-sdk/api v0.1.0 h1:xfSKM0e9p+EJTMQnf5PbWE6VT8ruxTABIJ64Rd064dE= @@ -1647,7 +1647,6 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.4.7/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= pgregory.net/rapid v0.5.3 h1:163N50IHFqr1phZens4FQOdPgfJscR7a562mjQqeo4M= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/types/go.mod b/types/go.mod index a8f9bec464..a2eea2df8d 100644 --- a/types/go.mod +++ b/types/go.mod @@ -43,7 +43,7 @@ require ( github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect github.com/confio/ics23/go v0.7.0 // indirect github.com/cosmos/btcutil v1.0.4 // indirect - github.com/cosmos/cosmos-proto v1.0.0-alpha7 // indirect + github.com/cosmos/cosmos-proto v1.0.0-alpha8 // indirect github.com/cosmos/cosmos-sdk/errors v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogoproto v1.4.2 // indirect @@ -74,7 +74,7 @@ require ( github.com/golang/protobuf v1.5.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.0.1 // indirect - github.com/google/go-cmp v0.5.8 // indirect + github.com/google/go-cmp v0.5.9 // indirect github.com/google/orderedcode v0.0.1 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/mux v1.8.0 // indirect diff --git a/types/go.sum b/types/go.sum index 0f71ca960c..a89af90d79 100644 --- a/types/go.sum +++ b/types/go.sum @@ -204,8 +204,8 @@ github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1 github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44= github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= -github.com/cosmos/cosmos-proto v1.0.0-alpha7 h1:yqYUOHF2jopwZh4dVQp3xgqwftE5/2hkrwIV6vkUbO0= -github.com/cosmos/cosmos-proto v1.0.0-alpha7/go.mod h1:dosO4pSAbJF8zWCzCoTWP7nNsjcvSUBQmniFxDg5daw= +github.com/cosmos/cosmos-proto v1.0.0-alpha8 h1:d3pCRuMYYvGA5bM0ZbbjKn+AoQD4A7dyNG2wzwWalUw= +github.com/cosmos/cosmos-proto v1.0.0-alpha8/go.mod h1:6/p+Bc4O8JKeZqe0VqUGTX31eoYqemTT4C1hLCWsO7I= github.com/cosmos/cosmos-sdk v0.46.2 h1:3dUNqbLas94ud5aTcJKCwxVOmNXpuGBtVQTMrYczTwY= github.com/cosmos/cosmos-sdk v0.46.2/go.mod h1:0aUPGPU6PWaDEaHNjtgrpNhgxo9bAUrQ7BO7XCvFOfs= github.com/cosmos/cosmos-sdk/api v0.1.0 h1:xfSKM0e9p+EJTMQnf5PbWE6VT8ruxTABIJ64Rd064dE= @@ -426,9 +426,8 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa h1:Q75Upo5UN4JbPFURXZ8nLKYUvF85dyFRop/vQ0Rv+64= @@ -1392,7 +1391,6 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= @@ -1443,7 +1441,6 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.4.7/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= pgregory.net/rapid v0.5.3 h1:163N50IHFqr1phZens4FQOdPgfJscR7a562mjQqeo4M= pgregory.net/rapid v0.5.3/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/x/data/go.mod b/x/data/go.mod index f1a4233ce2..f64c6095b8 100644 --- a/x/data/go.mod +++ b/x/data/go.mod @@ -54,7 +54,7 @@ require ( github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect github.com/confio/ics23/go v0.7.0 // indirect github.com/cosmos/btcutil v1.0.4 // indirect - github.com/cosmos/cosmos-proto v1.0.0-alpha7 // indirect + github.com/cosmos/cosmos-proto v1.0.0-alpha8 // indirect github.com/cosmos/cosmos-sdk/errors v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gorocksdb v1.2.0 // indirect @@ -84,7 +84,7 @@ require ( github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.0.1 // indirect - github.com/google/go-cmp v0.5.8 // indirect + github.com/google/go-cmp v0.5.9 // indirect github.com/google/orderedcode v0.0.1 // indirect github.com/google/uuid v1.3.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect diff --git a/x/data/go.sum b/x/data/go.sum index a6ab685a36..ee3badb97d 100644 --- a/x/data/go.sum +++ b/x/data/go.sum @@ -239,8 +239,8 @@ github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1 github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44= github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= -github.com/cosmos/cosmos-proto v1.0.0-alpha7 h1:yqYUOHF2jopwZh4dVQp3xgqwftE5/2hkrwIV6vkUbO0= -github.com/cosmos/cosmos-proto v1.0.0-alpha7/go.mod h1:dosO4pSAbJF8zWCzCoTWP7nNsjcvSUBQmniFxDg5daw= +github.com/cosmos/cosmos-proto v1.0.0-alpha8 h1:d3pCRuMYYvGA5bM0ZbbjKn+AoQD4A7dyNG2wzwWalUw= +github.com/cosmos/cosmos-proto v1.0.0-alpha8/go.mod h1:6/p+Bc4O8JKeZqe0VqUGTX31eoYqemTT4C1hLCWsO7I= github.com/cosmos/cosmos-sdk v0.46.2 h1:3dUNqbLas94ud5aTcJKCwxVOmNXpuGBtVQTMrYczTwY= github.com/cosmos/cosmos-sdk v0.46.2/go.mod h1:0aUPGPU6PWaDEaHNjtgrpNhgxo9bAUrQ7BO7XCvFOfs= github.com/cosmos/cosmos-sdk/api v0.1.0 h1:xfSKM0e9p+EJTMQnf5PbWE6VT8ruxTABIJ64Rd064dE= @@ -470,8 +470,9 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa h1:Q75Upo5UN4JbPFURXZ8nLKYUvF85dyFRop/vQ0Rv+64= @@ -1648,7 +1649,6 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.4.7/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= pgregory.net/rapid v0.5.3 h1:163N50IHFqr1phZens4FQOdPgfJscR7a562mjQqeo4M= pgregory.net/rapid v0.5.3/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/x/ecocredit/go.mod b/x/ecocredit/go.mod index 04b1f2ecb6..dd4f6e5343 100644 --- a/x/ecocredit/go.mod +++ b/x/ecocredit/go.mod @@ -55,7 +55,7 @@ require ( github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect github.com/confio/ics23/go v0.7.0 // indirect github.com/cosmos/btcutil v1.0.4 // indirect - github.com/cosmos/cosmos-proto v1.0.0-alpha7 // indirect + github.com/cosmos/cosmos-proto v1.0.0-alpha8 // indirect github.com/cosmos/cosmos-sdk/errors v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gorocksdb v1.2.0 // indirect diff --git a/x/ecocredit/go.sum b/x/ecocredit/go.sum index 1c76baa509..1fbd034b74 100644 --- a/x/ecocredit/go.sum +++ b/x/ecocredit/go.sum @@ -239,8 +239,8 @@ github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1 github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44= github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= -github.com/cosmos/cosmos-proto v1.0.0-alpha7 h1:yqYUOHF2jopwZh4dVQp3xgqwftE5/2hkrwIV6vkUbO0= -github.com/cosmos/cosmos-proto v1.0.0-alpha7/go.mod h1:dosO4pSAbJF8zWCzCoTWP7nNsjcvSUBQmniFxDg5daw= +github.com/cosmos/cosmos-proto v1.0.0-alpha8 h1:d3pCRuMYYvGA5bM0ZbbjKn+AoQD4A7dyNG2wzwWalUw= +github.com/cosmos/cosmos-proto v1.0.0-alpha8/go.mod h1:6/p+Bc4O8JKeZqe0VqUGTX31eoYqemTT4C1hLCWsO7I= github.com/cosmos/cosmos-sdk v0.46.2 h1:3dUNqbLas94ud5aTcJKCwxVOmNXpuGBtVQTMrYczTwY= github.com/cosmos/cosmos-sdk v0.46.2/go.mod h1:0aUPGPU6PWaDEaHNjtgrpNhgxo9bAUrQ7BO7XCvFOfs= github.com/cosmos/cosmos-sdk/api v0.1.0 h1:xfSKM0e9p+EJTMQnf5PbWE6VT8ruxTABIJ64Rd064dE= @@ -1652,7 +1652,6 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.4.7/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= pgregory.net/rapid v0.5.3 h1:163N50IHFqr1phZens4FQOdPgfJscR7a562mjQqeo4M= pgregory.net/rapid v0.5.3/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= From 8300694183e6f4442cdad27dd0ce3e81df219754 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Oct 2022 08:27:46 -0700 Subject: [PATCH 05/17] build(deps): Bump amannn/action-semantic-pull-request from 4 to 5.0.1 (#1548) Bumps [amannn/action-semantic-pull-request](https://github.com/amannn/action-semantic-pull-request) from 4 to 5.0.1. - [Release notes](https://github.com/amannn/action-semantic-pull-request/releases) - [Changelog](https://github.com/amannn/action-semantic-pull-request/blob/main/CHANGELOG.md) - [Commits](https://github.com/amannn/action-semantic-pull-request/compare/v4...v5.0.1) --- updated-dependencies: - dependency-name: amannn/action-semantic-pull-request dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/lint-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml index dc0d52b720..e5dc8ccfa9 100644 --- a/.github/workflows/lint-pr.yml +++ b/.github/workflows/lint-pr.yml @@ -25,6 +25,6 @@ jobs: pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR steps: - - uses: amannn/action-semantic-pull-request@v4 + - uses: amannn/action-semantic-pull-request@v5 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From be242a67f854ba633d61b5a738495673e8efce13 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Oct 2022 09:26:44 -0700 Subject: [PATCH 06/17] build(deps): Bump google.golang.org/grpc from 1.49.0 to 1.50.1 (#1552) * build(deps): Bump google.golang.org/grpc from 1.49.0 to 1.50.1 in /types Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.49.0 to 1.50.1. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.49.0...v1.50.1) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * make tidy Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: ryanchristo <12519942+ryanchristo@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- types/go.mod | 2 +- types/go.sum | 4 ++-- x/data/go.mod | 2 +- x/data/go.sum | 4 ++-- x/ecocredit/go.mod | 2 +- x/ecocredit/go.sum | 4 ++-- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 5b53d9e0b8..c73b46ed33 100644 --- a/go.mod +++ b/go.mod @@ -158,7 +158,7 @@ require ( golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect google.golang.org/api v0.93.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/grpc v1.49.0 // indirect + google.golang.org/grpc v1.50.1 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/ini.v1 v1.66.6 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index bc546a48b4..69e9dcf0d9 100644 --- a/go.sum +++ b/go.sum @@ -1579,8 +1579,8 @@ google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11 google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.49.0 h1:WTLtQzmQori5FUH25Pq4WT22oCsv8USpQ+F6rqtsmxw= -google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.1 h1:DS/BukOZWp8s6p4Dt/tOaJaTQyPyOoCcrjroHuCeLzY= +google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/types/go.mod b/types/go.mod index a2eea2df8d..83ffc6d007 100644 --- a/types/go.mod +++ b/types/go.mod @@ -19,7 +19,7 @@ require ( github.com/stretchr/testify v1.8.0 github.com/tendermint/tendermint v0.34.21 github.com/tendermint/tm-db v0.6.7 - google.golang.org/grpc v1.49.0 + google.golang.org/grpc v1.50.1 google.golang.org/protobuf v1.28.1 gotest.tools/v3 v3.4.0 pgregory.net/rapid v0.5.3 diff --git a/types/go.sum b/types/go.sum index a89af90d79..307c9082c4 100644 --- a/types/go.sum +++ b/types/go.sum @@ -1377,8 +1377,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.49.0 h1:WTLtQzmQori5FUH25Pq4WT22oCsv8USpQ+F6rqtsmxw= -google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.1 h1:DS/BukOZWp8s6p4Dt/tOaJaTQyPyOoCcrjroHuCeLzY= +google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/x/data/go.mod b/x/data/go.mod index f64c6095b8..ae1c7402ea 100644 --- a/x/data/go.mod +++ b/x/data/go.mod @@ -22,7 +22,7 @@ require ( github.com/tendermint/tm-db v0.6.7 golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959 - google.golang.org/grpc v1.49.0 + google.golang.org/grpc v1.50.1 google.golang.org/protobuf v1.28.1 gotest.tools/v3 v3.4.0 ) diff --git a/x/data/go.sum b/x/data/go.sum index ee3badb97d..a1af2508f3 100644 --- a/x/data/go.sum +++ b/x/data/go.sum @@ -1581,8 +1581,8 @@ google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11 google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.49.0 h1:WTLtQzmQori5FUH25Pq4WT22oCsv8USpQ+F6rqtsmxw= -google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.1 h1:DS/BukOZWp8s6p4Dt/tOaJaTQyPyOoCcrjroHuCeLzY= +google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/x/ecocredit/go.mod b/x/ecocredit/go.mod index dd4f6e5343..8bfa801505 100644 --- a/x/ecocredit/go.mod +++ b/x/ecocredit/go.mod @@ -23,7 +23,7 @@ require ( github.com/tendermint/tm-db v0.6.7 github.com/thanhpk/randstr v1.0.4 google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959 - google.golang.org/grpc v1.49.0 + google.golang.org/grpc v1.50.1 google.golang.org/protobuf v1.28.1 gotest.tools/v3 v3.4.0 pgregory.net/rapid v0.5.3 diff --git a/x/ecocredit/go.sum b/x/ecocredit/go.sum index 1fbd034b74..6384506e30 100644 --- a/x/ecocredit/go.sum +++ b/x/ecocredit/go.sum @@ -1584,8 +1584,8 @@ google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11 google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.49.0 h1:WTLtQzmQori5FUH25Pq4WT22oCsv8USpQ+F6rqtsmxw= -google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.1 h1:DS/BukOZWp8s6p4Dt/tOaJaTQyPyOoCcrjroHuCeLzY= +google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= From 1d63106f29e8dd8d7db68cb19eece170e5889fc4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Oct 2022 09:36:55 -0700 Subject: [PATCH 07/17] build(deps): Bump google.golang.org/grpc from 1.49.0 to 1.50.1 in /api (#1554) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.49.0 to 1.50.1. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.49.0...v1.50.1) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- api/go.mod | 2 +- api/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/go.mod b/api/go.mod index a02538ad7d..4b971b1e89 100644 --- a/api/go.mod +++ b/api/go.mod @@ -8,7 +8,7 @@ require ( github.com/cosmos/cosmos-sdk/orm v1.0.0-alpha.12 github.com/cosmos/gogoproto v1.4.2 google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106 - google.golang.org/grpc v1.49.0 + google.golang.org/grpc v1.50.1 google.golang.org/protobuf v1.28.1 ) diff --git a/api/go.sum b/api/go.sum index 3668c956e8..62c99205aa 100644 --- a/api/go.sum +++ b/api/go.sum @@ -245,8 +245,8 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.49.0 h1:WTLtQzmQori5FUH25Pq4WT22oCsv8USpQ+F6rqtsmxw= -google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.1 h1:DS/BukOZWp8s6p4Dt/tOaJaTQyPyOoCcrjroHuCeLzY= +google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= From 0491f565dc893f1ce46c4f0727f443e597ca21be Mon Sep 17 00:00:00 2001 From: omahs <73983677+omahs@users.noreply.github.com> Date: Mon, 17 Oct 2022 18:41:42 +0200 Subject: [PATCH 08/17] Fix: typos (#1547) Fix: typos Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> --- docs/tutorials/currency-allowlist-proposal.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tutorials/currency-allowlist-proposal.md b/docs/tutorials/currency-allowlist-proposal.md index e236918de7..5e56306306 100644 --- a/docs/tutorials/currency-allowlist-proposal.md +++ b/docs/tutorials/currency-allowlist-proposal.md @@ -26,7 +26,7 @@ Create a `proposal.json` file using the following example (note that the name an Each field in the json file is required and should be properly filled out. -Make sure you give the proposal a meaningful title and description. The description should provide a rationale as to why this currency should be added to the list and can be written in either plain text or markdown (see [Proposal #15](https://wallet.keplr.app/chains/regen/proposals/15) for a example of a detailed description). +Make sure you give the proposal a meaningful title and description. The description should provide a rationale as to why this currency should be added to the list and can be written in either plain text or markdown (see [Proposal #15](https://wallet.keplr.app/chains/regen/proposals/15) for an example of a detailed description). `denom` includes information about the currency you are proposing to add: @@ -36,7 +36,7 @@ Make sure you give the proposal a meaningful title and description. The descript - `exponent` is used to relate the `bank_denom` to the `display_denom` and is informational. For example, `1000000uregen` is equal to `1regen` and therefore the exponent is `6`. -Keep in mind that non-native tokens represented by an IBC denom only enables a currency from a specific source. For example, `atom` transferred from one chain is different from `atom` transferred from another chain, i.e. each of these represent `atom` but they have different IBC denoms. +Keep in mind that non-native tokens represented by an IBC denom only enables a currency from a specific source. For example, `atom` transferred from one chain is different from `atom` transferred from another chain, i.e. each of these represents `atom` but they have different IBC denoms. ## Submit Proposal From 8bafe875b701903d37632b86292969faecb42ce2 Mon Sep 17 00:00:00 2001 From: MD Aleem <72057206+aleem1314@users.noreply.github.com> Date: Tue, 18 Oct 2022 18:56:18 +0530 Subject: [PATCH 09/17] chore: cleanup (#1527) Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> --- x/ecocredit/base/keeper/query_all_balances.go | 4 ---- x/ecocredit/base/keeper/query_class_fee.go | 1 - x/ecocredit/base/keeper/query_params.go | 1 - 3 files changed, 6 deletions(-) diff --git a/x/ecocredit/base/keeper/query_all_balances.go b/x/ecocredit/base/keeper/query_all_balances.go index 9a3418851f..d8d351f66c 100644 --- a/x/ecocredit/base/keeper/query_all_balances.go +++ b/x/ecocredit/base/keeper/query_all_balances.go @@ -5,7 +5,6 @@ import ( "github.com/cosmos/cosmos-sdk/orm/model/ormlist" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" api "github.com/regen-network/regen-ledger/api/regen/ecocredit/v1" "github.com/regen-network/regen-ledger/types/ormutil" @@ -15,9 +14,6 @@ import ( // AllBalances queries all credit balances from state with optional pagination. // NOTE: If no pagination is given in the request, responses will be limited by the Cosmos SDK's default limit (100). func (k Keeper) AllBalances(ctx context.Context, req *types.QueryAllBalancesRequest) (*types.QueryAllBalancesResponse, error) { - if req.Pagination == nil { - req.Pagination = &query.PageRequest{Limit: query.DefaultLimit} - } pg, err := ormutil.GogoPageReqToPulsarPageReq(req.Pagination) if err != nil { return nil, err diff --git a/x/ecocredit/base/keeper/query_class_fee.go b/x/ecocredit/base/keeper/query_class_fee.go index b45226be75..4d85d6ac00 100644 --- a/x/ecocredit/base/keeper/query_class_fee.go +++ b/x/ecocredit/base/keeper/query_class_fee.go @@ -18,7 +18,6 @@ func (k Keeper) ClassFee(ctx context.Context, request *types.QueryClassFeeReques } var fee sdk.Coin - if classFee.Fee != nil { var ok bool fee, ok = regentypes.ProtoCoinToCoin(classFee.Fee) diff --git a/x/ecocredit/base/keeper/query_params.go b/x/ecocredit/base/keeper/query_params.go index 96bf9d5306..b6e74041ff 100644 --- a/x/ecocredit/base/keeper/query_params.go +++ b/x/ecocredit/base/keeper/query_params.go @@ -36,7 +36,6 @@ func (k Keeper) Params(ctx context.Context, _ *types.QueryParamsRequest) (*types } creators = append(creators, sdk.AccAddress(val.Address).String()) - } classFee, err := k.stateStore.ClassFeeTable().Get(ctx) From a2454c5bea09b68bfd54b505f802d0c2d5ce5fa8 Mon Sep 17 00:00:00 2001 From: MD Aleem <72057206+aleem1314@users.noreply.github.com> Date: Tue, 18 Oct 2022 22:43:44 +0530 Subject: [PATCH 10/17] test(x/ecocredit): add base v1 sign bytes unit tests (#1516) Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> --- x/ecocredit/base/types/v1/codec.go | 2 + .../msg_add_allowed_bridge_chain.feature | 22 +++++++- .../v1/features/msg_add_class_creator.feature | 21 +++++++- .../v1/features/msg_add_credit_type.feature | 30 +++++++++++ .../base/types/v1/features/msg_bridge.feature | 34 ++++++++++++ .../v1/features/msg_bridge_receive.feature | 54 +++++++++++++++++++ .../base/types/v1/features/msg_cancel.feature | 32 +++++++++++ .../v1/features/msg_create_batch.feature | 42 +++++++++++++++ .../v1/features/msg_create_class.feature | 36 +++++++++++++ .../v1/features/msg_create_project.feature | 26 +++++++++ .../features/msg_mint_batch_credits.feature | 44 +++++++++++++++ .../msg_remove_allowed_bridge_chain.feature | 22 +++++++- .../features/msg_remove_class_creator.feature | 21 +++++++- .../base/types/v1/features/msg_retire.feature | 32 +++++++++++ .../types/v1/features/msg_seal_batch.feature | 20 +++++++ .../base/types/v1/features/msg_send.feature | 36 +++++++++++++ .../msg_set_class_creator_allowlist.feature | 20 +++++++ .../features/msg_update_class_admin.feature | 22 ++++++++ .../v1/features/msg_update_class_fee.feature | 25 +++++++++ .../features/msg_update_class_issuers.feature | 32 +++++++++++ .../msg_update_class_metadata.feature | 22 ++++++++ .../features/msg_update_project_admin.feature | 22 ++++++++ .../msg_update_project_metadata.feature | 22 ++++++++ .../v1/msg_add_allowed_bridge_chain_test.go | 21 ++++++-- .../types/v1/msg_add_class_creator_test.go | 19 +++++-- .../base/types/v1/msg_add_credit_type_test.go | 19 +++++-- .../base/types/v1/msg_bridge_receive_test.go | 19 +++++-- x/ecocredit/base/types/v1/msg_bridge_test.go | 19 +++++-- x/ecocredit/base/types/v1/msg_cancel_test.go | 19 +++++-- .../base/types/v1/msg_create_batch_test.go | 19 +++++-- .../base/types/v1/msg_create_class_test.go | 19 +++++-- .../base/types/v1/msg_create_project_test.go | 19 +++++-- .../types/v1/msg_mint_batch_credits_test.go | 19 +++++-- .../msg_remove_allowed_bridge_chain_test.go | 19 +++++-- .../types/v1/msg_remove_class_creator_test.go | 19 +++++-- x/ecocredit/base/types/v1/msg_retire_test.go | 19 +++++-- .../base/types/v1/msg_seal_batch_test.go | 19 +++++-- x/ecocredit/base/types/v1/msg_send_test.go | 19 +++++-- .../msg_set_class_creator_allowlist_test.go | 19 +++++-- .../types/v1/msg_update_class_admin_test.go | 19 +++++-- .../types/v1/msg_update_class_fee_test.go | 19 +++++-- .../types/v1/msg_update_class_issuers_test.go | 19 +++++-- .../v1/msg_update_class_metadata_test.go | 19 +++++-- .../types/v1/msg_update_project_admin_test.go | 19 +++++-- .../v1/msg_update_project_metadata_test.go | 19 +++++-- 45 files changed, 988 insertions(+), 71 deletions(-) diff --git a/x/ecocredit/base/types/v1/codec.go b/x/ecocredit/base/types/v1/codec.go index 3edd469061..2514e8029b 100644 --- a/x/ecocredit/base/types/v1/codec.go +++ b/x/ecocredit/base/types/v1/codec.go @@ -37,6 +37,8 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgRemoveClassCreator{}, "regen/MsgRemoveClassCreator", nil) cdc.RegisterConcrete(&MsgSetClassCreatorAllowlist{}, "regen/MsgSetClassCreatorAllowlist", nil) cdc.RegisterConcrete(&MsgUpdateClassFee{}, "regen/MsgUpdateClassFee", nil) + cdc.RegisterConcrete(&MsgAddAllowedBridgeChain{}, "regen/MsgAddAllowedBridgeChain", nil) + cdc.RegisterConcrete(&MsgRemoveAllowedBridgeChain{}, "regen/MsgRemoveAllowedBridgeChain", nil) } var ( diff --git a/x/ecocredit/base/types/v1/features/msg_add_allowed_bridge_chain.feature b/x/ecocredit/base/types/v1/features/msg_add_allowed_bridge_chain.feature index c31a34fa00..b92959d169 100644 --- a/x/ecocredit/base/types/v1/features/msg_add_allowed_bridge_chain.feature +++ b/x/ecocredit/base/types/v1/features/msg_add_allowed_bridge_chain.feature @@ -37,4 +37,24 @@ Feature: MsgAddAllowedBridgeChain } """ When the message is validated - Then expect the error "chain_name cannot be empty: invalid request" \ No newline at end of file + Then expect the error "chain_name cannot be empty: invalid request" + + Scenario: a valid amino message + Given the message + """ + { + "authority": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "chain_name": "polygon" + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen/MsgAddAllowedBridgeChain", + "value":{ + "authority":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "chain_name":"polygon" + } + } + """ diff --git a/x/ecocredit/base/types/v1/features/msg_add_class_creator.feature b/x/ecocredit/base/types/v1/features/msg_add_class_creator.feature index 8ad48c6e72..0deb001fb1 100644 --- a/x/ecocredit/base/types/v1/features/msg_add_class_creator.feature +++ b/x/ecocredit/base/types/v1/features/msg_add_class_creator.feature @@ -49,4 +49,23 @@ Feature: MsgAddClassCreator """ When the message is validated Then expect the error "decoding bech32 failed: invalid bech32 string length 4" - \ No newline at end of file + + Scenario: a valid amino message + Given the message + """ + { + "authority":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "creator": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6" + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen/MsgAddClassCreator", + "value":{ + "authority":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "creator":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6" + } + } + """ diff --git a/x/ecocredit/base/types/v1/features/msg_add_credit_type.feature b/x/ecocredit/base/types/v1/features/msg_add_credit_type.feature index 54f2f3e253..6573ca93a9 100644 --- a/x/ecocredit/base/types/v1/features/msg_add_credit_type.feature +++ b/x/ecocredit/base/types/v1/features/msg_add_credit_type.feature @@ -107,3 +107,33 @@ Feature: MsgAddCreditType """ When the message is validated Then expect the error "credit type: precision is currently locked to 6: parse error: invalid request" + + Scenario: a valid amino message + Given the message + """ + { + "authority":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "credit_type": { + "abbreviation":"C", + "name":"carbon", + "unit":"ton", + "precision":6 + } + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen/MsgAddCreditType", + "value":{ + "authority":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "credit_type":{ + "abbreviation":"C", + "name":"carbon", + "precision":6, + "unit":"ton" + } + } + } + """ diff --git a/x/ecocredit/base/types/v1/features/msg_bridge.feature b/x/ecocredit/base/types/v1/features/msg_bridge.feature index 9cea39ce2c..4e51fdd91f 100644 --- a/x/ecocredit/base/types/v1/features/msg_bridge.feature +++ b/x/ecocredit/base/types/v1/features/msg_bridge.feature @@ -169,3 +169,37 @@ Feature: MsgBridge """ When the message is validated Then expect the error "credits[0]: amount: expected a positive decimal, got -100: invalid decimal string" + + Scenario: a valid amino message + Given the message + """ + { + "owner": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "target": "polygon", + "recipient": "0x323b5d4c32345ced77393b3530b1eed0f346429d", + "credits": [ + { + "batch_denom": "C01-001-20200101-20210101-001", + "amount": "100" + } + ] + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen/MsgBridge", + "value":{ + "credits":[ + { + "amount":"100", + "batch_denom":"C01-001-20200101-20210101-001" + } + ], + "owner":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "recipient":"0x323b5d4c32345ced77393b3530b1eed0f346429d", + "target":"polygon" + } + } + """ diff --git a/x/ecocredit/base/types/v1/features/msg_bridge_receive.feature b/x/ecocredit/base/types/v1/features/msg_bridge_receive.feature index bebf82908b..d3011e5fe1 100644 --- a/x/ecocredit/base/types/v1/features/msg_bridge_receive.feature +++ b/x/ecocredit/base/types/v1/features/msg_bridge_receive.feature @@ -496,3 +496,57 @@ Feature: MsgBridgeReceive Then expect the error "origin_tx.contract must be a valid ethereum address: invalid address" # Note: additional validation for origin tx covered in origin_tx_test.go + + Scenario: a valid amino message + Given the message + """ + { + "issuer": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "class_id": "C01", + "project": { + "reference_id": "VCS-001", + "jurisdiction": "US-WA", + "metadata": "regen:13toVgf5aZqSVSeJQv562xkkeoe3rr3bJWa29PHVKVf77VAkVMcDvVd.rdf" + }, + "batch": { + "recipient": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "amount": "100", + "start_date": "2020-01-01T00:00:00Z", + "end_date": "2021-01-01T00:00:00Z", + "metadata": "regen:13toVgf5aZqSVSeJQv562xkkeoe3rr3bJWa29PHVKVf77VAkVMcDvVd.rdf" + }, + "origin_tx": { + "id": "0x7a70692a348e8688f54ab2bdfe87d925d8cc88932520492a11eaa02dc128243e", + "source": "polygon", + "contract": "0x0e65079a29d7793ab5ca500c2d88e60ee99ba606" + } + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen/MsgBridgeReceive", + "value":{ + "batch":{ + "amount":"100", + "end_date":"2021-01-01T00:00:00Z", + "metadata":"regen:13toVgf5aZqSVSeJQv562xkkeoe3rr3bJWa29PHVKVf77VAkVMcDvVd.rdf", + "recipient":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "start_date":"2020-01-01T00:00:00Z" + }, + "class_id":"C01", + "issuer":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "origin_tx":{ + "contract":"0x0e65079a29d7793ab5ca500c2d88e60ee99ba606", + "id":"0x7a70692a348e8688f54ab2bdfe87d925d8cc88932520492a11eaa02dc128243e", + "source":"polygon" + }, + "project":{ + "jurisdiction":"US-WA", + "metadata":"regen:13toVgf5aZqSVSeJQv562xkkeoe3rr3bJWa29PHVKVf77VAkVMcDvVd.rdf", + "reference_id":"VCS-001" + } + } + } + """ diff --git a/x/ecocredit/base/types/v1/features/msg_cancel.feature b/x/ecocredit/base/types/v1/features/msg_cancel.feature index 9bf311c539..30a1c8384a 100644 --- a/x/ecocredit/base/types/v1/features/msg_cancel.feature +++ b/x/ecocredit/base/types/v1/features/msg_cancel.feature @@ -128,3 +128,35 @@ Feature: MsgCancel And a reason with length "513" When the message is validated Then expect the error "reason: max length 512: limit exceeded" + + Scenario: a valid amino message + Given the message + """ + { + "owner": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "credits": [ + { + "batch_denom": "C01-001-20200101-20210101-001", + "amount": "100" + } + ], + "reason": "transferring credits to another registry" + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen/MsgCancel", + "value":{ + "credits":[ + { + "amount":"100", + "batch_denom":"C01-001-20200101-20210101-001" + } + ], + "owner":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "reason":"transferring credits to another registry" + } + } + """ diff --git a/x/ecocredit/base/types/v1/features/msg_create_batch.feature b/x/ecocredit/base/types/v1/features/msg_create_batch.feature index d9fcd25b5f..82e0868d56 100644 --- a/x/ecocredit/base/types/v1/features/msg_create_batch.feature +++ b/x/ecocredit/base/types/v1/features/msg_create_batch.feature @@ -295,3 +295,45 @@ Feature: MsgCreateBatch Then expect the error "origin_tx.source cannot be empty: invalid request" # Note: additional validation for origin tx covered in types_origin_tx_test.go + + Scenario: a valid amino message + Given the message + """ + { + "issuer": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "project_id": "C01-001", + "issuance": [ + { + "recipient": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "tradable_amount": "100", + "retired_amount": "100", + "retirement_jurisdiction": "US-WA" + } + ], + "metadata": "regen:13toVgf5aZqSVSeJQv562xkkeoe3rr3bJWa29PHVKVf77VAkVMcDvVd.rdf", + "start_date": "2020-01-01T00:00:00Z", + "end_date": "2021-01-01T00:00:00Z" + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen/MsgCreateBatch", + "value":{ + "end_date":"2021-01-01T00:00:00Z", + "issuance":[ + { + "recipient":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "retired_amount":"100", + "retirement_jurisdiction":"US-WA", + "tradable_amount":"100" + } + ], + "issuer":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "metadata":"regen:13toVgf5aZqSVSeJQv562xkkeoe3rr3bJWa29PHVKVf77VAkVMcDvVd.rdf", + "project_id":"C01-001", + "start_date":"2020-01-01T00:00:00Z" + } + } + """ diff --git a/x/ecocredit/base/types/v1/features/msg_create_class.feature b/x/ecocredit/base/types/v1/features/msg_create_class.feature index f92b79666a..f76bc0095f 100644 --- a/x/ecocredit/base/types/v1/features/msg_create_class.feature +++ b/x/ecocredit/base/types/v1/features/msg_create_class.feature @@ -222,3 +222,39 @@ Feature: MsgCreateClass """ When the message is validated Then expect the error "fee amount must be positive: insufficient fee" + + Scenario: a valid amino message + Given the message + """ + { + "admin": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "issuers": [ + "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6" + ], + "metadata": "regen:13toVgf5aZqSVSeJQv562xkkeoe3rr3bJWa29PHVKVf77VAkVMcDvVd.rdf", + "credit_type_abbrev": "C", + "fee": { + "denom": "uregen", + "amount": "20000000" + } + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen/MsgCreateClass", + "value":{ + "admin":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "credit_type_abbrev":"C", + "fee":{ + "amount":"20000000", + "denom":"uregen" + }, + "issuers":[ + "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6" + ], + "metadata":"regen:13toVgf5aZqSVSeJQv562xkkeoe3rr3bJWa29PHVKVf77VAkVMcDvVd.rdf" + } + } + """ diff --git a/x/ecocredit/base/types/v1/features/msg_create_project.feature b/x/ecocredit/base/types/v1/features/msg_create_project.feature index c8ed15612c..670150b06b 100644 --- a/x/ecocredit/base/types/v1/features/msg_create_project.feature +++ b/x/ecocredit/base/types/v1/features/msg_create_project.feature @@ -129,3 +129,29 @@ Feature: MsgCreateProject And a reference id with length "33" When the message is validated Then expect the error "reference id: max length 32: limit exceeded" + + Scenario: a valid amino message + Given the message + """ + { + "admin": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "class_id": "C01", + "metadata": "regen:13toVgf5aZqSVSeJQv562xkkeoe3rr3bJWa29PHVKVf77VAkVMcDvVd.rdf", + "jurisdiction": "US-WA", + "reference_id": "VCS-001" + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen/MsgCreateProject", + "value":{ + "admin":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "class_id":"C01", + "jurisdiction":"US-WA", + "metadata":"regen:13toVgf5aZqSVSeJQv562xkkeoe3rr3bJWa29PHVKVf77VAkVMcDvVd.rdf", + "reference_id":"VCS-001" + } + } + """ diff --git a/x/ecocredit/base/types/v1/features/msg_mint_batch_credits.feature b/x/ecocredit/base/types/v1/features/msg_mint_batch_credits.feature index f41eac9255..17f23c5886 100644 --- a/x/ecocredit/base/types/v1/features/msg_mint_batch_credits.feature +++ b/x/ecocredit/base/types/v1/features/msg_mint_batch_credits.feature @@ -178,3 +178,47 @@ Feature: MsgMintBatchCredits Then expect the error "origin_tx.source cannot be empty: invalid request" # Note: additional validation for origin tx covered in types_origin_tx_test.go + + Scenario: a valid amino message + Given the message + """ + { + "issuer": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "batch_denom": "C01-001-20200101-20210101-001", + "issuance": [ + { + "recipient": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "tradable_amount": "100", + "retired_amount": "100", + "retirement_jurisdiction": "US-WA" + } + ], + "origin_tx": { + "id": "0001-000001-000100-VCS-VCU-003-VER-US-0003-01012020-31122020-1", + "source": "verra" + } + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen/MsgMintBatchCredits", + "value":{ + "batch_denom":"C01-001-20200101-20210101-001", + "issuance":[ + { + "recipient":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "retired_amount":"100", + "retirement_jurisdiction":"US-WA", + "tradable_amount":"100" + } + ], + "issuer":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "origin_tx":{ + "id":"0001-000001-000100-VCS-VCU-003-VER-US-0003-01012020-31122020-1", + "source":"verra" + } + } + } + """ diff --git a/x/ecocredit/base/types/v1/features/msg_remove_allowed_bridge_chain.feature b/x/ecocredit/base/types/v1/features/msg_remove_allowed_bridge_chain.feature index 2495b2ce1d..e463d4cb35 100644 --- a/x/ecocredit/base/types/v1/features/msg_remove_allowed_bridge_chain.feature +++ b/x/ecocredit/base/types/v1/features/msg_remove_allowed_bridge_chain.feature @@ -37,4 +37,24 @@ Feature: MsgRemoveAllowedBridgeChain } """ When the message is validated - Then expect the error "chain_name cannot be empty: invalid request" \ No newline at end of file + Then expect the error "chain_name cannot be empty: invalid request" + + Scenario: a valid amino message + Given the message + """ + { + "authority": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "chain_name": "polygon" + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen/MsgRemoveAllowedBridgeChain", + "value":{ + "authority":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "chain_name":"polygon" + } + } + """ diff --git a/x/ecocredit/base/types/v1/features/msg_remove_class_creator.feature b/x/ecocredit/base/types/v1/features/msg_remove_class_creator.feature index 4e7ee148e3..e0981a99d0 100644 --- a/x/ecocredit/base/types/v1/features/msg_remove_class_creator.feature +++ b/x/ecocredit/base/types/v1/features/msg_remove_class_creator.feature @@ -49,4 +49,23 @@ Feature: MsgRemoveClassCreator """ When the message is validated Then expect the error "decoding bech32 failed: invalid bech32 string length 4" - \ No newline at end of file + + Scenario: a valid amino message + Given the message + """ + { + "authority":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "creator": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6" + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen/MsgRemoveClassCreator", + "value":{ + "authority":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "creator":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6" + } + } + """ diff --git a/x/ecocredit/base/types/v1/features/msg_retire.feature b/x/ecocredit/base/types/v1/features/msg_retire.feature index 78fe6b9c15..8eea0afd9b 100644 --- a/x/ecocredit/base/types/v1/features/msg_retire.feature +++ b/x/ecocredit/base/types/v1/features/msg_retire.feature @@ -128,3 +128,35 @@ Feature: MsgRetire """ When the message is validated Then expect the error "jurisdiction: expected format [-[ ]]: parse error: invalid request" + + Scenario: a valid amino message + Given the message + """ + { + "owner": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "credits": [ + { + "batch_denom": "C01-001-20200101-20210101-001", + "amount": "100" + } + ], + "jurisdiction": "US-WA" + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen/MsgRetire", + "value":{ + "credits":[ + { + "amount":"100", + "batch_denom":"C01-001-20200101-20210101-001" + } + ], + "jurisdiction":"US-WA", + "owner":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6" + } + } + """ diff --git a/x/ecocredit/base/types/v1/features/msg_seal_batch.feature b/x/ecocredit/base/types/v1/features/msg_seal_batch.feature index 11b0b13455..07b49087a6 100644 --- a/x/ecocredit/base/types/v1/features/msg_seal_batch.feature +++ b/x/ecocredit/base/types/v1/features/msg_seal_batch.feature @@ -49,3 +49,23 @@ Feature: MsgSealBatch """ When the message is validated Then expect the error "batch denom: expected format ---: parse error: invalid request" + + Scenario: a valid amino message + Given the message + """ + { + "issuer": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "batch_denom": "C01-001-20200101-20210101-001" + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen/MsgSealBatch", + "value":{ + "batch_denom":"C01-001-20200101-20210101-001", + "issuer":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6" + } + } + """ diff --git a/x/ecocredit/base/types/v1/features/msg_send.feature b/x/ecocredit/base/types/v1/features/msg_send.feature index 8ab903c270..72c8a04c13 100644 --- a/x/ecocredit/base/types/v1/features/msg_send.feature +++ b/x/ecocredit/base/types/v1/features/msg_send.feature @@ -205,3 +205,39 @@ Feature: MsgSend """ When the message is validated Then expect the error "retirement jurisdiction: expected format [-[ ]]: parse error: invalid request" + + Scenario: a valid amino message + Given the message + """ + { + "sender": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "recipient": "regen1tnh2q55v8wyygtt9srz5safamzdengsnlm0yy4", + "credits": [ + { + "batch_denom": "C01-001-20200101-20210101-001", + "tradable_amount": "100", + "retired_amount": "100", + "retirement_jurisdiction": "US-WA" + } + ] + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen/MsgSend", + "value":{ + "credits":[ + { + "batch_denom":"C01-001-20200101-20210101-001", + "retired_amount":"100", + "retirement_jurisdiction":"US-WA", + "tradable_amount":"100" + } + ], + "recipient":"regen1tnh2q55v8wyygtt9srz5safamzdengsnlm0yy4", + "sender":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6" + } + } + """ diff --git a/x/ecocredit/base/types/v1/features/msg_set_class_creator_allowlist.feature b/x/ecocredit/base/types/v1/features/msg_set_class_creator_allowlist.feature index 65e5a818e4..38ed3ce240 100644 --- a/x/ecocredit/base/types/v1/features/msg_set_class_creator_allowlist.feature +++ b/x/ecocredit/base/types/v1/features/msg_set_class_creator_allowlist.feature @@ -29,3 +29,23 @@ Feature: MsgSetClassCreatorAllowlist When the message is validated Then expect the error "invalid authority address: decoding bech32 failed: invalid bech32 string length 3" + + Scenario: a valid amino message + Given the message + """ + { + "authority":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "enabled": true + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen/MsgSetClassCreatorAllowlist", + "value":{ + "authority":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "enabled":true + } + } + """ diff --git a/x/ecocredit/base/types/v1/features/msg_update_class_admin.feature b/x/ecocredit/base/types/v1/features/msg_update_class_admin.feature index 1f3610ec02..ca87f73044 100644 --- a/x/ecocredit/base/types/v1/features/msg_update_class_admin.feature +++ b/x/ecocredit/base/types/v1/features/msg_update_class_admin.feature @@ -85,3 +85,25 @@ Feature: MsgUpdateClassAdmin """ When the message is validated Then expect the error "admin and new admin cannot be the same: invalid request" + + Scenario: a valid amino message + Given the message + """ + { + "admin": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "class_id": "C01", + "new_admin": "regen1tnh2q55v8wyygtt9srz5safamzdengsnlm0yy4" + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen/MsgUpdateClassAdmin", + "value":{ + "admin":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "class_id":"C01", + "new_admin":"regen1tnh2q55v8wyygtt9srz5safamzdengsnlm0yy4" + } + } + """ diff --git a/x/ecocredit/base/types/v1/features/msg_update_class_fee.feature b/x/ecocredit/base/types/v1/features/msg_update_class_fee.feature index 42ec9c08b8..b7faa574a6 100644 --- a/x/ecocredit/base/types/v1/features/msg_update_class_fee.feature +++ b/x/ecocredit/base/types/v1/features/msg_update_class_fee.feature @@ -56,3 +56,28 @@ Feature: MsgUpdateClassFee When the message is validated Then expect the error "invalid denom: 1: invalid request" + Scenario: a valid amino message + Given the message + """ + { + "authority":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "fee": { + "denom":"uregen", + "amount":"1000" + } + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen/MsgUpdateClassFee", + "value":{ + "authority":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "fee":{ + "amount":"1000", + "denom":"uregen" + } + } + } + """ diff --git a/x/ecocredit/base/types/v1/features/msg_update_class_issuers.feature b/x/ecocredit/base/types/v1/features/msg_update_class_issuers.feature index 987aaaa88f..ee240a843c 100644 --- a/x/ecocredit/base/types/v1/features/msg_update_class_issuers.feature +++ b/x/ecocredit/base/types/v1/features/msg_update_class_issuers.feature @@ -152,3 +152,35 @@ Feature: MsgUpdateClassIssuers """ When the message is validated Then expect the error "remove_issuers[1]: duplicate issuer: invalid request" + + Scenario: a valid amino message + Given the message + """ + { + "admin": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "class_id": "C01", + "add_issuers": [ + "regen1tnh2q55v8wyygtt9srz5safamzdengsnlm0yy4" + ], + "remove_issuers": [ + "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6" + ] + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen/MsgUpdateClassIssuers", + "value":{ + "add_issuers":[ + "regen1tnh2q55v8wyygtt9srz5safamzdengsnlm0yy4" + ], + "admin":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "class_id":"C01", + "remove_issuers":[ + "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6" + ] + } + } + """ diff --git a/x/ecocredit/base/types/v1/features/msg_update_class_metadata.feature b/x/ecocredit/base/types/v1/features/msg_update_class_metadata.feature index 5bd584b942..d44b69e9f9 100644 --- a/x/ecocredit/base/types/v1/features/msg_update_class_metadata.feature +++ b/x/ecocredit/base/types/v1/features/msg_update_class_metadata.feature @@ -73,3 +73,25 @@ Feature: MsgUpdateClassMetadata And new metadata with length "257" When the message is validated Then expect the error "metadata: max length 256: limit exceeded" + + Scenario: a valid amino message + Given the message + """ + { + "admin": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "class_id": "C01", + "new_metadata": "regen:13toVgf5aZqSVSeJQv562xkkeoe3rr3bJWa29PHVKVf77VAkVMcDvVd.rdf" + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen/MsgUpdateClassMetadata", + "value":{ + "admin":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "class_id":"C01", + "new_metadata":"regen:13toVgf5aZqSVSeJQv562xkkeoe3rr3bJWa29PHVKVf77VAkVMcDvVd.rdf" + } + } + """ diff --git a/x/ecocredit/base/types/v1/features/msg_update_project_admin.feature b/x/ecocredit/base/types/v1/features/msg_update_project_admin.feature index 4e16f8a0ca..edcb2f4931 100644 --- a/x/ecocredit/base/types/v1/features/msg_update_project_admin.feature +++ b/x/ecocredit/base/types/v1/features/msg_update_project_admin.feature @@ -85,3 +85,25 @@ Feature: MsgUpdateProjectAdmin """ When the message is validated Then expect the error "admin and new admin cannot be the same: invalid request" + + Scenario: a valid amino message + Given the message + """ + { + "admin": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "project_id": "C01-001", + "new_admin": "regen1tnh2q55v8wyygtt9srz5safamzdengsnlm0yy4" + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen/MsgUpdateProjectAdmin", + "value":{ + "admin":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "new_admin":"regen1tnh2q55v8wyygtt9srz5safamzdengsnlm0yy4", + "project_id":"C01-001" + } + } + """ diff --git a/x/ecocredit/base/types/v1/features/msg_update_project_metadata.feature b/x/ecocredit/base/types/v1/features/msg_update_project_metadata.feature index 83b0c36556..4691c11bbb 100644 --- a/x/ecocredit/base/types/v1/features/msg_update_project_metadata.feature +++ b/x/ecocredit/base/types/v1/features/msg_update_project_metadata.feature @@ -73,3 +73,25 @@ Feature: MsgUpdateProjectMetadata And new metadata with length "257" When the message is validated Then expect the error "metadata: max length is 256: limit exceeded" + + Scenario: a valid amino message + Given the message + """ + { + "admin": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "project_id": "C01-001", + "new_metadata": "regen:13toVgf5aZqSVSeJQv562xkkeoe3rr3bJWa29PHVKVf77VAkVMcDvVd.rdf" + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen/MsgUpdateProjectMetadata", + "value":{ + "admin":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "new_metadata":"regen:13toVgf5aZqSVSeJQv562xkkeoe3rr3bJWa29PHVKVf77VAkVMcDvVd.rdf", + "project_id":"C01-001" + } + } + """ diff --git a/x/ecocredit/base/types/v1/msg_add_allowed_bridge_chain_test.go b/x/ecocredit/base/types/v1/msg_add_allowed_bridge_chain_test.go index fd330b9986..3b08fdb9fc 100644 --- a/x/ecocredit/base/types/v1/msg_add_allowed_bridge_chain_test.go +++ b/x/ecocredit/base/types/v1/msg_add_allowed_bridge_chain_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,13 +11,14 @@ import ( ) type msgAddAllowedBridgeChain struct { - t gocuke.TestingT - msg *MsgAddAllowedBridgeChain - err error + t gocuke.TestingT + msg *MsgAddAllowedBridgeChain + signBytes string + err error } func TestMsgAddAllowedBridgeChain(t *testing.T) { - gocuke.NewRunner(t, &msgAddAllowedBridgeChain{}).Path("./features/msg_add_allowed_bridge_chain.feature.feature").Run() + gocuke.NewRunner(t, &msgAddAllowedBridgeChain{}).Path("./features/msg_add_allowed_bridge_chain.feature").Run() } func (s *msgAddAllowedBridgeChain) Before(t gocuke.TestingT) { @@ -39,3 +42,13 @@ func (s *msgAddAllowedBridgeChain) ExpectTheError(a string) { func (s *msgAddAllowedBridgeChain) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgAddAllowedBridgeChain) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgAddAllowedBridgeChain) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/base/types/v1/msg_add_class_creator_test.go b/x/ecocredit/base/types/v1/msg_add_class_creator_test.go index 6809d81883..bf2b9b1597 100644 --- a/x/ecocredit/base/types/v1/msg_add_class_creator_test.go +++ b/x/ecocredit/base/types/v1/msg_add_class_creator_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgAddClassCreator struct { - t gocuke.TestingT - msg *MsgAddClassCreator - err error + t gocuke.TestingT + msg *MsgAddClassCreator + err error + signBytes string } func TestMsgAddClassCreator(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgAddClassCreator) ExpectTheError(a string) { func (s *msgAddClassCreator) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgAddClassCreator) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgAddClassCreator) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/base/types/v1/msg_add_credit_type_test.go b/x/ecocredit/base/types/v1/msg_add_credit_type_test.go index 38ad725208..24bb8ab252 100644 --- a/x/ecocredit/base/types/v1/msg_add_credit_type_test.go +++ b/x/ecocredit/base/types/v1/msg_add_credit_type_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgAddCreditType struct { - t gocuke.TestingT - msg *MsgAddCreditType - err error + t gocuke.TestingT + msg *MsgAddCreditType + err error + signBytes string } func TestMsgAddCreditType(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgAddCreditType) ExpectTheError(a string) { func (s *msgAddCreditType) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgAddCreditType) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgAddCreditType) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/base/types/v1/msg_bridge_receive_test.go b/x/ecocredit/base/types/v1/msg_bridge_receive_test.go index 4d8b05227a..226ef774a1 100644 --- a/x/ecocredit/base/types/v1/msg_bridge_receive_test.go +++ b/x/ecocredit/base/types/v1/msg_bridge_receive_test.go @@ -2,6 +2,8 @@ package v1 import ( + "bytes" + "encoding/json" "strconv" "strings" "testing" @@ -12,9 +14,10 @@ import ( ) type msgBridgeReceive struct { - t gocuke.TestingT - msg *MsgBridgeReceive - err error + t gocuke.TestingT + msg *MsgBridgeReceive + err error + signBytes string } func TestMsgBridgeReceive(t *testing.T) { @@ -64,3 +67,13 @@ func (s *msgBridgeReceive) ExpectTheError(a string) { func (s *msgBridgeReceive) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgBridgeReceive) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgBridgeReceive) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/base/types/v1/msg_bridge_test.go b/x/ecocredit/base/types/v1/msg_bridge_test.go index 54691c7b51..45458b27fc 100644 --- a/x/ecocredit/base/types/v1/msg_bridge_test.go +++ b/x/ecocredit/base/types/v1/msg_bridge_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgBridge struct { - t gocuke.TestingT - msg *MsgBridge - err error + t gocuke.TestingT + msg *MsgBridge + err error + signBytes string } func TestMsgBridge(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgBridge) ExpectTheError(a string) { func (s *msgBridge) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgBridge) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgBridge) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/base/types/v1/msg_cancel_test.go b/x/ecocredit/base/types/v1/msg_cancel_test.go index 22d23c0acb..90cedc8186 100644 --- a/x/ecocredit/base/types/v1/msg_cancel_test.go +++ b/x/ecocredit/base/types/v1/msg_cancel_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "strconv" "strings" "testing" @@ -11,9 +13,10 @@ import ( ) type msgCancel struct { - t gocuke.TestingT - msg *MsgCancel - err error + t gocuke.TestingT + msg *MsgCancel + err error + signBytes string } func TestMsgCancel(t *testing.T) { @@ -48,3 +51,13 @@ func (s *msgCancel) ExpectTheError(a string) { func (s *msgCancel) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgCancel) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgCancel) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/base/types/v1/msg_create_batch_test.go b/x/ecocredit/base/types/v1/msg_create_batch_test.go index 33c947c844..8a3d1356a8 100644 --- a/x/ecocredit/base/types/v1/msg_create_batch_test.go +++ b/x/ecocredit/base/types/v1/msg_create_batch_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "strconv" "strings" "testing" @@ -11,9 +13,10 @@ import ( ) type msgCreateBatch struct { - t gocuke.TestingT - msg *MsgCreateBatch - err error + t gocuke.TestingT + msg *MsgCreateBatch + err error + signBytes string } func TestMsgCreateBatch(t *testing.T) { @@ -48,3 +51,13 @@ func (s *msgCreateBatch) ExpectTheError(a string) { func (s *msgCreateBatch) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgCreateBatch) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgCreateBatch) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/base/types/v1/msg_create_class_test.go b/x/ecocredit/base/types/v1/msg_create_class_test.go index c80e2a6441..008d530589 100644 --- a/x/ecocredit/base/types/v1/msg_create_class_test.go +++ b/x/ecocredit/base/types/v1/msg_create_class_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "strconv" "strings" "testing" @@ -11,9 +13,10 @@ import ( ) type msgCreateClass struct { - t gocuke.TestingT - msg *MsgCreateClass - err error + t gocuke.TestingT + msg *MsgCreateClass + err error + signBytes string } func TestMsgCreateClass(t *testing.T) { @@ -48,3 +51,13 @@ func (s *msgCreateClass) ExpectTheError(a string) { func (s *msgCreateClass) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgCreateClass) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgCreateClass) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/base/types/v1/msg_create_project_test.go b/x/ecocredit/base/types/v1/msg_create_project_test.go index 7090a78dee..fe79c9bca4 100644 --- a/x/ecocredit/base/types/v1/msg_create_project_test.go +++ b/x/ecocredit/base/types/v1/msg_create_project_test.go @@ -2,6 +2,8 @@ package v1 import ( + "bytes" + "encoding/json" "strconv" "strings" "testing" @@ -12,9 +14,10 @@ import ( ) type msgCreateProject struct { - t gocuke.TestingT - msg *MsgCreateProject - err error + t gocuke.TestingT + msg *MsgCreateProject + err error + signBytes string } func TestMsgCreateProject(t *testing.T) { @@ -56,3 +59,13 @@ func (s *msgCreateProject) ExpectTheError(a string) { func (s *msgCreateProject) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgCreateProject) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgCreateProject) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/base/types/v1/msg_mint_batch_credits_test.go b/x/ecocredit/base/types/v1/msg_mint_batch_credits_test.go index db7b4d6076..5c2b9b93f7 100644 --- a/x/ecocredit/base/types/v1/msg_mint_batch_credits_test.go +++ b/x/ecocredit/base/types/v1/msg_mint_batch_credits_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgMintBatchCredits struct { - t gocuke.TestingT - msg *MsgMintBatchCredits - err error + t gocuke.TestingT + msg *MsgMintBatchCredits + err error + signBytes string } func TestMsgMintBatchCredits(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgMintBatchCredits) ExpectTheError(a string) { func (s *msgMintBatchCredits) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgMintBatchCredits) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgMintBatchCredits) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/base/types/v1/msg_remove_allowed_bridge_chain_test.go b/x/ecocredit/base/types/v1/msg_remove_allowed_bridge_chain_test.go index a0be9a0a63..88bfedcbe4 100644 --- a/x/ecocredit/base/types/v1/msg_remove_allowed_bridge_chain_test.go +++ b/x/ecocredit/base/types/v1/msg_remove_allowed_bridge_chain_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgRemoveAllowedBridgeChain struct { - t gocuke.TestingT - msg *MsgRemoveAllowedBridgeChain - err error + t gocuke.TestingT + msg *MsgRemoveAllowedBridgeChain + err error + signBytes string } func TestMsgRemoveAllowedBridgeChain(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgRemoveAllowedBridgeChain) ExpectTheError(a string) { func (s *msgRemoveAllowedBridgeChain) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgRemoveAllowedBridgeChain) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgRemoveAllowedBridgeChain) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/base/types/v1/msg_remove_class_creator_test.go b/x/ecocredit/base/types/v1/msg_remove_class_creator_test.go index 0c90b42653..d76b5e6b9b 100644 --- a/x/ecocredit/base/types/v1/msg_remove_class_creator_test.go +++ b/x/ecocredit/base/types/v1/msg_remove_class_creator_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgRemoveClassCreator struct { - t gocuke.TestingT - msg *MsgRemoveClassCreator - err error + t gocuke.TestingT + msg *MsgRemoveClassCreator + err error + signBytes string } func TestMsgRemoveClassCreators(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgRemoveClassCreator) ExpectTheError(a string) { func (s *msgRemoveClassCreator) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgRemoveClassCreator) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgRemoveClassCreator) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/base/types/v1/msg_retire_test.go b/x/ecocredit/base/types/v1/msg_retire_test.go index 9b5a0eb06c..91d1589098 100644 --- a/x/ecocredit/base/types/v1/msg_retire_test.go +++ b/x/ecocredit/base/types/v1/msg_retire_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgRetire struct { - t gocuke.TestingT - msg *MsgRetire - err error + t gocuke.TestingT + msg *MsgRetire + err error + signBytes string } func TestMsgRetire(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgRetire) ExpectTheError(a string) { func (s *msgRetire) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgRetire) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgRetire) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/base/types/v1/msg_seal_batch_test.go b/x/ecocredit/base/types/v1/msg_seal_batch_test.go index 29385124aa..4bd2991e86 100644 --- a/x/ecocredit/base/types/v1/msg_seal_batch_test.go +++ b/x/ecocredit/base/types/v1/msg_seal_batch_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgSealBatch struct { - t gocuke.TestingT - msg *MsgSealBatch - err error + t gocuke.TestingT + msg *MsgSealBatch + err error + signBytes string } func TestMsgSealBatch(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgSealBatch) ExpectTheError(a string) { func (s *msgSealBatch) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgSealBatch) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgSealBatch) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/base/types/v1/msg_send_test.go b/x/ecocredit/base/types/v1/msg_send_test.go index f9e14f2ddf..c1221a8ede 100644 --- a/x/ecocredit/base/types/v1/msg_send_test.go +++ b/x/ecocredit/base/types/v1/msg_send_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgSend struct { - t gocuke.TestingT - msg *MsgSend - err error + t gocuke.TestingT + msg *MsgSend + err error + signBytes string } func TestMsgSend(t *testing.T) { @@ -48,3 +51,13 @@ func TestMsgSendAmino(t *testing.T) { string(msg.GetSignBytes()), ) } + +func (s *msgSend) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgSend) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/base/types/v1/msg_set_class_creator_allowlist_test.go b/x/ecocredit/base/types/v1/msg_set_class_creator_allowlist_test.go index 5dccfe54a8..9add2ce447 100644 --- a/x/ecocredit/base/types/v1/msg_set_class_creator_allowlist_test.go +++ b/x/ecocredit/base/types/v1/msg_set_class_creator_allowlist_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgSetClassCreatorAllowlist struct { - t gocuke.TestingT - msg *MsgSetClassCreatorAllowlist - err error + t gocuke.TestingT + msg *MsgSetClassCreatorAllowlist + err error + signBytes string } func TestMsgSetClassCreatorAllowlist(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgSetClassCreatorAllowlist) ExpectTheError(a string) { func (s *msgSetClassCreatorAllowlist) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgSetClassCreatorAllowlist) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgSetClassCreatorAllowlist) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/base/types/v1/msg_update_class_admin_test.go b/x/ecocredit/base/types/v1/msg_update_class_admin_test.go index 29255f8540..13b5168a5c 100644 --- a/x/ecocredit/base/types/v1/msg_update_class_admin_test.go +++ b/x/ecocredit/base/types/v1/msg_update_class_admin_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgUpdateClassAdmin struct { - t gocuke.TestingT - msg *MsgUpdateClassAdmin - err error + t gocuke.TestingT + msg *MsgUpdateClassAdmin + err error + signBytes string } func TestMsgUpdateClassAdmin(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgUpdateClassAdmin) ExpectTheError(a string) { func (s *msgUpdateClassAdmin) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgUpdateClassAdmin) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgUpdateClassAdmin) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/base/types/v1/msg_update_class_fee_test.go b/x/ecocredit/base/types/v1/msg_update_class_fee_test.go index c6c1e1844e..7857ea9e9d 100644 --- a/x/ecocredit/base/types/v1/msg_update_class_fee_test.go +++ b/x/ecocredit/base/types/v1/msg_update_class_fee_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgUpdateClassFee struct { - t gocuke.TestingT - msg *MsgUpdateClassFee - err error + t gocuke.TestingT + msg *MsgUpdateClassFee + err error + signBytes string } func TestMsgUpdateClassFee(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgUpdateClassFee) ExpectTheError(a string) { func (s *msgUpdateClassFee) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgUpdateClassFee) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgUpdateClassFee) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/base/types/v1/msg_update_class_issuers_test.go b/x/ecocredit/base/types/v1/msg_update_class_issuers_test.go index d082b240b4..8122a32f63 100644 --- a/x/ecocredit/base/types/v1/msg_update_class_issuers_test.go +++ b/x/ecocredit/base/types/v1/msg_update_class_issuers_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgUpdateClassIssuers struct { - t gocuke.TestingT - msg *MsgUpdateClassIssuers - err error + t gocuke.TestingT + msg *MsgUpdateClassIssuers + err error + signBytes string } func TestMsgUpdateClassIssuers(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgUpdateClassIssuers) ExpectTheError(a string) { func (s *msgUpdateClassIssuers) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgUpdateClassIssuers) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgUpdateClassIssuers) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/base/types/v1/msg_update_class_metadata_test.go b/x/ecocredit/base/types/v1/msg_update_class_metadata_test.go index 255abc8911..ae5fb8b7e9 100644 --- a/x/ecocredit/base/types/v1/msg_update_class_metadata_test.go +++ b/x/ecocredit/base/types/v1/msg_update_class_metadata_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "strconv" "strings" "testing" @@ -11,9 +13,10 @@ import ( ) type msgUpdateClassMetadata struct { - t gocuke.TestingT - msg *MsgUpdateClassMetadata - err error + t gocuke.TestingT + msg *MsgUpdateClassMetadata + err error + signBytes string } func TestMsgUpdateClassMetadata(t *testing.T) { @@ -48,3 +51,13 @@ func (s *msgUpdateClassMetadata) ExpectTheError(a string) { func (s *msgUpdateClassMetadata) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgUpdateClassMetadata) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgUpdateClassMetadata) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/base/types/v1/msg_update_project_admin_test.go b/x/ecocredit/base/types/v1/msg_update_project_admin_test.go index af26f34cc0..7ba4ff8bbb 100644 --- a/x/ecocredit/base/types/v1/msg_update_project_admin_test.go +++ b/x/ecocredit/base/types/v1/msg_update_project_admin_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgUpdateProjectAdmin struct { - t gocuke.TestingT - msg *MsgUpdateProjectAdmin - err error + t gocuke.TestingT + msg *MsgUpdateProjectAdmin + err error + signBytes string } func TestMsgUpdateProjectAdmin(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgUpdateProjectAdmin) ExpectTheError(a string) { func (s *msgUpdateProjectAdmin) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgUpdateProjectAdmin) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgUpdateProjectAdmin) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/base/types/v1/msg_update_project_metadata_test.go b/x/ecocredit/base/types/v1/msg_update_project_metadata_test.go index 5562b4c7b9..1d97ac9ac2 100644 --- a/x/ecocredit/base/types/v1/msg_update_project_metadata_test.go +++ b/x/ecocredit/base/types/v1/msg_update_project_metadata_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "strconv" "strings" "testing" @@ -11,9 +13,10 @@ import ( ) type msgUpdateProjectMetadata struct { - t gocuke.TestingT - msg *MsgUpdateProjectMetadata - err error + t gocuke.TestingT + msg *MsgUpdateProjectMetadata + err error + signBytes string } func TestMsgUpdateProjectMetadata(t *testing.T) { @@ -48,3 +51,13 @@ func (s *msgUpdateProjectMetadata) ExpectTheError(a string) { func (s *msgUpdateProjectMetadata) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgUpdateProjectMetadata) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgUpdateProjectMetadata) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} From fd1c49d5a1a7935cdcc6fc136393fce7b7dd22a9 Mon Sep 17 00:00:00 2001 From: MD Aleem <72057206+aleem1314@users.noreply.github.com> Date: Tue, 18 Oct 2022 23:09:50 +0530 Subject: [PATCH 11/17] test(x/ecocredit): add basket sign bytes unit tests (#1528) Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> --- x/ecocredit/basket/types/v1/codec.go | 1 + .../types/v1/features/msg_create.feature | 29 +++++++++++++++++ .../basket/types/v1/features/msg_put.feature | 32 +++++++++++++++++++ .../basket/types/v1/features/msg_take.feature | 26 +++++++++++++++ .../v1/features/msg_update_basket_fee.feature | 26 +++++++++++++++ .../v1/features/msg_update_curator.feature | 22 +++++++++++++ .../basket/types/v1/msg_create_test.go | 19 +++++++++-- x/ecocredit/basket/types/v1/msg_put_test.go | 19 +++++++++-- x/ecocredit/basket/types/v1/msg_take_test.go | 19 +++++++++-- .../types/v1/msg_update_basket_fee_test.go | 19 +++++++++-- .../types/v1/msg_update_curator_test.go | 19 +++++++++-- 11 files changed, 216 insertions(+), 15 deletions(-) diff --git a/x/ecocredit/basket/types/v1/codec.go b/x/ecocredit/basket/types/v1/codec.go index 9d1c1dcdf4..dcdaf511bd 100644 --- a/x/ecocredit/basket/types/v1/codec.go +++ b/x/ecocredit/basket/types/v1/codec.go @@ -18,6 +18,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgPut{}, "regen.basket/MsgPut", nil) cdc.RegisterConcrete(&MsgTake{}, "regen.basket/MsgTake", nil) cdc.RegisterConcrete(&MsgUpdateCurator{}, "regen.basket/MsgUpdateCurator", nil) + cdc.RegisterConcrete(&MsgUpdateBasketFee{}, "regen.basket/MsgUpdateBasketFee", nil) } var ( diff --git a/x/ecocredit/basket/types/v1/features/msg_create.feature b/x/ecocredit/basket/types/v1/features/msg_create.feature index 8b90e17cf5..9a6d838460 100644 --- a/x/ecocredit/basket/types/v1/features/msg_create.feature +++ b/x/ecocredit/basket/types/v1/features/msg_create.feature @@ -385,3 +385,32 @@ Feature: MsgCreate """ When the message is validated Then expect the error "more than one fee is not allowed: invalid request" + + Scenario: a valid amino message + Given the message + """ + { + "curator": "regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw", + "name": "NCT", + "credit_type_abbrev": "C", + "allowed_classes": [ + "C01" + ] + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen.basket/MsgCreate", + "value":{ + "allowed_classes":[ + "C01" + ], + "credit_type_abbrev":"C", + "curator":"regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw", + "fee":[], + "name":"NCT" + } + } + """ diff --git a/x/ecocredit/basket/types/v1/features/msg_put.feature b/x/ecocredit/basket/types/v1/features/msg_put.feature index 1041b74a43..e9147060db 100644 --- a/x/ecocredit/basket/types/v1/features/msg_put.feature +++ b/x/ecocredit/basket/types/v1/features/msg_put.feature @@ -146,3 +146,35 @@ Feature: MsgPut """ When the message is validated Then expect the error "expected a positive decimal, got -100: invalid decimal string: invalid request" + + Scenario: a valid amino message + Given the message + """ + { + "owner": "regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw", + "basket_denom": "eco.uC.NCT", + "credits": [ + { + "batch_denom": "C01-001-20200101-20210101-001", + "amount": "100" + } + ] + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen.basket/MsgPut", + "value":{ + "basket_denom":"eco.uC.NCT", + "credits":[ + { + "amount":"100", + "batch_denom":"C01-001-20200101-20210101-001" + } + ], + "owner":"regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw" + } + } + """ diff --git a/x/ecocredit/basket/types/v1/features/msg_take.feature b/x/ecocredit/basket/types/v1/features/msg_take.feature index 5195b3da87..b31c73baf9 100644 --- a/x/ecocredit/basket/types/v1/features/msg_take.feature +++ b/x/ecocredit/basket/types/v1/features/msg_take.feature @@ -140,3 +140,29 @@ Feature: MsgTake """ When the message is validated Then expect no error + + Scenario: a valid amino message + Given the message + """ + { + "owner": "regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw", + "basket_denom": "eco.uC.NCT", + "amount": "100", + "retirement_jurisdiction": "US-WA", + "retire_on_take": true + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen.basket/MsgTake", + "value":{ + "amount":"100", + "basket_denom":"eco.uC.NCT", + "owner":"regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw", + "retire_on_take":true, + "retirement_jurisdiction":"US-WA" + } + } + """ diff --git a/x/ecocredit/basket/types/v1/features/msg_update_basket_fee.feature b/x/ecocredit/basket/types/v1/features/msg_update_basket_fee.feature index 73be22eb6b..2f308734fb 100644 --- a/x/ecocredit/basket/types/v1/features/msg_update_basket_fee.feature +++ b/x/ecocredit/basket/types/v1/features/msg_update_basket_fee.feature @@ -55,3 +55,29 @@ Feature: MsgUpdateBasketFee """ When the message is validated Then expect the error "invalid denom: 1: invalid request" + + Scenario: a valid amino message + Given the message + """ + { + "authority": "regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw", + "fee": { + "denom": "uregen", + "amount": "1000" + } + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen.basket/MsgUpdateBasketFee", + "value":{ + "authority":"regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw", + "fee":{ + "amount":"1000", + "denom":"uregen" + } + } + } + """ diff --git a/x/ecocredit/basket/types/v1/features/msg_update_curator.feature b/x/ecocredit/basket/types/v1/features/msg_update_curator.feature index 464be4118c..1b4ff8d98d 100644 --- a/x/ecocredit/basket/types/v1/features/msg_update_curator.feature +++ b/x/ecocredit/basket/types/v1/features/msg_update_curator.feature @@ -85,3 +85,25 @@ Feature: MsgUpdateCurator """ When the message is validated Then expect the error "basket denom: expected format eco..: parse error: invalid request" + + Scenario: a valid amino message + Given the message + """ + { + "curator": "regen1ua97smk5yv26wpqmftgdg0sx0q0d38vky7998g", + "new_curator": "regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw", + "denom": "eco.uC.NCT" + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen.basket/MsgUpdateCurator", + "value":{ + "curator":"regen1ua97smk5yv26wpqmftgdg0sx0q0d38vky7998g", + "denom":"eco.uC.NCT", + "new_curator":"regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw" + } + } + """ diff --git a/x/ecocredit/basket/types/v1/msg_create_test.go b/x/ecocredit/basket/types/v1/msg_create_test.go index 4ca01f8d3e..0895fe7375 100644 --- a/x/ecocredit/basket/types/v1/msg_create_test.go +++ b/x/ecocredit/basket/types/v1/msg_create_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgCreateSuite struct { - t gocuke.TestingT - msg *MsgCreate - err error + t gocuke.TestingT + msg *MsgCreate + err error + signBytes string } func TestMsgCreate(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgCreateSuite) ExpectTheError(a string) { func (s *msgCreateSuite) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgCreateSuite) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgCreateSuite) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/basket/types/v1/msg_put_test.go b/x/ecocredit/basket/types/v1/msg_put_test.go index 01478fb437..af6a627a7c 100644 --- a/x/ecocredit/basket/types/v1/msg_put_test.go +++ b/x/ecocredit/basket/types/v1/msg_put_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgPutSuite struct { - t gocuke.TestingT - msg *MsgPut - err error + t gocuke.TestingT + msg *MsgPut + err error + signBytes string } func TestMsgPut(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgPutSuite) ExpectTheError(a string) { func (s *msgPutSuite) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgPutSuite) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgPutSuite) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/basket/types/v1/msg_take_test.go b/x/ecocredit/basket/types/v1/msg_take_test.go index bde1fabe4d..70dcf2595d 100644 --- a/x/ecocredit/basket/types/v1/msg_take_test.go +++ b/x/ecocredit/basket/types/v1/msg_take_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgTakeSuite struct { - t gocuke.TestingT - msg *MsgTake - err error + t gocuke.TestingT + msg *MsgTake + err error + signBytes string } func TestMsgTake(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgTakeSuite) ExpectTheError(a string) { func (s *msgTakeSuite) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgTakeSuite) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgTakeSuite) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/basket/types/v1/msg_update_basket_fee_test.go b/x/ecocredit/basket/types/v1/msg_update_basket_fee_test.go index 46f442731d..654cc5f958 100644 --- a/x/ecocredit/basket/types/v1/msg_update_basket_fee_test.go +++ b/x/ecocredit/basket/types/v1/msg_update_basket_fee_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgUpdateBasketFeeSuite struct { - t gocuke.TestingT - msg *MsgUpdateBasketFee - err error + t gocuke.TestingT + msg *MsgUpdateBasketFee + err error + signBytes string } func TestMsgUpdateBasketFeeSuite(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgUpdateBasketFeeSuite) ExpectTheError(a string) { func (s *msgUpdateBasketFeeSuite) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgUpdateBasketFeeSuite) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgUpdateBasketFeeSuite) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/basket/types/v1/msg_update_curator_test.go b/x/ecocredit/basket/types/v1/msg_update_curator_test.go index 376a7c3eb5..3143be9454 100644 --- a/x/ecocredit/basket/types/v1/msg_update_curator_test.go +++ b/x/ecocredit/basket/types/v1/msg_update_curator_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgUpdateCuratorSuite struct { - t gocuke.TestingT - msg *MsgUpdateCurator - err error + t gocuke.TestingT + msg *MsgUpdateCurator + err error + signBytes string } func TestMsgUpdateCurator(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgUpdateCuratorSuite) ExpectTheError(a string) { func (s *msgUpdateCuratorSuite) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgUpdateCuratorSuite) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgUpdateCuratorSuite) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} From a128c3937239d9d169805a33a97c4e87de7a8639 Mon Sep 17 00:00:00 2001 From: MD Aleem <72057206+aleem1314@users.noreply.github.com> Date: Tue, 18 Oct 2022 23:42:06 +0530 Subject: [PATCH 12/17] test(x/ecocredit): add marketplace sign bytes unit tests (#1537) Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> --- .../keeper/query_sell_orders_by_seller.go | 3 +- .../v1/features/msg_add_allowed_denom.feature | 24 +++++++++++ .../types/v1/features/msg_buy_direct.feature | 40 +++++++++++++++++++ .../v1/features/msg_cancel_sell_order.feature | 20 ++++++++++ .../features/msg_remove_allowed_denom.feature | 20 ++++++++++ .../types/v1/features/msg_sell.feature | 38 ++++++++++++++++++ .../features/msg_update_sell_orders.feature | 38 ++++++++++++++++++ .../types/v1/msg_add_allowed_denom_test.go | 19 +++++++-- .../types/v1/msg_buy_direct_test.go | 19 +++++++-- .../types/v1/msg_cancel_sell_order_test.go | 19 +++++++-- .../types/v1/msg_remove_allowed_denom_test.go | 19 +++++++-- .../marketplace/types/v1/msg_sell_test.go | 19 +++++++-- .../types/v1/msg_update_sell_orders_test.go | 19 +++++++-- 13 files changed, 277 insertions(+), 20 deletions(-) diff --git a/x/ecocredit/marketplace/keeper/query_sell_orders_by_seller.go b/x/ecocredit/marketplace/keeper/query_sell_orders_by_seller.go index d15960f3a9..415ea651dd 100644 --- a/x/ecocredit/marketplace/keeper/query_sell_orders_by_seller.go +++ b/x/ecocredit/marketplace/keeper/query_sell_orders_by_seller.go @@ -30,7 +30,6 @@ func (k Keeper) SellOrdersBySeller(ctx context.Context, req *types.QuerySellOrde } defer it.Close() - sellerString := seller.String() orders := make([]*types.SellOrderInfo, 0, 10) for it.Next() { order, err := it.Value() @@ -50,7 +49,7 @@ func (k Keeper) SellOrdersBySeller(ctx context.Context, req *types.QuerySellOrde info := types.SellOrderInfo{ Id: order.Id, - Seller: sellerString, + Seller: req.Seller, BatchDenom: batch.Denom, Quantity: order.Quantity, AskDenom: market.BankDenom, diff --git a/x/ecocredit/marketplace/types/v1/features/msg_add_allowed_denom.feature b/x/ecocredit/marketplace/types/v1/features/msg_add_allowed_denom.feature index b52527c94f..b3015b0124 100644 --- a/x/ecocredit/marketplace/types/v1/features/msg_add_allowed_denom.feature +++ b/x/ecocredit/marketplace/types/v1/features/msg_add_allowed_denom.feature @@ -62,3 +62,27 @@ Feature: MsgAddAllowedDenom """ When the message is validated Then expect the error "display denom cannot be empty: parse error: invalid request" + + Scenario: a valid amino message + Given the message + """ + { + "authority": "regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw", + "bank_denom": "uregen", + "display_denom": "REGEN", + "exponent": 6 + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen.marketplace/MsgAddAllowedDenom", + "value":{ + "authority":"regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw", + "bank_denom":"uregen", + "display_denom":"REGEN", + "exponent":6 + } + } + """ diff --git a/x/ecocredit/marketplace/types/v1/features/msg_buy_direct.feature b/x/ecocredit/marketplace/types/v1/features/msg_buy_direct.feature index 2b434acd86..6275d06503 100644 --- a/x/ecocredit/marketplace/types/v1/features/msg_buy_direct.feature +++ b/x/ecocredit/marketplace/types/v1/features/msg_buy_direct.feature @@ -275,3 +275,43 @@ Feature: MsgBuyDirect """ When the message is validated Then expect the error "orders[0]: retirement jurisdiction: expected format [-[ ]]: parse error: invalid request" + + Scenario: a valid amino message + Given the message + """ + { + "buyer": "regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw", + "orders": [ + { + "sell_order_id": "1", + "quantity": "100", + "bid_price": { + "denom": "regen", + "amount": "100" + }, + "retirement_jurisdiction": "US-WA" + } + ] + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen.marketplace/MsgBuyDirect", + "value":{ + "buyer":"regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw", + "orders":[ + { + "bid_price": { + "amount":"100", + "denom":"regen" + }, + "quantity":"100", + "retirement_jurisdiction":"US-WA", + "sell_order_id":"1" + } + ] + } + } + """ \ No newline at end of file diff --git a/x/ecocredit/marketplace/types/v1/features/msg_cancel_sell_order.feature b/x/ecocredit/marketplace/types/v1/features/msg_cancel_sell_order.feature index f957eac9b0..fd6285c126 100644 --- a/x/ecocredit/marketplace/types/v1/features/msg_cancel_sell_order.feature +++ b/x/ecocredit/marketplace/types/v1/features/msg_cancel_sell_order.feature @@ -38,3 +38,23 @@ Feature: MsgCancelSellOrder """ When the message is validated Then expect the error "sell order id cannot be empty: invalid request" + + Scenario: a valid amino message + Given the message + """ + { + "seller": "regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw", + "sell_order_id": 1 + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen.marketplace/MsgCancelSellOrder", + "value":{ + "sell_order_id":"1", + "seller":"regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw" + } + } + """ diff --git a/x/ecocredit/marketplace/types/v1/features/msg_remove_allowed_denom.feature b/x/ecocredit/marketplace/types/v1/features/msg_remove_allowed_denom.feature index 8b3ec40926..2fba2cf765 100644 --- a/x/ecocredit/marketplace/types/v1/features/msg_remove_allowed_denom.feature +++ b/x/ecocredit/marketplace/types/v1/features/msg_remove_allowed_denom.feature @@ -49,3 +49,23 @@ Feature: MsgRemoveAllowedDenom """ When the message is validated Then expect the error "denom: invalid denom: 1: invalid request" + + Scenario: a valid amino message + Given the message + """ + { + "authority": "regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw", + "denom": "uregen" + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen.marketplace/MsgRemoveAllowedDenom", + "value":{ + "authority":"regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw", + "denom":"uregen" + } + } + """ diff --git a/x/ecocredit/marketplace/types/v1/features/msg_sell.feature b/x/ecocredit/marketplace/types/v1/features/msg_sell.feature index 8962819239..f5377cd05c 100644 --- a/x/ecocredit/marketplace/types/v1/features/msg_sell.feature +++ b/x/ecocredit/marketplace/types/v1/features/msg_sell.feature @@ -267,3 +267,41 @@ Feature: MsgSell """ When the message is validated Then expect the error "orders[0]: ask price: amount must be a positive integer: invalid request" + + Scenario: a valid amino message + Given the message + """ + { + "seller": "regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw", + "orders": [ + { + "batch_denom": "C01-001-20200101-20210101-001", + "quantity": "100", + "ask_price": { + "denom": "regen", + "amount": "100" + } + } + ] + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen.marketplace/MsgSell", + "value":{ + "orders":[ + { + "ask_price":{ + "amount":"100", + "denom":"regen" + }, + "batch_denom":"C01-001-20200101-20210101-001", + "quantity":"100" + } + ], + "seller":"regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw" + } + } + """ diff --git a/x/ecocredit/marketplace/types/v1/features/msg_update_sell_orders.feature b/x/ecocredit/marketplace/types/v1/features/msg_update_sell_orders.feature index 869d20b414..650253c057 100644 --- a/x/ecocredit/marketplace/types/v1/features/msg_update_sell_orders.feature +++ b/x/ecocredit/marketplace/types/v1/features/msg_update_sell_orders.feature @@ -252,3 +252,41 @@ Feature: MsgUpdateSellOrders """ When the message is validated Then expect the error "updates[0]: new ask price: amount must be a positive integer: invalid request" + + Scenario: a valid amino message + Given the message + """ + { + "seller": "regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw", + "updates": [ + { + "sell_order_id": 1, + "new_quantity": "100", + "new_ask_price": { + "denom": "regen", + "amount": "100" + } + } + ] + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen.marketplace/MsgUpdateSellOrders", + "value":{ + "seller":"regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw", + "updates":[ + { + "new_ask_price":{ + "amount":"100", + "denom":"regen" + }, + "new_quantity":"100", + "sell_order_id":"1" + } + ] + } + } + """ diff --git a/x/ecocredit/marketplace/types/v1/msg_add_allowed_denom_test.go b/x/ecocredit/marketplace/types/v1/msg_add_allowed_denom_test.go index c0ec8e1b0f..21ccd8693a 100644 --- a/x/ecocredit/marketplace/types/v1/msg_add_allowed_denom_test.go +++ b/x/ecocredit/marketplace/types/v1/msg_add_allowed_denom_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgAddAllowedDenomSuite struct { - t gocuke.TestingT - msg *MsgAddAllowedDenom - err error + t gocuke.TestingT + msg *MsgAddAllowedDenom + err error + signBytes string } func TestMsgAddAllowedDenomSuite(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgAddAllowedDenomSuite) ExpectTheError(a string) { func (s *msgAddAllowedDenomSuite) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgAddAllowedDenomSuite) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgAddAllowedDenomSuite) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/marketplace/types/v1/msg_buy_direct_test.go b/x/ecocredit/marketplace/types/v1/msg_buy_direct_test.go index 0074978801..5d4e9747d5 100644 --- a/x/ecocredit/marketplace/types/v1/msg_buy_direct_test.go +++ b/x/ecocredit/marketplace/types/v1/msg_buy_direct_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgBuyDirectSuite struct { - t gocuke.TestingT - msg *MsgBuyDirect - err error + t gocuke.TestingT + msg *MsgBuyDirect + err error + signBytes string } func TestMsgBuyDirect(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgBuyDirectSuite) ExpectTheError(a string) { func (s *msgBuyDirectSuite) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgBuyDirectSuite) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgBuyDirectSuite) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/marketplace/types/v1/msg_cancel_sell_order_test.go b/x/ecocredit/marketplace/types/v1/msg_cancel_sell_order_test.go index 0b36a8deb5..127d2194d4 100644 --- a/x/ecocredit/marketplace/types/v1/msg_cancel_sell_order_test.go +++ b/x/ecocredit/marketplace/types/v1/msg_cancel_sell_order_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgCancelSuite struct { - t gocuke.TestingT - msg *MsgCancelSellOrder - err error + t gocuke.TestingT + msg *MsgCancelSellOrder + err error + signBytes string } func TestMsgCancelSellOrder(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgCancelSuite) ExpectTheError(a string) { func (s *msgCancelSuite) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgCancelSuite) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgCancelSuite) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/marketplace/types/v1/msg_remove_allowed_denom_test.go b/x/ecocredit/marketplace/types/v1/msg_remove_allowed_denom_test.go index 48b3429a7b..128da9acd8 100644 --- a/x/ecocredit/marketplace/types/v1/msg_remove_allowed_denom_test.go +++ b/x/ecocredit/marketplace/types/v1/msg_remove_allowed_denom_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgRemoveAllowedDenomSuite struct { - t gocuke.TestingT - msg *MsgRemoveAllowedDenom - err error + t gocuke.TestingT + msg *MsgRemoveAllowedDenom + err error + signBytes string } func TestMsgRemoveAllowedDenomSuite(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgRemoveAllowedDenomSuite) ExpectTheError(a string) { func (s *msgRemoveAllowedDenomSuite) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgRemoveAllowedDenomSuite) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgRemoveAllowedDenomSuite) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/marketplace/types/v1/msg_sell_test.go b/x/ecocredit/marketplace/types/v1/msg_sell_test.go index cf3a8595df..b7ffd8c620 100644 --- a/x/ecocredit/marketplace/types/v1/msg_sell_test.go +++ b/x/ecocredit/marketplace/types/v1/msg_sell_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgSellSuite struct { - t gocuke.TestingT - msg *MsgSell - err error + t gocuke.TestingT + msg *MsgSell + err error + signBytes string } func TestMsgSell(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgSellSuite) ExpectTheError(a string) { func (s *msgSellSuite) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgSellSuite) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgSellSuite) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/ecocredit/marketplace/types/v1/msg_update_sell_orders_test.go b/x/ecocredit/marketplace/types/v1/msg_update_sell_orders_test.go index ec0e947259..1ab2aca597 100644 --- a/x/ecocredit/marketplace/types/v1/msg_update_sell_orders_test.go +++ b/x/ecocredit/marketplace/types/v1/msg_update_sell_orders_test.go @@ -1,6 +1,8 @@ package v1 import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgUpdateSellOrdersSuite struct { - t gocuke.TestingT - msg *MsgUpdateSellOrders - err error + t gocuke.TestingT + msg *MsgUpdateSellOrders + err error + signBytes string } func TestMsgUpdateSellOrders(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgUpdateSellOrdersSuite) ExpectTheError(a string) { func (s *msgUpdateSellOrdersSuite) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgUpdateSellOrdersSuite) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgUpdateSellOrdersSuite) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} From 98e6571004a645aa62fb6b5ca7d71fef039357dd Mon Sep 17 00:00:00 2001 From: MD Aleem <72057206+aleem1314@users.noreply.github.com> Date: Wed, 19 Oct 2022 20:14:07 +0530 Subject: [PATCH 13/17] refactor(x/ecocredit): remove deprecated params keeper (#1543) Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> --- CHANGELOG.md | 1 + api/regen/ecocredit/v1/tx_grpc.pb.go | 4 +- proto/regen/ecocredit/v1/tx.proto | 2 +- x/ecocredit/base/types/v1/tx.pb.go | 4 +- x/ecocredit/basket/keeper/keeper.go | 3 -- x/ecocredit/basket/keeper/keeper_test.go | 26 +++++---- x/ecocredit/expected_keepers.go | 11 ---- x/ecocredit/marketplace/keeper/keeper.go | 20 ++++--- x/ecocredit/marketplace/keeper/keeper_test.go | 26 +++++---- x/ecocredit/mocks/expected_keepers.go | 53 ++++++++----------- x/ecocredit/module/module.go | 2 +- x/ecocredit/server/server.go | 17 +++--- 12 files changed, 68 insertions(+), 101 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index efb56d7cab..5b5cb1f54c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,6 +72,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#1462](https://github.com/regen-network/regen-ledger/pull/1462) Bridge operations must now specify a target/source that exists in the `AllowedBridgeChain` table. - [#1476](https://github.com/regen-network/regen-ledger/pull/1476) `DefaultParams` function has been removed. - [#1476](https://github.com/regen-network/regen-ledger/pull/1476) Remove `params` argument from `ValidateGenesis`. +- [#1543](https://github.com/regen-network/regen-ledger/pull/1543) Remove `paramsKeeper` argument from `base/Keeper`, `basket/Keeper` and `marketplace/Keeper`. #### Added diff --git a/api/regen/ecocredit/v1/tx_grpc.pb.go b/api/regen/ecocredit/v1/tx_grpc.pb.go index 255bde6f29..dea12c9beb 100644 --- a/api/regen/ecocredit/v1/tx_grpc.pb.go +++ b/api/regen/ecocredit/v1/tx_grpc.pb.go @@ -119,7 +119,7 @@ type MsgClient interface { // Since Revision 1 AddClassCreator(ctx context.Context, in *MsgAddClassCreator, opts ...grpc.CallOption) (*MsgAddClassCreatorResponse, error) // RemoveClassCreator is a governance method that removes - // address from the creation allowlist. + // address from the class creation allowlist. // // Since Revision 1 RemoveClassCreator(ctx context.Context, in *MsgRemoveClassCreator, opts ...grpc.CallOption) (*MsgRemoveClassCreatorResponse, error) @@ -448,7 +448,7 @@ type MsgServer interface { // Since Revision 1 AddClassCreator(context.Context, *MsgAddClassCreator) (*MsgAddClassCreatorResponse, error) // RemoveClassCreator is a governance method that removes - // address from the creation allowlist. + // address from the class creation allowlist. // // Since Revision 1 RemoveClassCreator(context.Context, *MsgRemoveClassCreator) (*MsgRemoveClassCreatorResponse, error) diff --git a/proto/regen/ecocredit/v1/tx.proto b/proto/regen/ecocredit/v1/tx.proto index 458a764e22..bc4d41af18 100644 --- a/proto/regen/ecocredit/v1/tx.proto +++ b/proto/regen/ecocredit/v1/tx.proto @@ -136,7 +136,7 @@ service Msg { rpc AddClassCreator(MsgAddClassCreator) returns (MsgAddClassCreatorResponse); // RemoveClassCreator is a governance method that removes - // address from the creation allowlist. + // address from the class creation allowlist. // // Since Revision 1 rpc RemoveClassCreator(MsgRemoveClassCreator) diff --git a/x/ecocredit/base/types/v1/tx.pb.go b/x/ecocredit/base/types/v1/tx.pb.go index adc901790b..09662387d6 100644 --- a/x/ecocredit/base/types/v1/tx.pb.go +++ b/x/ecocredit/base/types/v1/tx.pb.go @@ -2968,7 +2968,7 @@ type MsgClient interface { // Since Revision 1 AddClassCreator(ctx context.Context, in *MsgAddClassCreator, opts ...grpc.CallOption) (*MsgAddClassCreatorResponse, error) // RemoveClassCreator is a governance method that removes - // address from the creation allowlist. + // address from the class creation allowlist. // // Since Revision 1 RemoveClassCreator(ctx context.Context, in *MsgRemoveClassCreator, opts ...grpc.CallOption) (*MsgRemoveClassCreatorResponse, error) @@ -3295,7 +3295,7 @@ type MsgServer interface { // Since Revision 1 AddClassCreator(context.Context, *MsgAddClassCreator) (*MsgAddClassCreatorResponse, error) // RemoveClassCreator is a governance method that removes - // address from the creation allowlist. + // address from the class creation allowlist. // // Since Revision 1 RemoveClassCreator(context.Context, *MsgRemoveClassCreator) (*MsgRemoveClassCreatorResponse, error) diff --git a/x/ecocredit/basket/keeper/keeper.go b/x/ecocredit/basket/keeper/keeper.go index c0d5e1a124..dfe3f58162 100644 --- a/x/ecocredit/basket/keeper/keeper.go +++ b/x/ecocredit/basket/keeper/keeper.go @@ -19,7 +19,6 @@ type Keeper struct { stateStore api.StateStore baseStore baseapi.StateStore bankKeeper ecocredit.BankKeeper - paramsKeeper ecocredit.ParamKeeper moduleAddress sdk.AccAddress authority sdk.AccAddress } @@ -29,7 +28,6 @@ func NewKeeper( ss api.StateStore, cs baseapi.StateStore, bk ecocredit.BankKeeper, - pk ecocredit.ParamKeeper, ma sdk.AccAddress, authority sdk.AccAddress, ) Keeper { @@ -37,7 +35,6 @@ func NewKeeper( stateStore: ss, baseStore: cs, bankKeeper: bk, - paramsKeeper: pk, moduleAddress: ma, authority: authority, } diff --git a/x/ecocredit/basket/keeper/keeper_test.go b/x/ecocredit/basket/keeper/keeper_test.go index 8962749e62..936d22fccb 100644 --- a/x/ecocredit/basket/keeper/keeper_test.go +++ b/x/ecocredit/basket/keeper/keeper_test.go @@ -32,18 +32,17 @@ const ( ) type baseSuite struct { - t gocuke.TestingT - db ormdb.ModuleDB - ctx context.Context - k Keeper - ctrl *gomock.Controller - addrs []sdk.AccAddress - stateStore api.StateStore - baseStore baseapi.StateStore - bankKeeper *mocks.MockBankKeeper - paramsKeeper *mocks.MockParamKeeper - storeKey *storetypes.KVStoreKey - sdkCtx sdk.Context + t gocuke.TestingT + db ormdb.ModuleDB + ctx context.Context + k Keeper + ctrl *gomock.Controller + addrs []sdk.AccAddress + stateStore api.StateStore + baseStore baseapi.StateStore + bankKeeper *mocks.MockBankKeeper + storeKey *storetypes.KVStoreKey + sdkCtx sdk.Context } func setupBase(t gocuke.TestingT) *baseSuite { @@ -70,13 +69,12 @@ func setupBase(t gocuke.TestingT) *baseSuite { s.ctrl = gomock.NewController(t) assert.NilError(t, err) s.bankKeeper = mocks.NewMockBankKeeper(s.ctrl) - s.paramsKeeper = mocks.NewMockParamKeeper(s.ctrl) _, _, moduleAddress := testdata.KeyTestPubAddr() authority, err := sdk.AccAddressFromBech32("regen1nzh226hxrsvf4k69sa8v0nfuzx5vgwkczk8j68") assert.NilError(t, err) - s.k = NewKeeper(s.stateStore, s.baseStore, s.bankKeeper, s.paramsKeeper, moduleAddress, authority) + s.k = NewKeeper(s.stateStore, s.baseStore, s.bankKeeper, moduleAddress, authority) s.baseStore, err = baseapi.NewStateStore(s.db) assert.NilError(t, err) diff --git a/x/ecocredit/expected_keepers.go b/x/ecocredit/expected_keepers.go index fd19b4a9f5..3c6c48bdc0 100644 --- a/x/ecocredit/expected_keepers.go +++ b/x/ecocredit/expected_keepers.go @@ -5,7 +5,6 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - "github.com/cosmos/cosmos-sdk/x/params/types" ) //go:generate mockgen -source=expected_keepers.go -package mocks -destination mocks/expected_keepers.go @@ -43,13 +42,3 @@ type GovKeeper interface { // GetDepositParams queries governance module deposit params GetDepositParams(ctx sdk.Context) govv1.DepositParams } - -type ParamKeeper interface { - - // Get fetches a parameter by key from the Subspace's KVStore and sets the provided pointer to the fetched value. - // If the value does not exist, this method will panic. - Get(ctx sdk.Context, key []byte, ptr interface{}) - - // GetParamSet fetches each parameter in the ParamSet. - GetParamSet(ctx sdk.Context, ps types.ParamSet) -} diff --git a/x/ecocredit/marketplace/keeper/keeper.go b/x/ecocredit/marketplace/keeper/keeper.go index bcbf89a260..67742ce667 100644 --- a/x/ecocredit/marketplace/keeper/keeper.go +++ b/x/ecocredit/marketplace/keeper/keeper.go @@ -15,20 +15,18 @@ var ( ) type Keeper struct { - stateStore marketapi.StateStore - baseStore baseapi.StateStore - bankKeeper ecocredit.BankKeeper - paramsKeeper ecocredit.ParamKeeper - authority sdk.AccAddress + stateStore marketapi.StateStore + baseStore baseapi.StateStore + bankKeeper ecocredit.BankKeeper + authority sdk.AccAddress } func NewKeeper(ss marketapi.StateStore, cs baseapi.StateStore, bk ecocredit.BankKeeper, - params ecocredit.ParamKeeper, authority sdk.AccAddress) Keeper { + authority sdk.AccAddress) Keeper { return Keeper{ - baseStore: cs, - stateStore: ss, - bankKeeper: bk, - paramsKeeper: params, - authority: authority, + baseStore: cs, + stateStore: ss, + bankKeeper: bk, + authority: authority, } } diff --git a/x/ecocredit/marketplace/keeper/keeper_test.go b/x/ecocredit/marketplace/keeper/keeper_test.go index 9e756fab1f..d772a159bc 100644 --- a/x/ecocredit/marketplace/keeper/keeper_test.go +++ b/x/ecocredit/marketplace/keeper/keeper_test.go @@ -36,18 +36,17 @@ const ( ) type baseSuite struct { - t gocuke.TestingT - db ormdb.ModuleDB - baseStore baseapi.StateStore - marketStore api.StateStore - ctx context.Context - k Keeper - ctrl *gomock.Controller - addrs []sdk.AccAddress - bankKeeper *mocks.MockBankKeeper - paramsKeeper *mocks.MockParamKeeper - storeKey *storetypes.KVStoreKey - sdkCtx sdk.Context + t gocuke.TestingT + db ormdb.ModuleDB + baseStore baseapi.StateStore + marketStore api.StateStore + ctx context.Context + k Keeper + ctrl *gomock.Controller + addrs []sdk.AccAddress + bankKeeper *mocks.MockBankKeeper + storeKey *storetypes.KVStoreKey + sdkCtx sdk.Context } func setupBase(t gocuke.TestingT, numAddresses int) *baseSuite { @@ -74,11 +73,10 @@ func setupBase(t gocuke.TestingT, numAddresses int) *baseSuite { s.ctrl = gomock.NewController(t) assert.NilError(t, err) s.bankKeeper = mocks.NewMockBankKeeper(s.ctrl) - s.paramsKeeper = mocks.NewMockParamKeeper(s.ctrl) authority, err := sdk.AccAddressFromBech32("regen1nzh226hxrsvf4k69sa8v0nfuzx5vgwkczk8j68") assert.NilError(s.t, err) - s.k = NewKeeper(s.marketStore, s.baseStore, s.bankKeeper, s.paramsKeeper, authority) + s.k = NewKeeper(s.marketStore, s.baseStore, s.bankKeeper, authority) // set test accounts for i := 0; i < numAddresses; i++ { diff --git a/x/ecocredit/mocks/expected_keepers.go b/x/ecocredit/mocks/expected_keepers.go index f3996bbd02..e46f6eecc8 100644 --- a/x/ecocredit/mocks/expected_keepers.go +++ b/x/ecocredit/mocks/expected_keepers.go @@ -7,12 +7,11 @@ package mocks import ( reflect "reflect" - gomock "github.com/golang/mock/gomock" - types "github.com/cosmos/cosmos-sdk/types" types0 "github.com/cosmos/cosmos-sdk/x/auth/types" types1 "github.com/cosmos/cosmos-sdk/x/bank/types" - types2 "github.com/cosmos/cosmos-sdk/x/params/types" + v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + gomock "github.com/golang/mock/gomock" ) // MockAccountKeeper is a mock of AccountKeeper interface. @@ -239,49 +238,39 @@ func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr interface{}) *gom return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SpendableCoins", reflect.TypeOf((*MockBankKeeper)(nil).SpendableCoins), ctx, addr) } -// MockParamKeeper is a mock of ParamKeeper interface. -type MockParamKeeper struct { +// MockGovKeeper is a mock of GovKeeper interface. +type MockGovKeeper struct { ctrl *gomock.Controller - recorder *MockParamKeeperMockRecorder + recorder *MockGovKeeperMockRecorder } -// MockParamKeeperMockRecorder is the mock recorder for MockParamKeeper. -type MockParamKeeperMockRecorder struct { - mock *MockParamKeeper +// MockGovKeeperMockRecorder is the mock recorder for MockGovKeeper. +type MockGovKeeperMockRecorder struct { + mock *MockGovKeeper } -// NewMockParamKeeper creates a new mock instance. -func NewMockParamKeeper(ctrl *gomock.Controller) *MockParamKeeper { - mock := &MockParamKeeper{ctrl: ctrl} - mock.recorder = &MockParamKeeperMockRecorder{mock} +// NewMockGovKeeper creates a new mock instance. +func NewMockGovKeeper(ctrl *gomock.Controller) *MockGovKeeper { + mock := &MockGovKeeper{ctrl: ctrl} + mock.recorder = &MockGovKeeperMockRecorder{mock} return mock } // EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockParamKeeper) EXPECT() *MockParamKeeperMockRecorder { +func (m *MockGovKeeper) EXPECT() *MockGovKeeperMockRecorder { return m.recorder } -// Get mocks base method. -func (m *MockParamKeeper) Get(ctx types.Context, key []byte, ptr interface{}) { - m.ctrl.T.Helper() - m.ctrl.Call(m, "Get", ctx, key, ptr) -} - -// Get indicates an expected call of Get. -func (mr *MockParamKeeperMockRecorder) Get(ctx, key, ptr interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockParamKeeper)(nil).Get), ctx, key, ptr) -} - -// GetParamSet mocks base method. -func (m *MockParamKeeper) GetParamSet(ctx types.Context, ps types2.ParamSet) { +// GetDepositParams mocks base method. +func (m *MockGovKeeper) GetDepositParams(ctx types.Context) v1.DepositParams { m.ctrl.T.Helper() - m.ctrl.Call(m, "GetParamSet", ctx, ps) + ret := m.ctrl.Call(m, "GetDepositParams", ctx) + ret0, _ := ret[0].(v1.DepositParams) + return ret0 } -// GetParamSet indicates an expected call of GetParamSet. -func (mr *MockParamKeeperMockRecorder) GetParamSet(ctx, ps interface{}) *gomock.Call { +// GetDepositParams indicates an expected call of GetDepositParams. +func (mr *MockGovKeeperMockRecorder) GetDepositParams(ctx interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetParamSet", reflect.TypeOf((*MockParamKeeper)(nil).GetParamSet), ctx, ps) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDepositParams", reflect.TypeOf((*MockGovKeeper)(nil).GetDepositParams), ctx) } diff --git a/x/ecocredit/module/module.go b/x/ecocredit/module/module.go index b217b8389f..6a878cde88 100644 --- a/x/ecocredit/module/module.go +++ b/x/ecocredit/module/module.go @@ -120,7 +120,7 @@ func (m Module) RegisterInterfaces(registry types.InterfaceRegistry) { // RegisterServices implements AppModule/RegisterServices. func (m *Module) RegisterServices(cfg module.Configurator) { - svr := server.NewServer(m.key, m.legacySubspace, m.accountKeeper, m.bankKeeper, m.authority) + svr := server.NewServer(m.key, m.accountKeeper, m.bankKeeper, m.authority) basetypes.RegisterMsgServer(cfg.MsgServer(), svr.BaseKeeper) basetypes.RegisterQueryServer(cfg.QueryServer(), svr.BaseKeeper) diff --git a/x/ecocredit/server/server.go b/x/ecocredit/server/server.go index 40855c0f8d..48376e6f47 100644 --- a/x/ecocredit/server/server.go +++ b/x/ecocredit/server/server.go @@ -6,7 +6,6 @@ import ( "github.com/cosmos/cosmos-sdk/orm/model/ormdb" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" basketapi "github.com/regen-network/regen-ledger/api/regen/ecocredit/basket/v1" marketapi "github.com/regen-network/regen-ledger/api/regen/ecocredit/marketplace/v1" @@ -23,9 +22,8 @@ import ( ) type serverImpl struct { - legacySubspace paramtypes.Subspace - bankKeeper ecocredit.BankKeeper - accountKeeper ecocredit.AccountKeeper + bankKeeper ecocredit.BankKeeper + accountKeeper ecocredit.AccountKeeper BaseKeeper basekeeper.Keeper BasketKeeper basketkeeper.Keeper @@ -38,12 +36,11 @@ type serverImpl struct { } //nolint:revive -func NewServer(storeKey storetypes.StoreKey, legacySubspace paramtypes.Subspace, +func NewServer(storeKey storetypes.StoreKey, accountKeeper ecocredit.AccountKeeper, bankKeeper ecocredit.BankKeeper, authority sdk.AccAddress) serverImpl { s := serverImpl{ - legacySubspace: legacySubspace, - bankKeeper: bankKeeper, - accountKeeper: accountKeeper, + bankKeeper: bankKeeper, + accountKeeper: accountKeeper, } // ensure ecocredit module account is set @@ -69,8 +66,8 @@ func NewServer(storeKey storetypes.StoreKey, legacySubspace paramtypes.Subspace, s.basketStore = basketStore s.marketplaceStore = marketStore s.BaseKeeper = basekeeper.NewKeeper(baseStore, bankKeeper, baseAddr, basketStore, marketStore, authority) - s.BasketKeeper = basketkeeper.NewKeeper(basketStore, baseStore, bankKeeper, s.legacySubspace, basketAddr, authority) - s.MarketplaceKeeper = marketkeeper.NewKeeper(marketStore, baseStore, bankKeeper, s.legacySubspace, authority) + s.BasketKeeper = basketkeeper.NewKeeper(basketStore, baseStore, bankKeeper, basketAddr, authority) + s.MarketplaceKeeper = marketkeeper.NewKeeper(marketStore, baseStore, bankKeeper, authority) return s } From 4105ac3e078ce7a221274726337608448b25fc42 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Oct 2022 07:59:00 -0700 Subject: [PATCH 14/17] build(deps): Bump github.com/tendermint/tendermint from 0.34.21 to 0.34.22 (#1561) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> --- go.mod | 24 ++++++++++++------------ go.sum | 46 ++++++++++++++++++++++++---------------------- 2 files changed, 36 insertions(+), 34 deletions(-) diff --git a/go.mod b/go.mod index c73b46ed33..4325216540 100644 --- a/go.mod +++ b/go.mod @@ -16,9 +16,9 @@ require ( github.com/spf13/cast v1.5.0 github.com/spf13/cobra v1.6.0 github.com/stretchr/testify v1.8.0 - github.com/tendermint/tendermint v0.34.21 + github.com/tendermint/tendermint v0.34.22 github.com/tendermint/tm-db v0.6.7 - golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect + golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959 // indirect ) @@ -113,34 +113,34 @@ require ( github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/magiconair/properties v1.8.6 // indirect github.com/manifoldco/promptui v0.9.0 // indirect - github.com/mattn/go-colorable v0.1.12 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.16 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect - github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect + github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.0.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/pelletier/go-toml v1.9.5 // indirect - github.com/pelletier/go-toml/v2 v2.0.2 // indirect + github.com/pelletier/go-toml/v2 v2.0.5 // indirect github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.34.0 // indirect github.com/prometheus/procfs v0.7.3 // indirect - github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect + github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/regen-network/cosmos-proto v0.3.1 // indirect github.com/regen-network/regen-ledger/api v0.8.0 // indirect github.com/rs/cors v1.8.2 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa // indirect + github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/spf13/afero v1.8.2 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.12.0 // indirect - github.com/subosito/gotenv v1.4.0 // indirect + github.com/spf13/viper v1.13.0 // indirect + github.com/subosito/gotenv v1.4.1 // indirect github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect github.com/tendermint/btcd v0.1.1 // indirect github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 // indirect @@ -150,9 +150,9 @@ require ( go.etcd.io/bbolt v1.3.6 // indirect go.opencensus.io v0.23.0 // indirect golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect - golang.org/x/net v0.0.0-20220726230323-06994584191e // indirect + golang.org/x/net v0.0.0-20220812174116-3211cb980234 // indirect golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 // indirect - golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect + golang.org/x/sys v0.0.0-20220818161305-2296e01440c6 // indirect golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect @@ -160,7 +160,7 @@ require ( google.golang.org/appengine v1.6.7 // indirect google.golang.org/grpc v1.50.1 // indirect google.golang.org/protobuf v1.28.1 // indirect - gopkg.in/ini.v1 v1.66.6 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect diff --git a/go.sum b/go.sum index 69e9dcf0d9..fa46290c8f 100644 --- a/go.sum +++ b/go.sum @@ -699,8 +699,9 @@ github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= @@ -719,8 +720,9 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5 github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 h1:hLDRPB66XQT/8+wG9WsDpiCvZf1yKO7sz7scAjSlBa0= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= +github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= +github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -804,8 +806,8 @@ github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtP github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.2 h1:+jQXlF3scKIcSEKkdHzXhCTDLPFi5r1wnK6yPS+49Gw= -github.com/pelletier/go-toml/v2 v2.0.2/go.mod h1:MovirKjgVRESsAvNZlAjtFwV867yGuwRkXbG66OzopI= +github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= +github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= @@ -867,8 +869,8 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= -github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzywPxOvwMdxcg= github.com/regen-network/cosmos-proto v0.3.1/go.mod h1:jO0sVX6a1B36nmE8C9xBFXpNwWejXC7QqCOnH3O0+YM= github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= @@ -892,8 +894,8 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa h1:0U2s5loxrTy6/VgfVoLuVLFJcURKLH49ie0zSch7gh4= -github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= +github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= +github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= @@ -931,8 +933,8 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= -github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= +github.com/spf13/viper v1.13.0 h1:BWSJ/M+f+3nmdz9bxB+bWX28kkALN2ok11D0rSo8EJU= +github.com/spf13/viper v1.13.0/go.mod h1:Icm2xNL3/8uyh/wFuB1jI7TiTNKp8632Nwegu+zgdYw= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -949,11 +951,10 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/subosito/gotenv v1.4.0 h1:yAzM1+SmVcz5R4tXGsNMu1jUl2aOJXoiWUCEwwnGrvs= -github.com/subosito/gotenv v1.4.0/go.mod h1:mZd6rFysKEcUhUHXJk0C/08wAgyDBFuwEYL7vWWGaGo= +github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= +github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tendermint/btcd v0.1.1 h1:0VcxPfflS2zZ3RiOAHkBiFUcPvbtRj5O7zHmcJWHV7s= @@ -962,8 +963,8 @@ github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 h1:hqAk8riJvK4RM github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tendermint/tendermint v0.34.21 h1:UiGGnBFHVrZhoQVQ7EfwSOLuCtarqCSsRf8VrklqB7s= -github.com/tendermint/tendermint v0.34.21/go.mod h1:XDvfg6U7grcFTDx7VkzxnhazQ/bspGJAn4DZ6DcLLjQ= +github.com/tendermint/tendermint v0.34.22 h1:XMhtC8s8QqJO4l/dn+TkQvevTRSow3Vixjclr41o+2Q= +github.com/tendermint/tendermint v0.34.22/go.mod h1:YpP5vBEAKUT4g6oyfjKgFeZmdB/GjkJAxfF+cgmJg6Y= github.com/tendermint/tm-db v0.6.7 h1:fE00Cbl0jayAoqlExN6oyQJ7fR/ZtoVOmvPJ//+shu8= github.com/tendermint/tm-db v0.6.7/go.mod h1:byQDzFkZV1syXr/ReXS808NxA2xvyuuVgXOJ/088L6I= github.com/thanhpk/randstr v1.0.4 h1:IN78qu/bR+My+gHCvMEXhR/i5oriVHcTB/BJJIRTsNo= @@ -1055,8 +1056,8 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM= -golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1161,8 +1162,8 @@ golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220726230323-06994584191e h1:wOQNKh1uuDGRnmgF0jDxh7ctgGy/3P4rYWQRVJD4/Yg= -golang.org/x/net v0.0.0-20220726230323-06994584191e/go.mod h1:AaygXjzTFtRAg2ttMY5RMuhpJ3cNnI0XpyFJD1iQRSM= +golang.org/x/net v0.0.0-20220812174116-3211cb980234 h1:RDqmgfe7SvlMWoqC3xwQ2blLO3fcWcxMa3eBLRdRW7E= +golang.org/x/net v0.0.0-20220812174116-3211cb980234/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1299,8 +1300,9 @@ golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab h1:2QkjZIsXupsJbJIdSjjUOgWK3aEtzyuh2mPt3l/CkeU= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220818161305-2296e01440c6 h1:Sx/u41w+OwrInGdEckYmEuU5gHoGSL4QbDz3S9s6j4U= +golang.org/x/sys v0.0.0-20220818161305-2296e01440c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1610,8 +1612,8 @@ gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/ini.v1 v1.66.6 h1:LATuAqN/shcYAOkv3wl2L4rkaKqkcgTBQjOyYDvcPKI= -gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= From ac275f125182ef5edc7109c24118c902b32cb58e Mon Sep 17 00:00:00 2001 From: MD Aleem <72057206+aleem1314@users.noreply.github.com> Date: Wed, 19 Oct 2022 21:42:29 +0530 Subject: [PATCH 15/17] test(x/data): add sign bytes unit tests (#1562) Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> --- x/data/features/msg_anchor.feature | 30 ++++++++++++++++ x/data/features/msg_attest.feature | 32 +++++++++++++++++ x/data/features/msg_define_resolver.feature | 20 +++++++++++ x/data/features/msg_register_resolver.feature | 36 +++++++++++++++++++ x/data/msg_anchor_test.go | 19 ++++++++-- x/data/msg_attest_test.go | 19 ++++++++-- x/data/msg_define_resolver_test.go | 19 ++++++++-- x/data/msg_register_resolver_test.go | 19 ++++++++-- 8 files changed, 182 insertions(+), 12 deletions(-) diff --git a/x/data/features/msg_anchor.feature b/x/data/features/msg_anchor.feature index 9a7ca16912..b24137f822 100644 --- a/x/data/features/msg_anchor.feature +++ b/x/data/features/msg_anchor.feature @@ -44,4 +44,34 @@ Feature: MsgAnchor When the message is validated Then expect the error "content hash cannot be empty: invalid request" + Scenario: a valid amino message + Given the message + """ + { + "sender": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "content_hash": { + "raw": { + "hash": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=", + "digest_algorithm": 1 + } + } + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen-ledger/MsgAnchor", + "value":{ + "content_hash":{ + "raw":{ + "digest_algorithm":1, + "hash":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + } + }, + "sender":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6" + } + } + """ + # Note: see ./types_content_hash.feature for content hash validation diff --git a/x/data/features/msg_attest.feature b/x/data/features/msg_attest.feature index 7801b93631..0a6861a572 100644 --- a/x/data/features/msg_attest.feature +++ b/x/data/features/msg_attest.feature @@ -44,5 +44,37 @@ Feature: MsgAttest """ When the message is validated Then expect the error "content hashes cannot be empty: invalid request" + + Scenario: a valid amino message + Given the message + """ + { + "attestor": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "content_hashes": [ + { + "hash": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=", + "digest_algorithm": 1, + "canonicalization_algorithm": 1 + } + ] + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type":"regen-ledger/MsgAttest", + "value":{ + "attestor":"regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "content_hashes":[ + { + "canonicalization_algorithm":1, + "digest_algorithm":1, + "hash":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + } + ] + } + } + """ # Note: see ./types_content_hash.feature for content hash validation diff --git a/x/data/features/msg_define_resolver.feature b/x/data/features/msg_define_resolver.feature index b6f3b6d008..57f280f6fb 100644 --- a/x/data/features/msg_define_resolver.feature +++ b/x/data/features/msg_define_resolver.feature @@ -49,3 +49,23 @@ Feature: MsgDefineResolver """ When the message is validated Then expect the error "invalid resolver url: invalid request" + + Scenario: a valid amino message + Given the message + """ + { + "manager": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "resolver_url": "https://foo.bar" + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type": "regen-ledger/MsgDefineResolver", + "value": { + "manager": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "resolver_url": "https://foo.bar" + } + } + """ diff --git a/x/data/features/msg_register_resolver.feature b/x/data/features/msg_register_resolver.feature index 550bbcc6e3..83b4404aaf 100644 --- a/x/data/features/msg_register_resolver.feature +++ b/x/data/features/msg_register_resolver.feature @@ -57,5 +57,41 @@ Feature: MsgRegisterResolver """ When the message is validated Then expect the error "content hashes cannot be empty: invalid request" + + Scenario: a valid amino message + Given the message + """ + { + "manager": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "resolver_id": 1, + "content_hashes": [ + { + "raw": { + "hash": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=", + "digest_algorithm": 1 + } + } + ] + } + """ + When message sign bytes queried + Then expect the sign bytes + """ + { + "type": "regen-ledger/MsgRegisterResolver", + "value": { + "content_hashes": [ + { + "raw": { + "digest_algorithm": 1, + "hash": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + } + } + ], + "manager": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", + "resolver_id": "1" + } + } + """ # Note: see ./types_content_hash.feature for content hash validation diff --git a/x/data/msg_anchor_test.go b/x/data/msg_anchor_test.go index 22988aa102..c2ca897338 100644 --- a/x/data/msg_anchor_test.go +++ b/x/data/msg_anchor_test.go @@ -1,6 +1,8 @@ package data import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgAnchorSuite struct { - t gocuke.TestingT - msg *MsgAnchor - err error + t gocuke.TestingT + msg *MsgAnchor + err error + signBytes string } func TestMsgAnchor(t *testing.T) { @@ -39,3 +42,13 @@ func (s *msgAnchorSuite) ExpectTheError(a string) { func (s *msgAnchorSuite) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgAnchorSuite) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgAnchorSuite) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/data/msg_attest_test.go b/x/data/msg_attest_test.go index abe704df2e..cef1bd6968 100644 --- a/x/data/msg_attest_test.go +++ b/x/data/msg_attest_test.go @@ -1,6 +1,8 @@ package data import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgAttestSuite struct { - t gocuke.TestingT - msg *MsgAttest - err error + t gocuke.TestingT + msg *MsgAttest + err error + signBytes string } func TestMsgAttest(t *testing.T) { @@ -41,3 +44,13 @@ func (s *msgAttestSuite) ExpectTheError(a string) { func (s *msgAttestSuite) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgAttestSuite) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgAttestSuite) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/data/msg_define_resolver_test.go b/x/data/msg_define_resolver_test.go index f64ae1ca39..63cf609229 100644 --- a/x/data/msg_define_resolver_test.go +++ b/x/data/msg_define_resolver_test.go @@ -1,6 +1,8 @@ package data import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgDefineResolverSuite struct { - t gocuke.TestingT - msg *MsgDefineResolver - err error + t gocuke.TestingT + msg *MsgDefineResolver + err error + signBytes string } func TestMsgDefineResolver(t *testing.T) { @@ -41,3 +44,13 @@ func (s *msgDefineResolverSuite) ExpectTheError(a string) { func (s *msgDefineResolverSuite) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgDefineResolverSuite) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgDefineResolverSuite) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} diff --git a/x/data/msg_register_resolver_test.go b/x/data/msg_register_resolver_test.go index 0b277e8c81..d5db1e68da 100644 --- a/x/data/msg_register_resolver_test.go +++ b/x/data/msg_register_resolver_test.go @@ -1,6 +1,8 @@ package data import ( + "bytes" + "encoding/json" "testing" "github.com/gogo/protobuf/jsonpb" @@ -9,9 +11,10 @@ import ( ) type msgRegisterResolverSuite struct { - t gocuke.TestingT - msg *MsgRegisterResolver - err error + t gocuke.TestingT + msg *MsgRegisterResolver + err error + signBytes string } func TestMsgRegisterResolver(t *testing.T) { @@ -41,3 +44,13 @@ func (s *msgRegisterResolverSuite) ExpectTheError(a string) { func (s *msgRegisterResolverSuite) ExpectNoError() { require.NoError(s.t, s.err) } + +func (s *msgRegisterResolverSuite) MessageSignBytesQueried() { + s.signBytes = string(s.msg.GetSignBytes()) +} + +func (s *msgRegisterResolverSuite) ExpectTheSignBytes(expected gocuke.DocString) { + buffer := new(bytes.Buffer) + require.NoError(s.t, json.Compact(buffer, []byte(expected.Content))) + require.Equal(s.t, buffer.String(), s.signBytes) +} From 1cca864da57332a16227ded1524eb0666d20367c Mon Sep 17 00:00:00 2001 From: Tyler <48813565+technicallyty@users.noreply.github.com> Date: Wed, 19 Oct 2022 09:22:27 -0700 Subject: [PATCH 16/17] docs: update marketplace proto (#1560) Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> --- api/regen/ecocredit/marketplace/v1/tx_grpc.pb.go | 4 ++-- proto/regen/ecocredit/basket/v1/events.proto | 2 +- proto/regen/ecocredit/basket/v1/tx.proto | 3 +-- proto/regen/ecocredit/marketplace/v1/tx.proto | 2 +- x/ecocredit/marketplace/types/v1/tx.pb.go | 4 ++-- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/api/regen/ecocredit/marketplace/v1/tx_grpc.pb.go b/api/regen/ecocredit/marketplace/v1/tx_grpc.pb.go index c057ceb0f0..e7d2fa4177 100644 --- a/api/regen/ecocredit/marketplace/v1/tx_grpc.pb.go +++ b/api/regen/ecocredit/marketplace/v1/tx_grpc.pb.go @@ -26,7 +26,7 @@ type MsgClient interface { Sell(ctx context.Context, in *MsgSell, opts ...grpc.CallOption) (*MsgSellResponse, error) // UpdateSellOrders updates existing sell orders. UpdateSellOrders(ctx context.Context, in *MsgUpdateSellOrders, opts ...grpc.CallOption) (*MsgUpdateSellOrdersResponse, error) - // CancelSellOrder cancels a sell order and returns the funds from escrow. + // CancelSellOrder cancels a sell order and returns the credits from escrow. CancelSellOrder(ctx context.Context, in *MsgCancelSellOrder, opts ...grpc.CallOption) (*MsgCancelSellOrderResponse, error) // BuyDirect purchases credits directly from the specified sell order. BuyDirect(ctx context.Context, in *MsgBuyDirect, opts ...grpc.CallOption) (*MsgBuyDirectResponse, error) @@ -111,7 +111,7 @@ type MsgServer interface { Sell(context.Context, *MsgSell) (*MsgSellResponse, error) // UpdateSellOrders updates existing sell orders. UpdateSellOrders(context.Context, *MsgUpdateSellOrders) (*MsgUpdateSellOrdersResponse, error) - // CancelSellOrder cancels a sell order and returns the funds from escrow. + // CancelSellOrder cancels a sell order and returns the credits from escrow. CancelSellOrder(context.Context, *MsgCancelSellOrder) (*MsgCancelSellOrderResponse, error) // BuyDirect purchases credits directly from the specified sell order. BuyDirect(context.Context, *MsgBuyDirect) (*MsgBuyDirectResponse, error) diff --git a/proto/regen/ecocredit/basket/v1/events.proto b/proto/regen/ecocredit/basket/v1/events.proto index 0fe29eea4b..7690752724 100644 --- a/proto/regen/ecocredit/basket/v1/events.proto +++ b/proto/regen/ecocredit/basket/v1/events.proto @@ -71,6 +71,6 @@ message EventTake { // Since Revision 2 message EventUpdateCurator { - // denom is the basket denom. + // denom is the basket denom. string denom = 1; } diff --git a/proto/regen/ecocredit/basket/v1/tx.proto b/proto/regen/ecocredit/basket/v1/tx.proto index 4faffdd05c..1d74fe1adc 100644 --- a/proto/regen/ecocredit/basket/v1/tx.proto +++ b/proto/regen/ecocredit/basket/v1/tx.proto @@ -192,7 +192,7 @@ message MsgUpdateBasketFeeResponse {} // Since Revision 2 message MsgUpdateCurator { option (cosmos.msg.v1.signer) = "curator"; - + // curator is the address of the basket curator. string curator = 1; @@ -202,7 +202,6 @@ message MsgUpdateCurator { // new_curator is the address of the account that will become the // new curator of the basket. string new_curator = 3; - } // MsgUpdateCuratorResponse is the Msg/UpdateCurator response type. diff --git a/proto/regen/ecocredit/marketplace/v1/tx.proto b/proto/regen/ecocredit/marketplace/v1/tx.proto index de29bdcfe5..f36dae88e0 100644 --- a/proto/regen/ecocredit/marketplace/v1/tx.proto +++ b/proto/regen/ecocredit/marketplace/v1/tx.proto @@ -19,7 +19,7 @@ service Msg { rpc UpdateSellOrders(MsgUpdateSellOrders) returns (MsgUpdateSellOrdersResponse); - // CancelSellOrder cancels a sell order and returns the funds from escrow. + // CancelSellOrder cancels a sell order and returns the credits from escrow. rpc CancelSellOrder(MsgCancelSellOrder) returns (MsgCancelSellOrderResponse); // BuyDirect purchases credits directly from the specified sell order. diff --git a/x/ecocredit/marketplace/types/v1/tx.pb.go b/x/ecocredit/marketplace/types/v1/tx.pb.go index c3605e5d33..bec1d80a44 100644 --- a/x/ecocredit/marketplace/types/v1/tx.pb.go +++ b/x/ecocredit/marketplace/types/v1/tx.pb.go @@ -990,7 +990,7 @@ type MsgClient interface { Sell(ctx context.Context, in *MsgSell, opts ...grpc.CallOption) (*MsgSellResponse, error) // UpdateSellOrders updates existing sell orders. UpdateSellOrders(ctx context.Context, in *MsgUpdateSellOrders, opts ...grpc.CallOption) (*MsgUpdateSellOrdersResponse, error) - // CancelSellOrder cancels a sell order and returns the funds from escrow. + // CancelSellOrder cancels a sell order and returns the credits from escrow. CancelSellOrder(ctx context.Context, in *MsgCancelSellOrder, opts ...grpc.CallOption) (*MsgCancelSellOrderResponse, error) // BuyDirect purchases credits directly from the specified sell order. BuyDirect(ctx context.Context, in *MsgBuyDirect, opts ...grpc.CallOption) (*MsgBuyDirectResponse, error) @@ -1073,7 +1073,7 @@ type MsgServer interface { Sell(context.Context, *MsgSell) (*MsgSellResponse, error) // UpdateSellOrders updates existing sell orders. UpdateSellOrders(context.Context, *MsgUpdateSellOrders) (*MsgUpdateSellOrdersResponse, error) - // CancelSellOrder cancels a sell order and returns the funds from escrow. + // CancelSellOrder cancels a sell order and returns the credits from escrow. CancelSellOrder(context.Context, *MsgCancelSellOrder) (*MsgCancelSellOrderResponse, error) // BuyDirect purchases credits directly from the specified sell order. BuyDirect(context.Context, *MsgBuyDirect) (*MsgBuyDirectResponse, error) From 2587eb3921590bfe0af0c6f9430a5fc5457a5050 Mon Sep 17 00:00:00 2001 From: MD Aleem <72057206+aleem1314@users.noreply.github.com> Date: Wed, 19 Oct 2022 21:59:28 +0530 Subject: [PATCH 17/17] docs(x/ecocredit): update client docs (#1558) Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> --- x/ecocredit/spec/07_client.md | 394 ++++++++++++++++++++++++++++++++++ 1 file changed, 394 insertions(+) diff --git a/x/ecocredit/spec/07_client.md b/x/ecocredit/spec/07_client.md index 9e79b46ebd..0103884ce0 100644 --- a/x/ecocredit/spec/07_client.md +++ b/x/ecocredit/spec/07_client.md @@ -719,6 +719,179 @@ Example Output: } ``` +### BalancesByBatch + +The `BalancesByBatch` endpoint allows users to query all credit balances from a +given credit batch. + +```bash +regen.ecocredit.v1.Query/BalancesByBatch +``` + +Example: + +```bash +grpcurl -plaintext \ + -d '{"batch_denom": "C02-001-20210101-20250101-001"}' \ + localhost:9090 regen.ecocredit.v1.Query/BalancesByBatch +``` + +Example Output: + +```bash +{ + "balances": [ + { + "address": "regen1qwa9xy0997j5mrc4dxn7jrcvvkpm3uwuldkrmg", + "batchDenom": "C02-001-20210101-20250101-001", + "tradableAmount": "92.0", + "retiredAmount": "97", + "escrowedAmount": "30.0" + } + ], + "pagination": { + "nextKey": "BwEJABQDulMR5S+lTY8VaafpDwxlg7jx3AAF" + } +} +``` + + +### AllBalances + +The `AllBalances` endpoint allows users to query all credit balances. + +```bash +regen.ecocredit.v1.Query/AllBalances +``` + +Example: + +```bash +grpcurl -plaintext localhost:9090 regen.ecocredit.v1.Query/AllBalances +``` + +Example Output: + +```bash +{ + "balances": [ + { + "address": "regen1qwa9xy0997j5mrc4dxn7jrcvvkpm3uwuldkrmg", + "batchDenom": "C02-001-20210101-20250101-001", + "tradableAmount": "92.0", + "retiredAmount": "97", + "escrowedAmount": "30.0" + } + ], + "pagination": { + "nextKey": "BwEJABQDulMR5S+lTY8VaafpDwxlg7jx3AAF" + } +} +``` + +### ClassCreatorAllowlist + +The `ClassCreatorAllowlist` endpoint allows users to query the credit class +creator allowlist enable setting. + +```bash +regen.ecocredit.v1.Query/ClassCreatorAllowlist +``` + +Example: + +```bash +grpcurl -plaintext localhost:9090 regen.ecocredit.v1.Query/ClassCreatorAllowlist +``` + +Example Output: + +```bash +{ + "enabled":"true" +} +``` + +### AllowedClassCreators + +The `AllowedClassCreators` endpoint allows users to query allowed credit class +creators list. + +```bash +regen.ecocredit.v1.Query/AllowedClassCreators +``` + +Example: + +```bash +grpcurl -plaintext localhost:9090 regen.ecocredit.v1.Query/AllowedClassCreators +``` + +Example Output: + +```bash +{ + "classCreators":[ + "regen1qwa9xy0997j5mrc4dxn7jrcvvkpm3uwuldkrmg", + "regen123a7e9gvgm53zvswc6daq7c85xtzt8263lgasm" + ], + "pagination": { + "nextKey": "BwEJABQDulMR5S" + } +} +``` + +### ClassFee + +The `ClassFee` endpoint allows users to query credit class creation fee. + +```bash +regen.ecocredit.v1.Query/ClassFee +``` + +Example: + +```bash +grpcurl -plaintext localhost:9090 regen.ecocredit.v1.Query/ClassFee +``` + +Example Output: + +```bash +{ + "fee": { + "denom": "uregen", + "amount": "20000000" + } +} +``` + +### AllowedBridgeChains + +The `AllowedBridgeChains` endpoint allows users query list of chains allowed to be +used in bridge operations. + +```bash +regen.ecocredit.v1.Query/AllowedBridgeChains +``` + +Example: + +```bash +grpcurl -plaintext localhost:9090 regen.ecocredit.v1.Query/AllowedBridgeChains +``` + +Example Output: + +```bash +{ + "allowedBridgeChains":[ + "polygon" + ] +} +``` + + ### Basket The `Basket` endpoint allows users to query for information on basket. @@ -892,6 +1065,31 @@ Example Output: } ``` +### BasketFee + +The `BasketFee` endpoint allows users to query basket creation fee. + +```bash +regen.ecocredit.basket.v1.Query/BasketFee +``` + +Example + +```bash +grpcurl -plaintext localhost:9090 regen.ecocredit.basket.v1.Query/BasketFee +``` + +Example Output: + +```bash +{ + "fee": { + "denom":"uregen", + "amount": "1000000000" + } +} +``` + ### SellOrder @@ -1735,6 +1933,177 @@ Example Output: } ``` +### BalancesByBatch + +The `BalancesByBatch` endpoint allows users to query all credit balances from a +given credit batch. + +```bash +/regen/ecocredit/v1/balances-by-batch/{batch_denom} +/regen/ecocredit/v1/batches/{batch_denom}/balances +``` + +Example: + +```bash +curl localhost:1317/regen/ecocredit/v1/batches/C02-001-20210101-20250101-001/balances +``` + +Example Output: + +```bash +{ + "balances": [ + { + "address": "regen1qwa9xy0997j5mrc4dxn7jrcvvkpm3uwuldkrmg", + "batch_denom": "C02-001-20210101-20250101-001", + "tradable_amount": "92.0", + "retired_amount": "97", + "escrowed_amount": "30.0" + } + ], + "pagination": { + "next_key": "BwEJABQDulMR5S+lTY8VaafpDwxlg7jx3AAF" + } +} +``` + +### AllBalances + +The `AllBalances` endpoint allows users to query all credit balances. + +```bash +/regen/ecocredit/v1/all-balances +/regen/ecocredit/v1/balances +``` + +Example: + +```bash +curl localhost:1317/regen/ecocredit/v1/balances +``` + +Example Output: + +```bash +{ + "balances": [ + { + "address": "regen1qwa9xy0997j5mrc4dxn7jrcvvkpm3uwuldkrmg", + "batch_denom": "C02-001-20210101-20250101-001", + "tradable_amount": "92.0", + "retired_amount": "97", + "escrowed_amount": "30.0" + } + ], + "pagination": { + "next_key": "BwEJABQDulMR5S+lTY8VaafpDwxlg7jx3AAF" + } +} +``` + +### ClassCreatorAllowlist + +The `ClassCreatorAllowlist` endpoint allows users to query the credit class +creator allowlist enable setting. + +```bash +/regen/ecocredit/v1/class-creator-allowlist +``` + +Example: + +```bash +curl localhost:1317/regen/ecocredit/v1/class-creator-allowlist +``` + +Example Output: + +```bash +{ + "enabled":"true" +} +``` + +### AllowedClassCreators + +The `AllowedClassCreators` endpoint allows users to query allowed credit class +creators list. + +```bash +/regen/ecocredit/v1/allowed-class-creators +``` + +Example: + +```bash +curl localhost:1317/regen/ecocredit/v1/allowed-class-creators +``` + +Example Output: + +```bash +{ + "class_creators":[ + "regen1qwa9xy0997j5mrc4dxn7jrcvvkpm3uwuldkrmg", + "regen123a7e9gvgm53zvswc6daq7c85xtzt8263lgasm" + ], + "pagination": { + "next_key": "BwEJABQDulMR5S" + } +} +``` + +### ClassFee + +The `ClassFee` endpoint allows users to query credit class creation fee. + + +```bash +/regen/ecocredit/v1/class-fee +``` + +Example: + +```bash +curl localhost:1317/regen/ecocredit/v1/class-fee +``` + +Example Output: + +```bash +{ + "fee": { + "denom": "uregen", + "amount": "20000000" + } +} +``` + +### AllowedBridgeChains + +The `AllowedBridgeChains` endpoint allows users query list of chains allowed to be +used in bridge operations. + +```bash +/regen/ecocredit/v1/allowed-bridge-chains +``` + +Example: + +```bash +curl localhost:1317/regen/ecocredit/v1/allowed-bridge-chains +``` + +Example Output: + +```bash +{ + "allowed_bridge_chains":[ + "polygon" + ] +} +``` ### Basket @@ -1902,6 +2271,31 @@ Example Output: } ``` +### BasketFee + +The `BasketFee` endpoint allows users to query basket creation fee. + +```bash +regen/ecocredit/basket/v1/basket-fee +``` + +Example: + +```bash +curl localhost:1317/regen/ecocredit/basket/v1/basket-fee +``` + +Example Output: + +```bash +{ + "fee": { + "denom":"uregen", + "amount": "1000000000" + } +} +``` + ### sell-orders The `sell-orders` endpoint allows users to query all sell orders.