From e5110cb079e467626d3aca0ffc3564fe1328e85f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Jun 2021 15:11:19 +0000 Subject: [PATCH 01/50] build(deps): bump github.com/prometheus/common from 0.28.0 to 0.29.0 (#9500) Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.28.0 to 0.29.0.
Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/prometheus/common&package-manager=go_modules&previous-version=0.28.0&new-version=0.29.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 281490a67f..aa3b80eb33 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( github.com/pelletier/go-toml v1.8.1 // indirect github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.11.0 - github.com/prometheus/common v0.28.0 + github.com/prometheus/common v0.29.0 github.com/rakyll/statik v0.1.7 github.com/regen-network/cosmos-proto v0.3.1 github.com/rs/zerolog v1.22.0 diff --git a/go.sum b/go.sum index 206f36d3b9..a957981684 100644 --- a/go.sum +++ b/go.sum @@ -618,8 +618,8 @@ github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8b github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.14.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.28.0 h1:vGVfV9KrDTvWt5boZO0I19g2E3CsWfpPPKZM9dt3mEw= -github.com/prometheus/common v0.28.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.29.0 h1:3jqPBvKT4OHAbje2Ql7KeaaSicDBCxMYwEJU1zRJceE= +github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= From 6e26c6c7d36e0a2ff6ce4a522e2bd49fda0b9489 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Mon, 14 Jun 2021 20:08:39 -0400 Subject: [PATCH 02/50] Remove Docs label from auto-label action (#9517) --- .github/labeler.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 04a3f87dd4..65310f6f15 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -50,8 +50,5 @@ "C:CLI": - client/**/* - x/*/client/**/* -"Type: Docs": - - docs/**/* - - x/*/spec/**/* "Type: ADR": - - docs/architecture/**/* + - docs/architecture/**/* From d2e0819ad86d41ef83d462848e81c719002e6312 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Jun 2021 08:29:43 +0000 Subject: [PATCH 03/50] build(deps): bump github.com/rs/zerolog from 1.22.0 to 1.23.0 (#9515) Bumps [github.com/rs/zerolog](https://github.com/rs/zerolog) from 1.22.0 to 1.23.0.
Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/rs/zerolog&package-manager=go_modules&previous-version=1.22.0&new-version=1.23.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- go.mod | 2 +- go.sum | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index aa3b80eb33..173d097586 100644 --- a/go.mod +++ b/go.mod @@ -36,7 +36,7 @@ require ( github.com/prometheus/common v0.29.0 github.com/rakyll/statik v0.1.7 github.com/regen-network/cosmos-proto v0.3.1 - github.com/rs/zerolog v1.22.0 + github.com/rs/zerolog v1.23.0 github.com/spf13/afero v1.3.4 // indirect github.com/spf13/cast v1.3.1 github.com/spf13/cobra v1.1.3 diff --git a/go.sum b/go.sum index a957981684..266b5b8b61 100644 --- a/go.sum +++ b/go.sum @@ -151,6 +151,7 @@ github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= @@ -267,6 +268,7 @@ github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -649,8 +651,8 @@ github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= -github.com/rs/zerolog v1.22.0 h1:XrVUjV4K+izZpKXZHlPrYQiDtmdGiCylnT4i43AAWxg= -github.com/rs/zerolog v1.22.0/go.mod h1:ZPhntP/xmq1nnND05hhpAh2QMhSsA4UN3MGZ6O2J3hM= +github.com/rs/zerolog v1.23.0 h1:UskrK+saS9P9Y789yNNulYKdARjPZuS35B8gJF2x60g= +github.com/rs/zerolog v1.23.0/go.mod h1:6c7hFfxPOy7TacJc4Fcdi24/J0NKYGzjG8FWRI916Qo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= From 8c5b21eaf6726bec0798f384f2720857a4b1bafc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Jun 2021 15:23:16 +0200 Subject: [PATCH 04/50] build(deps): bump codecov/codecov-action from 1.5.0 to 1.5.2 (#9482) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 1.5.0 to 1.5.2. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v1.5.0...v1.5.2) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 65e1d36c5b..62810ca82e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -164,7 +164,7 @@ jobs: sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt done if: env.GIT_DIFF - - uses: codecov/codecov-action@v1.5.0 + - uses: codecov/codecov-action@v1.5.2 with: file: ./coverage.txt if: env.GIT_DIFF From 3c82a32f9b2d8773114282b1977061cfc587dc26 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Jun 2021 07:44:53 +0000 Subject: [PATCH 05/50] build(deps): bump github.com/golang/mock from 1.5.0 to 1.6.0 (#9512) Bumps [github.com/golang/mock](https://github.com/golang/mock) from 1.5.0 to 1.6.0.
Release notes

Sourced from github.com/golang/mock's releases.

v1.6.0

Changelog

317c030 Best effort guesses for output package path (#547) c59ba11 add ARM to support apple M1 chip to releaser (#562) 58935d8 add a basic CONTRIBUTING.md (#535) a5582fc add docs on 1.16 install and adding to PATH (#534) 0cd3aaf add flags documentation (#539) 64b0b80 add notes and error helper for vendor+reflect error (#567) e303461 add type information to error messages (#559) 0cdccf5 feat add InAnyOrder matcher (#546) 82ce4a7 feat validate Do & DoReturn args (#558) 93308c3 fix broken badge (#525) 9336b7e fix error message in parse.go (#540) ab03293 fix ill-formatted message with fmt-verbs like %s (#564) bb5fd5e fix linter errors (#552) aba2ff9 fix parse array with the external const correctly (#569) 6ff1070 fix parse arrays with const length correctly (#520) 7f5f64d fixup some docs and templates (#524) 7078515 refactor go:generate lines so they are consistently placed (#527) 7105dde refactor mockgen and cleanup (#536) f36d14a test(sample/user_test.go): minor correction at t.Errorf (#544) ef4ad87 update CI for 1.16 (#526) ad820b0 update Finish docs for Go1.14+ (#556) 2421472 update dependencies (#528) 953a5bb update user mock to be in test package (#566) d19a212 upgrade dependencies (#557)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/golang/mock&package-manager=go_modules&previous-version=1.5.0&new-version=1.6.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- go.mod | 2 +- go.sum | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 173d097586..1118149c90 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/enigmampc/btcutil v1.0.3-0.20200723161021-e2fb6adb2a25 github.com/gogo/gateway v1.1.0 github.com/gogo/protobuf v1.3.3 - github.com/golang/mock v1.5.0 + github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.2 github.com/gorilla/handlers v1.5.1 github.com/gorilla/mux v1.8.0 diff --git a/go.sum b/go.sum index 266b5b8b61..5b9a9387c7 100644 --- a/go.sum +++ b/go.sum @@ -283,8 +283,8 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0 h1:jlYHihg//f7RRwuPfptm04yp4s7O6Kw8EZiVYIGcH0g= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -766,6 +766,7 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/zondax/hid v0.9.0 h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8= github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -844,6 +845,7 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -886,6 +888,7 @@ golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210525063256-abc453219eb5 h1:wjuX4b5yYQnEQHzd+CBcrcC6OVR2J1CN6mUy0oSxIPo= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -904,6 +907,7 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -960,7 +964,9 @@ golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 h1:JWgyZ1qgdTaF3N3oxC+MdTV7qvEEgHo3otj+HB5CM7Q= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -1027,6 +1033,7 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 38d670226f5903b1576672cafba5693b511e7abc Mon Sep 17 00:00:00 2001 From: MD Aleem <72057206+aleem1314@users.noreply.github.com> Date: Wed, 16 Jun 2021 16:03:42 +0530 Subject: [PATCH 06/50] feat: grpc-web add CORS handler (#9493) ## Description Closes: #9467 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- CHANGELOG.md | 1 + server/config/config.go | 8 ++++++-- server/config/toml.go | 3 +++ server/grpc/grpc_web.go | 11 ++++++++++- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47325522b7..d457042580 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -131,6 +131,7 @@ if input key is empty, or input data contains empty key. ### Improvements +* (gRPC-Web) [\#9493](https://github.com/cosmos/cosmos-sdk/pull/9493) Add `EnableUnsafeCORS` flag to grpc-web config. * (store) [\#9403](https://github.com/cosmos/cosmos-sdk/pull/9403) Add `RefundGas` function to `GasMeter` interface * (baseapp, types) [\#9390](https://github.com/cosmos/cosmos-sdk/pull/9390) Add current block header hash to `Context` * (x/staking) [\#9423](https://github.com/cosmos/cosmos-sdk/pull/9423) Staking delegations now returns empty list instead of rpc error when no records found. diff --git a/server/config/config.go b/server/config/config.go index 8f1c47e88d..907e64a634 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -140,6 +140,9 @@ type GRPCWebConfig struct { // Address defines the gRPC-web server to listen on Address string `mapstructure:"address"` + + // EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk) + EnableUnsafeCORS bool `mapstructure:"enable-unsafe-cors"` } // StateSyncConfig defines the state sync snapshot configuration. @@ -297,8 +300,9 @@ func GetConfig(v *viper.Viper) Config { Address: v.GetString("grpc.address"), }, GRPCWeb: GRPCWebConfig{ - Enable: v.GetBool("grpc-web.enable"), - Address: v.GetString("grpc-web.address"), + Enable: v.GetBool("grpc-web.enable"), + Address: v.GetString("grpc-web.address"), + EnableUnsafeCORS: v.GetBool("grpc-web.enable-unsafe-cors"), }, StateSync: StateSyncConfig{ SnapshotInterval: v.GetUint64("state-sync.snapshot-interval"), diff --git a/server/config/toml.go b/server/config/toml.go index 88197defe9..d2eb2601e9 100644 --- a/server/config/toml.go +++ b/server/config/toml.go @@ -184,6 +184,9 @@ enable = {{ .GRPCWeb.Enable }} # Address defines the gRPC-web server address to bind to. address = "{{ .GRPCWeb.Address }}" +# EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). +enable-unsafe-cors = {{ .GRPCWeb.EnableUnsafeCORS }} + ############################################################################### ### State Sync Configuration ### ############################################################################### diff --git a/server/grpc/grpc_web.go b/server/grpc/grpc_web.go index 67dc4364a8..593779835a 100644 --- a/server/grpc/grpc_web.go +++ b/server/grpc/grpc_web.go @@ -11,7 +11,16 @@ import ( // StartGRPCWeb starts a gRPC-Web server on the given address. func StartGRPCWeb(grpcSrv *grpc.Server, config config.Config) (*http.Server, error) { - wrappedServer := grpcweb.WrapServer(grpcSrv) + var options []grpcweb.Option + if config.GRPCWeb.EnableUnsafeCORS { + options = append(options, + grpcweb.WithOriginFunc(func(origin string) bool { + return true + }), + ) + } + + wrappedServer := grpcweb.WrapServer(grpcSrv, options...) handler := func(resp http.ResponseWriter, req *http.Request) { wrappedServer.ServeHTTP(resp, req) } From 3841df6468ea7f211a606878a84f6c72db70638e Mon Sep 17 00:00:00 2001 From: Venkatesh Mankena Date: Wed, 16 Jun 2021 19:48:02 +0530 Subject: [PATCH 07/50] fix: Handle MAX_INT_256 (#9511) Change maxBitLen of sdk.Int to handle max Erc20 value. ## Description Closes: #XXXX --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [x] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- CHANGELOG.md | 1 + types/decimal.go | 20 +++++++++++--------- types/int.go | 6 +++--- types/int_internal_test.go | 20 +++++++++++++++++++- types/int_test.go | 22 +++++++++++----------- 5 files changed, 45 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d457042580..4b3c57bc66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -153,6 +153,7 @@ if input key is empty, or input data contains empty key. * (x/bank) [\#8434](https://github.com/cosmos/cosmos-sdk/pull/8434) Fix legacy REST API `GET /bank/total` and `GET /bank/total/{denom}` in swagger * (x/slashing) [\#8427](https://github.com/cosmos/cosmos-sdk/pull/8427) Fix query signing infos command * (x/bank) [\#9229](https://github.com/cosmos/cosmos-sdk/pull/9229) Now zero coin balances cannot be added to balances & supply stores. If any denom becomes zero corresponding key gets deleted from store. +* (types) [\#9511](https://github.com/cosmos/cosmos-sdk/pull/9511) Change `maxBitLen` of `sdk.Int` and `sdk.Dec` to handle max ERC20 value. ### Deprecated diff --git a/types/decimal.go b/types/decimal.go index 47de0618bc..a6d2868969 100644 --- a/types/decimal.go +++ b/types/decimal.go @@ -26,6 +26,8 @@ const ( // Ceiling[Log2[999 999 999 999 999 999]] DecimalPrecisionBits = 60 + maxDecBitLen = maxBitLen + DecimalPrecisionBits + // max number of iterations in ApproxRoot function maxApproxRootIterations = 100 ) @@ -222,7 +224,7 @@ func (d Dec) BigInt() *big.Int { func (d Dec) Add(d2 Dec) Dec { res := new(big.Int).Add(d.i, d2.i) - if res.BitLen() > 255+DecimalPrecisionBits { + if res.BitLen() > maxDecBitLen { panic("Int overflow") } return Dec{res} @@ -232,7 +234,7 @@ func (d Dec) Add(d2 Dec) Dec { func (d Dec) Sub(d2 Dec) Dec { res := new(big.Int).Sub(d.i, d2.i) - if res.BitLen() > 255+DecimalPrecisionBits { + if res.BitLen() > maxDecBitLen { panic("Int overflow") } return Dec{res} @@ -243,7 +245,7 @@ func (d Dec) Mul(d2 Dec) Dec { mul := new(big.Int).Mul(d.i, d2.i) chopped := chopPrecisionAndRound(mul) - if chopped.BitLen() > 255+DecimalPrecisionBits { + if chopped.BitLen() > maxDecBitLen { panic("Int overflow") } return Dec{chopped} @@ -254,7 +256,7 @@ func (d Dec) MulTruncate(d2 Dec) Dec { mul := new(big.Int).Mul(d.i, d2.i) chopped := chopPrecisionAndTruncate(mul) - if chopped.BitLen() > 255+DecimalPrecisionBits { + if chopped.BitLen() > maxDecBitLen { panic("Int overflow") } return Dec{chopped} @@ -264,7 +266,7 @@ func (d Dec) MulTruncate(d2 Dec) Dec { func (d Dec) MulInt(i Int) Dec { mul := new(big.Int).Mul(d.i, i.i) - if mul.BitLen() > 255+DecimalPrecisionBits { + if mul.BitLen() > maxDecBitLen { panic("Int overflow") } return Dec{mul} @@ -274,7 +276,7 @@ func (d Dec) MulInt(i Int) Dec { func (d Dec) MulInt64(i int64) Dec { mul := new(big.Int).Mul(d.i, big.NewInt(i)) - if mul.BitLen() > 255+DecimalPrecisionBits { + if mul.BitLen() > maxDecBitLen { panic("Int overflow") } return Dec{mul} @@ -289,7 +291,7 @@ func (d Dec) Quo(d2 Dec) Dec { quo := new(big.Int).Quo(mul, d2.i) chopped := chopPrecisionAndRound(quo) - if chopped.BitLen() > 255+DecimalPrecisionBits { + if chopped.BitLen() > maxDecBitLen { panic("Int overflow") } return Dec{chopped} @@ -304,7 +306,7 @@ func (d Dec) QuoTruncate(d2 Dec) Dec { quo := mul.Quo(mul, d2.i) chopped := chopPrecisionAndTruncate(quo) - if chopped.BitLen() > 255+DecimalPrecisionBits { + if chopped.BitLen() > maxDecBitLen { panic("Int overflow") } return Dec{chopped} @@ -319,7 +321,7 @@ func (d Dec) QuoRoundUp(d2 Dec) Dec { quo := new(big.Int).Quo(mul, d2.i) chopped := chopPrecisionAndRoundUp(quo) - if chopped.BitLen() > 255+DecimalPrecisionBits { + if chopped.BitLen() > maxDecBitLen { panic("Int overflow") } return Dec{chopped} diff --git a/types/int.go b/types/int.go index 1a013bc054..0708cda581 100644 --- a/types/int.go +++ b/types/int.go @@ -9,7 +9,7 @@ import ( "math/big" ) -const maxBitLen = 255 +const maxBitLen = 256 func newIntegerFromString(s string) (*big.Int, bool) { return new(big.Int).SetString(s, 0) @@ -69,9 +69,9 @@ func unmarshalText(i *big.Int, text string) error { var _ CustomProtobufType = (*Int)(nil) -// Int wraps big.Int with a 256 bit range bound +// Int wraps big.Int with a 257 bit range bound // Checks overflow, underflow and division by zero -// Exists in range from -(2^255 - 1) to 2^255 - 1 +// Exists in range from -(2^256 - 1) to 2^256 - 1 type Int struct { i *big.Int } diff --git a/types/int_internal_test.go b/types/int_internal_test.go index c6b039948e..77d357bbf7 100644 --- a/types/int_internal_test.go +++ b/types/int_internal_test.go @@ -63,7 +63,7 @@ func (s *internalIntTestSuite) TestEncodingRandom() { } func (s *internalIntTestSuite) TestSerializationOverflow() { - bx, _ := new(big.Int).SetString("91888242871839275229946405745257275988696311157297823662689937894645226298583", 10) + bx, _ := new(big.Int).SetString("115792089237316195423570985008687907853269984665640564039457584007913129639936", 10) x := Int{bx} y := new(Int) @@ -80,6 +80,24 @@ func (s *internalIntTestSuite) TestSerializationOverflow() { s.Require().Error(y.UnmarshalJSON(bz)) } +func (s *internalIntTestSuite) TestDeserializeMaxERC20() { + bx, _ := new(big.Int).SetString("115792089237316195423570985008687907853269984665640564039457584007913129639935", 10) + x := Int{bx} + y := new(Int) + + bz, err := x.Marshal() + s.Require().NoError(err) + + // require deserialization to be successful + s.Require().NoError(y.Unmarshal(bz)) + + // require JSON deserialization to succeed + bz, err = x.MarshalJSON() + s.Require().NoError(err) + + s.Require().NoError(y.UnmarshalJSON(bz)) +} + func (s *internalIntTestSuite) TestImmutabilityArithInt() { size := 500 diff --git a/types/int_test.go b/types/int_test.go index e992d67566..359c4859b6 100644 --- a/types/int_test.go +++ b/types/int_test.go @@ -40,16 +40,16 @@ func (s *intTestSuite) TestFromUint64() { } func (s *intTestSuite) TestIntPanic() { - // Max Int = 2^255-1 = 5.789e+76 - // Min Int = -(2^255-1) = -5.789e+76 - s.Require().NotPanics(func() { sdk.NewIntWithDecimal(1, 76) }) - i1 := sdk.NewIntWithDecimal(1, 76) - s.Require().NotPanics(func() { sdk.NewIntWithDecimal(2, 76) }) - i2 := sdk.NewIntWithDecimal(2, 76) - s.Require().NotPanics(func() { sdk.NewIntWithDecimal(3, 76) }) - i3 := sdk.NewIntWithDecimal(3, 76) + // Max Int = 2^256-1 = 1.1579209e+77 + // Min Int = -(2^256-1) = -1.1579209e+77 + s.Require().NotPanics(func() { sdk.NewIntWithDecimal(4, 76) }) + i1 := sdk.NewIntWithDecimal(4, 76) + s.Require().NotPanics(func() { sdk.NewIntWithDecimal(5, 76) }) + i2 := sdk.NewIntWithDecimal(5, 76) + s.Require().NotPanics(func() { sdk.NewIntWithDecimal(6, 76) }) + i3 := sdk.NewIntWithDecimal(6, 76) - s.Require().Panics(func() { sdk.NewIntWithDecimal(6, 76) }) + s.Require().Panics(func() { sdk.NewIntWithDecimal(2, 77) }) s.Require().Panics(func() { sdk.NewIntWithDecimal(9, 80) }) // Overflow check @@ -69,7 +69,7 @@ func (s *intTestSuite) TestIntPanic() { s.Require().Panics(func() { i2.Neg().Mul(i2.Neg()) }) s.Require().Panics(func() { i3.Neg().Mul(i3.Neg()) }) - // Underflow check + // // Underflow check i3n := i3.Neg() s.Require().NotPanics(func() { i3n.Sub(i1) }) s.Require().NotPanics(func() { i3n.Sub(i2) }) @@ -84,7 +84,7 @@ func (s *intTestSuite) TestIntPanic() { s.Require().Panics(func() { i3.Mul(i3.Neg()) }) // Bound check - intmax := sdk.NewIntFromBigInt(new(big.Int).Sub(new(big.Int).Exp(big.NewInt(2), big.NewInt(255), nil), big.NewInt(1))) + intmax := sdk.NewIntFromBigInt(new(big.Int).Sub(new(big.Int).Exp(big.NewInt(2), big.NewInt(256), nil), big.NewInt(1))) intmin := intmax.Neg() s.Require().NotPanics(func() { intmax.Add(sdk.ZeroInt()) }) s.Require().NotPanics(func() { intmin.Sub(sdk.ZeroInt()) }) From 530cd7d2567131824ec8836de2644ca1fd1071b1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 17 Jun 2021 05:52:08 +0000 Subject: [PATCH 08/50] build(deps): bump postcss from 7.0.35 to 7.0.36 in /docs (#9525) Bumps [postcss](https://github.com/postcss/postcss) from 7.0.35 to 7.0.36.
Release notes

Sourced from postcss's releases.

7.0.36

  • Backport ReDoS vulnerabilities from PostCSS 8.
Changelog

Sourced from postcss's changelog.

7.0.36

  • Backport ReDoS vulnerabilities from PostCSS 8.
Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=postcss&package-manager=npm_and_yarn&previous-version=7.0.35&new-version=7.0.36)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/cosmos/cosmos-sdk/network/alerts).
--- docs/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/package-lock.json b/docs/package-lock.json index 3d76fb80a9..eced509f49 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -6929,9 +6929,9 @@ "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" }, "postcss": { - "version": "7.0.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.35.tgz", - "integrity": "sha512-3QT8bBJeX/S5zKTTjTCIjRF3If4avAT6kqxcASlTWEtAFCb9NH0OUxNDfgZSWdP5fJnBYCMEWkIFfWeugjzYMg==", + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", "requires": { "chalk": "^2.4.2", "source-map": "^0.6.1", From 6e24a306d09a32433f2bc82268091050dbeab88c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 17 Jun 2021 06:09:33 +0000 Subject: [PATCH 09/50] build(deps): bump github.com/armon/go-metrics from 0.3.8 to 0.3.9 (#9518) Bumps [github.com/armon/go-metrics](https://github.com/armon/go-metrics) from 0.3.8 to 0.3.9.
Release notes

Sourced from github.com/armon/go-metrics's releases.

v0.3.9

Adds a new Stream method that provides a streaming HTTP 1.x handler that will return a news set of metrics every interval.

Commits
  • f792dbc Merge pull request #125 from dnephin/dnephin/stream-metrics
  • 01db687 inmem: reduce the interface to Stream
  • 056fff3 inmem: add support for streaming metrics as intervals complete
  • 96c40ac inmem: Inline a few functions into getInterval
  • See full diff in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/armon/go-metrics&package-manager=go_modules&previous-version=0.3.8&new-version=0.3.9)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 1118149c90..60342d3018 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ module github.com/cosmos/cosmos-sdk require ( github.com/99designs/keyring v1.1.6 - github.com/armon/go-metrics v0.3.8 + github.com/armon/go-metrics v0.3.9 github.com/bgentry/speakeasy v0.1.0 github.com/btcsuite/btcd v0.22.0-beta github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce diff --git a/go.sum b/go.sum index 5b9a9387c7..4d85a80acd 100644 --- a/go.sum +++ b/go.sum @@ -83,8 +83,8 @@ github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1: github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.3.8 h1:oOxq3KPj0WhCuy50EhzwiyMyG2ovRQZpZLXQuOh2a/M= -github.com/armon/go-metrics v0.3.8/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= +github.com/armon/go-metrics v0.3.9 h1:O2sNqxBdvq8Eq5xmzljcYzAORli6RWCvEym4cJf9m18= +github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= From 2316c0e482401a912ea07c17233af49ddfb2daca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 17 Jun 2021 06:33:29 +0000 Subject: [PATCH 10/50] build(deps): bump github.com/spf13/viper from 1.7.1 to 1.8.0 (#9524) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.7.1 to 1.8.0.
Release notes

Sourced from github.com/spf13/viper's releases.

v1.8.0

This is a maintenance release primarily containing fixes and improvements. The most prominent change is the etcd update to 3.5.0. Thanks to proper Go modules support, the dependency graph became much smaller.

## Changes

Added

  • Allow BindEnv to register multiple environment variables
  • Support for accessing slices
  • Experimental WASM support: Viper compiles on WASM
  • INI load options

Changed

  • Ensure BindPFlag detects a nil flag parameter

Fixed

  • Merging a key into a nil target
  • Panics during saving INI files

Security

  • Updated etcd to 3.5 which should make a lot of false positive vulnerability reports disappear

In addition to the above changes, this release comes with tons of minor improvements, documentation changes an dependency updates. Find more details in the 1.8.0 milestone.

Many thanks to everyone who contributed to this release!

Commits
  • faa8ba0 chore: update gotestsum
  • 65ee986 chore(lint): fix gofumpt
  • 04ef5fa chore: update golangci-lint
  • acd965b Add ini load options argument
  • 5f4d053 chore(deps): update dependencies
  • dd57ae6 chore(deps): update etcd
  • cdb5e59 Fix merging a key into a nil target
  • 36be6bf feat: make sure Viper compiles on WASM
  • 727a41c doc: add a note about concurent Get/Set to godoc
  • cb41ae0 doc: discuss concurrency in README
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/spf13/viper&package-manager=go_modules&previous-version=1.7.1&new-version=1.8.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- go.mod | 8 ++--- go.sum | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 89 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index 60342d3018..5fe07df594 100644 --- a/go.mod +++ b/go.mod @@ -30,19 +30,16 @@ require ( github.com/magiconair/properties v1.8.5 github.com/mattn/go-isatty v0.0.13 github.com/otiai10/copy v1.6.0 - github.com/pelletier/go-toml v1.8.1 // indirect github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.11.0 github.com/prometheus/common v0.29.0 github.com/rakyll/statik v0.1.7 github.com/regen-network/cosmos-proto v0.3.1 github.com/rs/zerolog v1.23.0 - github.com/spf13/afero v1.3.4 // indirect github.com/spf13/cast v1.3.1 github.com/spf13/cobra v1.1.3 - github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 - github.com/spf13/viper v1.7.1 + github.com/spf13/viper v1.8.0 github.com/stretchr/testify v1.7.0 github.com/tendermint/btcd v0.1.1 github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 @@ -50,10 +47,9 @@ require ( github.com/tendermint/tendermint v0.34.10 github.com/tendermint/tm-db v0.6.4 golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad - google.golang.org/genproto v0.0.0-20210114201628-6edceaf6022f + google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c google.golang.org/grpc v1.38.0 google.golang.org/protobuf v1.26.0 - gopkg.in/ini.v1 v1.61.0 // indirect gopkg.in/yaml.v2 v2.4.0 nhooyr.io/websocket v1.8.6 // indirect ) diff --git a/go.sum b/go.sum index 4d85a80acd..12f4306206 100644 --- a/go.sum +++ b/go.sum @@ -12,6 +12,11 @@ cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKV cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -98,6 +103,7 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= +github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6/go.mod h1:Dmm/EzmjnCiweXmzRIAiUWCInVmPgjkzgv5k4tVyXiQ= github.com/btcsuite/btcd v0.0.0-20190115013929-ed77733ec07d/go.mod h1:d3C0AkH6BRcvO8T0UEPu53cnw4IbV63x1bEjildYhO0= github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= @@ -283,6 +289,7 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -301,6 +308,7 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -318,6 +326,7 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/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 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -327,6 +336,7 @@ github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa h1:Q75Upo5UN4JbPFU github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -336,6 +346,10 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -417,6 +431,7 @@ github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmK github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/improbable-eng/grpc-web v0.14.0 h1:GdoK+cXABdB+1keuqsV1drSFO2XLYIxqt/4Rj8SWGBk= github.com/improbable-eng/grpc-web v0.14.0/go.mod h1:6hRR09jOEG81ADP5wCQju1z71g6OL4eEvELdran/3cs= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= @@ -509,8 +524,9 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -577,8 +593,8 @@ github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144T github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.8.1 h1:1Nf83orprkJyknT6h7zbuEGUEjcyVlCxSUGTENmNCRM= -github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= +github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ= +github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= @@ -678,8 +694,8 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.3.4 h1:8q6vk3hthlpb2SouZcnBVKboxWQWMDNF38bwholZrJc= -github.com/spf13/afero v1.3.4/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= @@ -699,8 +715,9 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/spf13/viper v1.8.0 h1:QRwDgoG8xX+kp69di68D+YYTCWfYEckbZRfUlEIAal0= +github.com/spf13/viper v1.8.0/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8OR4w3TdeIHIh1g6EMY5p0gVNOovcWC+1vpc7naMuAw= github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU= @@ -774,6 +791,9 @@ go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -781,14 +801,19 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -835,6 +860,8 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mobile v0.0.0-20200801112145-973feb4309de/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4= @@ -845,6 +872,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -888,6 +917,12 @@ golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210525063256-abc453219eb5 h1:wjuX4b5yYQnEQHzd+CBcrcC6OVR2J1CN6mUy0oSxIPo= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -896,6 +931,13 @@ golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -958,13 +1000,21 @@ golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 h1:JWgyZ1qgdTaF3N3oxC+MdTV7qvEEgHo3otj+HB5CM7Q= @@ -977,6 +1027,8 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1031,9 +1083,15 @@ golang.org/x/tools v0.0.0-20200717024301-6ddee64345a6/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1056,12 +1114,19 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1096,10 +1161,20 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201111145450-ac7456db90a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210114201628-6edceaf6022f h1:izedQ6yVIc5mZsRuXzmSreCOlzI0lCU1HpG8yEdMiKw= -google.golang.org/genproto v0.0.0-20210114201628-6edceaf6022f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c h1:wtujag7C+4D6KMoulW9YauvK2lgdvCMS260jsqqBXr0= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -1128,8 +1203,8 @@ 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.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.61.0 h1:LBCdW4FmFYL4s/vDZD1RQYX7oAR6IjujCYgMdbHBR10= -gopkg.in/ini.v1 v1.61.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU= +gopkg.in/ini.v1 v1.62.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= @@ -1147,8 +1222,9 @@ gopkg.in/yaml.v2 v2.2.8/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.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -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.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= 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 61dd71ed870b34cc249e779ea46a8e6009ce8380 Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Thu, 17 Jun 2021 02:42:07 -0500 Subject: [PATCH 11/50] perf: Speedup to params simulation (#9481) ## Description In Osmosis' simulation, we were observing that a large percent of the time was spent within SimulateParamChangeProposalContent, in particular within the composed key function. This is from a trace of our simulator running for 10 minutes: Screenshot 2021-06-08 at 2 32 28 PM ~This change lowers the number of calls to ComposedKey() by a factor of 3, and speeds up the underlying ComposedKey function. (sprintf is not particularly efficient for string concatenation, https://dev.to/pmalhaire/concatenate-strings-in-golang-a-quick-benchmark-4ahh ). After these change, the effect of ComposedKey() can no longer be seen in the profiler outputs.~ ~This change does not change the result of the simulator on a given seed.~ See https://github.com/cosmos/cosmos-sdk/pull/9481#issuecomment-857119210 for description of changes. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [x] added a changelog entry to `CHANGELOG.md` - [x] included comments for [documenting Go code](https://blog.golang.org/godoc) - [x] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- CHANGELOG.md | 1 + x/params/simulation/operations.go | 52 +++++++++++++------------- x/params/simulation/operations_test.go | 6 +-- x/params/simulation/proposals_test.go | 6 +-- x/simulation/params.go | 2 +- 5 files changed, 35 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b3c57bc66..06289b0ccd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -132,6 +132,7 @@ if input key is empty, or input data contains empty key. ### Improvements * (gRPC-Web) [\#9493](https://github.com/cosmos/cosmos-sdk/pull/9493) Add `EnableUnsafeCORS` flag to grpc-web config. +* (x/params) [\#9481](https://github.com/cosmos/cosmos-sdk/issues/9481) Speedup simulator for parameter change proposals. * (store) [\#9403](https://github.com/cosmos/cosmos-sdk/pull/9403) Add `RefundGas` function to `GasMeter` interface * (baseapp, types) [\#9390](https://github.com/cosmos/cosmos-sdk/pull/9390) Add current block header hash to `Context` * (x/staking) [\#9423](https://github.com/cosmos/cosmos-sdk/pull/9423) Staking delegations now returns empty list instead of rpc error when no records found. diff --git a/x/params/simulation/operations.go b/x/params/simulation/operations.go index a5097968ce..6e7619b703 100644 --- a/x/params/simulation/operations.go +++ b/x/params/simulation/operations.go @@ -1,6 +1,7 @@ package simulation import ( + "fmt" "math/rand" sdk "github.com/cosmos/cosmos-sdk/types" @@ -8,44 +9,45 @@ import ( "github.com/cosmos/cosmos-sdk/x/params/types/proposal" ) +func min(a int, b int) int { + if a <= b { + return a + } + return b +} + // SimulateParamChangeProposalContent returns random parameter change content. // It will generate a ParameterChangeProposal object with anywhere between 1 and // the total amount of defined parameters changes, all of which have random valid values. func SimulateParamChangeProposalContent(paramChangePool []simulation.ParamChange) simulation.ContentSimulatorFn { + numProposals := 0 + // Bound the maximum number of simultaneous parameter changes + maxSimultaneousParamChanges := min(len(paramChangePool), 1000) + if maxSimultaneousParamChanges == 0 { + panic("param changes array is empty") + } + return func(r *rand.Rand, _ sdk.Context, _ []simulation.Account) simulation.Content { - - lenParamChange := len(paramChangePool) - if lenParamChange == 0 { - panic("param changes array is empty") - } - - numChanges := simulation.RandIntBetween(r, 1, lenParamChange) + numChanges := simulation.RandIntBetween(r, 1, maxSimultaneousParamChanges) paramChanges := make([]proposal.ParamChange, numChanges) - // map from key to empty struct; used only for look-up of the keys of the - // parameters that are already in the random set of changes. - paramChangesKeys := make(map[string]struct{}) + // perm here takes at most len(paramChangePool) calls to random + paramChoices := r.Perm(len(paramChangePool)) for i := 0; i < numChanges; i++ { - spc := paramChangePool[r.Intn(len(paramChangePool))] - - // do not include duplicate parameter changes for a given subspace/key - _, ok := paramChangesKeys[spc.ComposedKey()] - for ok { - spc = paramChangePool[r.Intn(len(paramChangePool))] - _, ok = paramChangesKeys[spc.ComposedKey()] - } - - // add a new distinct parameter to the set of changes and register the key - // to avoid further duplicates - paramChangesKeys[spc.ComposedKey()] = struct{}{} + spc := paramChangePool[paramChoices[i]] + // add a new distinct parameter to the set of changes paramChanges[i] = proposal.NewParamChange(spc.Subspace(), spc.Key(), spc.SimValue()(r)) } + title := fmt.Sprintf("title from SimulateParamChangeProposalContent-%d", numProposals) + desc := fmt.Sprintf("desc from SimulateParamChangeProposalContent-%d. Random short desc: %s", + numProposals, simulation.RandStringOfLength(r, 20)) + numProposals++ return proposal.NewParameterChangeProposal( - simulation.RandStringOfLength(r, 140), // title - simulation.RandStringOfLength(r, 5000), // description - paramChanges, // set of changes + title, // title + desc, // description + paramChanges, // set of changes ) } } diff --git a/x/params/simulation/operations_test.go b/x/params/simulation/operations_test.go index 54c90a6c2e..5ed1ba8a50 100644 --- a/x/params/simulation/operations_test.go +++ b/x/params/simulation/operations_test.go @@ -51,8 +51,8 @@ func TestSimulateParamChangeProposalContent(t *testing.T) { op := simulation.SimulateParamChangeProposalContent(paramChangePool) content := op(r, ctx, accounts) - require.Equal(t, "BrTEdFUqHtDtDBPzlahrrStzkUNxImpptHBIFDQfnxaTiOBJUgNzvqHbVcVJYlIFWFlzFqqRTTyFzDUMntPzyRamUFqeJAEaSHIuUHZoTWDjWXsYxYvwXwXZEsjRQKgKMselyUqWXMbHzRNDHnMzhWSirUgVggjiBxtWDfhzPDgrorEoNmDEiDdBldYegphCBTYWrmFFXNjxhtygsGBFHTejaKjMsqNdikEzDalEyWRHfJhKqifCKsedVuuJbQMbmRVuIPDluAWGpngjgBjOxuRFwSadayHNIhVVmNWBbfaTOldclxTTLUMvaBnLfwjHTtsKetEIvgrxLijhKJNablmvqpWIWsmhWQAYNLycREypoASHnyKWrxpoNLBJuyCGysZJgXbQAAmSIbGxMFXuwMVGZgBiZWfPWorAfjBeekCFvljHAtVZaTOsRxbPIioNxLTnWUTzGTvaNhplQQPmMADRRDuUIsiBpnGqPheKmLnopieVseFdTSAvOCacxaqFWFuXzsrVZzlGfeRpClwKuGEBujaPrzSLjVIOMvLlWxuznEOXlxbZroBRVEvEfBBAHOECribZNrYiFnzQqQmBnLksmFNAadusWAGltuqYNntgOlgOGwSdDjWdLboWyAWIcCfmpGJTfbljKPriLehwObuszICkaXNUkmeddeeRulbZBXJVLgteiKIfofGdNBregwUPlINQECatDSNXSIuefyMxxoKfcmjHEwbVtFiXtEnLJkLHUghmzFiymrgBChucZgOQUpGGVQEpRtIQjIBxYhtZPgUORdxXNWUMErWrUeriqYJPcgIDgLMWAyuuQnsHncCtjvHmvFbzYErxeunQllYDUVlXaRBveRUKeXwEGJFTSAqZtaBSDGDtzlADCnGjuTmYMJlapRsWfugmjwKEuoXJVpZvlcHeFvVvRRktRVGwzLfKezPEMABZtbLExQIjynSoahmkmoTHefdzFoBHMcQHFkKVHhpNtudPqJrYuQswzFuFHbSmpNltFnYJpvMrAYHFrNouZaanEUGHvbHIUUFTCtZrcpRHwgjblxlDNJWzHdBNpAXKJPHWQdrGYcAHSctgVlqwqHoLfHsXUdStwfefwzqLuKEhmMyYLdbZrcPgYqjNHxPexsruwEGStAneKbWkQDDIlCWBLSiAASNhZqNFlPtfqPJoxKsgMdzjWqLWdqKQuJqWPMvwPQWZUtVMOTMYKJbfdlZsjdsomuScvDmbDkgRualsxDvRJuCAmPOXitIbcyWsKGSdrEunFAOdmXnsuyFVgJqEjbklvmwrUlsxjRSfKZxGcpayDdgoFcnVSutxjRgOSFzPwidAjubMncNweqpbxhXGchpZUxuFDOt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sifauoMnJPLTcDHmilcmahlqOELaAUYDBuzsVywnDQfwRLGIWozYaOAilMBcObErwgTDNGWnwQMUgFFSKtPDMEoEQCTKVREqrXZSGLqwTMcxHfWotDllNkIJPMbXzjDVjPOOjCFuIvTyhXKLyhUScOXvYthRXpPfKwMhptXaxIxgqBoUqzrWbaoLTVpQoottZyPFfNOoMioXHRuFwMRYUiKvcWPkrayyTLOCFJlAyslDameIuqVAuxErqFPEWIScKpBORIuZqoXlZuTvAjEdlEWDODFRregDTqGNoFBIHxvimmIZwLfFyKUfEWAnNBdtdzDmT", content.GetDescription()) - require.Equal(t, "tpHRGdIbuucfTjOygZsTxPjfweXhSUkMhPjMaxKlMIJMOXcnQfyzeOcbWwNbeHVIkPZBSpYuLyYggwexjxusrBqDOTtGTOWeLrQKjLxzIivHSlcxgdXhhuTSkuxKGLwQvuyNhYFmBZHe", content.GetTitle()) + require.Equal(t, "desc from SimulateParamChangeProposalContent-0. Random short desc: IivHSlcxgdXhhuTSkuxK", content.GetDescription()) + require.Equal(t, "title from SimulateParamChangeProposalContent-0", content.GetTitle()) require.Equal(t, "params", content.ProposalRoute()) require.Equal(t, "ParameterChange", content.ProposalType()) @@ -60,6 +60,6 @@ func TestSimulateParamChangeProposalContent(t *testing.T) { require.True(t, ok) require.Equal(t, "test-Key2", pcp.Changes[0].GetKey()) - require.Equal(t, "test-value 2610 ", pcp.Changes[0].GetValue()) + require.Equal(t, "test-value 2791 ", pcp.Changes[0].GetValue()) require.Equal(t, "test-Subspace2", pcp.Changes[0].GetSubspace()) } diff --git a/x/params/simulation/proposals_test.go b/x/params/simulation/proposals_test.go index e89bb668a4..2902cb08aa 100644 --- a/x/params/simulation/proposals_test.go +++ b/x/params/simulation/proposals_test.go @@ -36,8 +36,8 @@ func TestProposalContents(t *testing.T) { content := w0.ContentSimulatorFn()(r, ctx, accounts) - require.Equal(t, "BrTEdFUqHtDtDBPzlahrrStzkUNxImpptHBIFDQfnxaTiOBJUgNzvqHbVcVJYlIFWFlzFqqRTTyFzDUMntPzyRamUFqeJAEaSHIuUHZoTWDjWXsYxYvwXwXZEsjRQKgKMselyUqWXMbHzRNDHnMzhWSirUgVggjiBxtWDfhzPDgrorEoNmDEiDdBldYegphCBTYWrmFFXNjxhtygsGBFHTejaKjMsqNdikEzDalEyWRHfJhKqifCKsedVuuJbQMbmRVuIPDluAWGpngjgBjOxuRFwSadayHNIhVVmNWBbfaTOldclxTTLUMvaBnLfwjHTtsKetEIvgrxLijhKJNablmvqpWIWsmhWQAYNLycREypoASHnyKWrxpoNLBJuyCGysZJgXbQAAmSIbGxMFXuwMVGZgBiZWfPWorAfjBeekCFvljHAtVZaTOsRxbPIioNxLTnWUTzGTvaNhplQQPmMADRRDuUIsiBpnGqPheKmLnopieVseFdTSAvOCacxaqFWFuXzsrVZzlGfeRpClwKuGEBujaPrzSLjVIOMvLlWxuznEOXlxbZroBRVEvEfBBAHOECribZNrYiFnzQqQmBnLksmFNAadusWAGltuqYNntgOlgOGwSdDjWdLboWyAWIcCfmpGJTfbljKPriLehwObuszICkaXNUkmeddeeRulbZBXJVLgteiKIfofGdNBregwUPlINQECatDSNXSIuefyMxxoKfcmjHEwbVtFiXtEnLJkLHUghmzFiymrgBChucZgOQUpGGVQEpRtIQjIBxYhtZPgUORdxXNWUMErWrUeriqYJPcgIDgLMWAyuuQnsHncCtjvHmvFbzYErxeunQllYDUVlXaRBveRUKeXwEGJFTSAqZtaBSDGDtzlADCnGjuTmYMJlapRsWfugmjwKEuoXJVpZvlcHeFvVvRRktRVGwzLfKezPEMABZtbLExQIjynSoahmkmoTHefdzFoBHMcQHFkKVHhpNtudPqJrYuQswzFuFHbSmpNltFnYJpvMrAYHFrNouZaanEUGHvbHIUUFTCtZrcpRHwgjblxlDNJWzHdBNpAXKJPHWQdrGYcAHSctgVlqwqHoLfHsXUdStwfefwzqLuKEhmMyYLdbZrcPgYqjNHxPexsruwEGStAneKbWkQDDIlCWBLSiAASNhZqNFlPtfqPJoxKsgMdzjWqLW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JVyhwPllQpuYLRYvGodxKjkarnSNgsXoKEMlaSKxKdcVgvOkuLcfLFfdtXGTclqfPOfeoVLbqcjcXCUEBgAGplrkgsmIEhWRZLlGPGCwKWRaCKMkBHTAcypUrYjWwCLtOPVygMwMANGoQwFnCqFrUGMCRZUGJKTZIGPyldsifauoMnJPLTcDHmilcmahlqOELaAUYDBuzsVywnDQfwRLGIWozYaOAilMBcObErwgTDNGWnwQMUgFFSKtPDMEoEQCTKVREqrXZSGLqwTMcxHfWotDllNkIJPMbXzjDVjPOOjCFuIvTyhXKLyhUScOXvYthRXpPfKwMhptXaxIxgqBoUqzrWbaoLTVpQoottZyPFfNOoMioXHRuFwMRYUiKvcWPkrayyTLOCFJlAyslDameIuqVAuxErqFPEWIScKpBORIuZqoXlZuTvAjEdlEWDODFRregDTqGNoFBIHxvimmIZwLfFyKUfEWAnNBdtdzDmT", content.GetDescription()) - require.Equal(t, "tpHRGdIbuucfTjOygZsTxPjfweXhSUkMhPjMaxKlMIJMOXcnQfyzeOcbWwNbeHVIkPZBSpYuLyYggwexjxusrBqDOTtGTOWeLrQKjLxzIivHSlcxgdXhhuTSkuxKGLwQvuyNhYFmBZHe", content.GetTitle()) + require.Equal(t, "desc from SimulateParamChangeProposalContent-0. Random short desc: IivHSlcxgdXhhuTSkuxK", content.GetDescription()) + require.Equal(t, "title from SimulateParamChangeProposalContent-0", content.GetTitle()) require.Equal(t, "params", content.ProposalRoute()) require.Equal(t, "ParameterChange", content.ProposalType()) @@ -46,6 +46,6 @@ func TestProposalContents(t *testing.T) { require.Len(t, pcp.Changes, 1) require.Equal(t, "test-Key2", pcp.Changes[0].GetKey()) - require.Equal(t, "test-value 2610 ", pcp.Changes[0].GetValue()) + require.Equal(t, "test-value 2791 ", pcp.Changes[0].GetValue()) require.Equal(t, "test-Subspace2", pcp.Changes[0].GetSubspace()) } diff --git a/x/simulation/params.go b/x/simulation/params.go index e11e9764bc..51dfb6439f 100644 --- a/x/simulation/params.go +++ b/x/simulation/params.go @@ -119,7 +119,7 @@ func NewSimParamChange(subspace, key string, simVal simulation.SimValFn) simulat // ComposedKey creates a new composed key for the param change proposal func (spc ParamChange) ComposedKey() string { - return fmt.Sprintf("%s/%s", spc.Subspace(), spc.Key()) + return spc.Subspace() + "/" + spc.Key() } // Proposal Contents From 17ba2eb7ca6d86f60ed945148c2b495255e4e90f Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Thu, 17 Jun 2021 13:27:32 +0200 Subject: [PATCH 12/50] perf: MsgTypeUrl optimization (#9530) ## Description Tiny optimization: no need to do string formatting to prefix a string with one character. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [x] added a changelog entry to `CHANGELOG.md` - [x] included comments for [documenting Go code](https://blog.golang.org/godoc) - [x] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- types/tx_msg.go | 4 +--- types/tx_msg_test.go | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/types/tx_msg.go b/types/tx_msg.go index d7f15e83f0..42d01fdc55 100644 --- a/types/tx_msg.go +++ b/types/tx_msg.go @@ -1,8 +1,6 @@ package types import ( - fmt "fmt" - "github.com/gogo/protobuf/proto" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" @@ -79,5 +77,5 @@ type TxEncoder func(tx Tx) ([]byte, error) // MsgTypeURL returns the TypeURL of a `sdk.Msg`. func MsgTypeURL(msg Msg) string { - return fmt.Sprintf("/%s", proto.MessageName(msg)) + return "/" + proto.MessageName(msg) } diff --git a/types/tx_msg_test.go b/types/tx_msg_test.go index 7a55c7d63e..bf7763b029 100644 --- a/types/tx_msg_test.go +++ b/types/tx_msg_test.go @@ -29,3 +29,7 @@ func (s *testMsgSuite) TestMsg() { s.Require().Nil(msg.ValidateBasic()) s.Require().NotPanics(func() { msg.GetSignBytes() }) } + +func (s *testMsgSuite) TestMsgTypeURL() { + s.Require().Equal("/testdata.TestMsg", sdk.MsgTypeURL(new(testdata.TestMsg))) +} From 0e64fa77d1173b485421e0dd4d4e95af462cef96 Mon Sep 17 00:00:00 2001 From: likhita-809 <78951027+likhita-809@users.noreply.github.com> Date: Thu, 17 Jun 2021 20:34:33 +0530 Subject: [PATCH 13/50] docs: Add docs for setting store loader (#9526) ## Description Closes: #9503 Add documentation for setting StoreLoader as part of in-place store migration. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct `docs:` prefix in the PR title - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [ ] followed the [documentation writing guidelines](https://github.com/cosmos/cosmos-sdk/blob/master/docs/DOC_WRITING_GUIDELINES.md) - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [x] confirmed the correct `docs:` prefix in the PR title - [ ] confirmed all author checklist items have been addressed - [x] confirmed that this PR only changes documentation - [x] reviewed content for consistency - [x] reviewed content for thoroughness - [x] reviewed content for spelling and grammar - [ ] tested instructions (if applicable) --- docs/building-modules/upgrade.md | 2 +- docs/core/upgrade.md | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/docs/building-modules/upgrade.md b/docs/building-modules/upgrade.md index 53864fa58b..2f9eaa98f3 100644 --- a/docs/building-modules/upgrade.md +++ b/docs/building-modules/upgrade.md @@ -8,7 +8,7 @@ In-place store migrations allow your modules to upgrade to new versions that inc ## Prerequisite Readings -- [In-Place Store Migration](../core-concepts/upgrade.md) {prereq} +- [In-Place Store Migration](../core/upgrade.md) {prereq} ## Consensus Version diff --git a/docs/core/upgrade.md b/docs/core/upgrade.md index 4e48e10b9d..c37d813871 100644 --- a/docs/core/upgrade.md +++ b/docs/core/upgrade.md @@ -82,6 +82,29 @@ To learn more about configuring migration scripts for your modules, see the [Mig You can introduce entirely new modules to the application during an upgrade. New modules are recognized because they have not yet been registered in `x/upgrade`'s `VersionMap` store. In this case, `RunMigrations` calls the `InitGenesis` function from the corresponding module to set up its initial state. +### Add StoreUpgrades for New Modules + +All chains preparing to run in-place store migrations will need to manually add store upgrades for new modules and then configure the store loader to apply those upgrades. This ensures that the new module's stores are added to the multistore before the migrations begin. + +```golang +upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() +if err != nil { + panic(err) +} + +if upgradeInfo.Name == "my-plan" && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { + storeUpgrades := storetypes.StoreUpgrades{ + // add store upgrades for new modules + // Example: + // Added: []string{"foo", "bar"}, + // ... + } + + // configure store loader that checks if version == upgradeHeight and applies store upgrades + app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) +} +``` + ## Overwriting Genesis Functions The Cosmos SDK offers modules that the application developer can import in their app. These modules often have an `InitGenesis` function already defined. From 0ae07fe69cf2fd48b10ebb554516f9fa8294bb81 Mon Sep 17 00:00:00 2001 From: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> Date: Thu, 17 Jun 2021 18:50:37 -0700 Subject: [PATCH 14/50] fix: duplicate vesting and format (#9535) ## Description This pull request fixes the duplicate `vesting` command displayed with `--help` for the `tx` command. It also removes line breaks for consistent formatting across all commands and it fixes a minor typo. ## Manual Test ``` make build ``` ``` ./build/simd tx -h ``` ``` ./build/simd tx vesting -h ``` --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] added `!` to the type prefix if API or client breaking change - *n/a* - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - *n/a* - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - *n/a* - [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [x] added a changelog entry to `CHANGELOG.md` - [x] included comments for [documenting Go code](https://blog.golang.org/godoc) - [x] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [x] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- client/keys/root.go | 1 - client/keys/root_test.go | 2 +- server/util.go | 2 -- simapp/simd/cmd/root.go | 4 ---- x/auth/client/cli/decode.go | 2 +- 5 files changed, 2 insertions(+), 9 deletions(-) diff --git a/client/keys/root.go b/client/keys/root.go index 92c78c3abe..938a0d53a1 100644 --- a/client/keys/root.go +++ b/client/keys/root.go @@ -44,7 +44,6 @@ The pass backend requires GnuPG: https://gnupg.org/ ImportKeyCommand(), ListKeysCmd(), ShowKeysCmd(), - flags.LineBreak, DeleteKeyCommand(), ParseKeyStringCommand(), MigrateCommand(), diff --git a/client/keys/root_test.go b/client/keys/root_test.go index f66ae9265d..b6c2f5f88f 100644 --- a/client/keys/root_test.go +++ b/client/keys/root_test.go @@ -11,5 +11,5 @@ func TestCommands(t *testing.T) { assert.NotNil(t, rootCommands) // Commands are registered - assert.Equal(t, 10, len(rootCommands.Commands())) + assert.Equal(t, 9, len(rootCommands.Commands())) } diff --git a/server/util.go b/server/util.go index 68f1c48281..e39bb712c8 100644 --- a/server/util.go +++ b/server/util.go @@ -264,10 +264,8 @@ func AddCommands(rootCmd *cobra.Command, defaultNodeHome string, appCreator type rootCmd.AddCommand( startCmd, UnsafeResetAllCmd(), - flags.LineBreak, tendermintCmd, ExportCmd(appExport, defaultNodeHome), - flags.LineBreak, version.NewVersionCommand(), ) } diff --git a/simapp/simd/cmd/root.go b/simapp/simd/cmd/root.go index e37944f09d..bb736b61d6 100644 --- a/simapp/simd/cmd/root.go +++ b/simapp/simd/cmd/root.go @@ -28,7 +28,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" "github.com/cosmos/cosmos-sdk/x/auth/types" - vestingcli "github.com/cosmos/cosmos-sdk/x/auth/vesting/client/cli" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/crisis" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" @@ -151,12 +150,9 @@ func txCommand() *cobra.Command { authcmd.GetMultiSignCommand(), authcmd.GetMultiSignBatchCmd(), authcmd.GetValidateSignaturesCommand(), - flags.LineBreak, authcmd.GetBroadcastCommand(), authcmd.GetEncodeCommand(), authcmd.GetDecodeCommand(), - flags.LineBreak, - vestingcli.GetTxCmd(), ) simapp.ModuleBasics.AddTxCommands(cmd) diff --git a/x/auth/client/cli/decode.go b/x/auth/client/cli/decode.go index e1807efb09..6af5bb5c38 100644 --- a/x/auth/client/cli/decode.go +++ b/x/auth/client/cli/decode.go @@ -17,7 +17,7 @@ const flagHex = "hex" func GetDecodeCommand() *cobra.Command { cmd := &cobra.Command{ Use: "decode [amino-byte-string]", - Short: "Decode an binary encoded transaction string.", + Short: "Decode a binary encoded transaction string", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) (err error) { clientCtx := client.GetClientContextFromCmd(cmd) From e4673ad552a4d50f5e2026948b025abcede449cd Mon Sep 17 00:00:00 2001 From: Marko Date: Fri, 18 Jun 2021 12:41:28 +0000 Subject: [PATCH 15/50] build(deps): tendermint version (#9541) * bump tendermint version * go mod tidy --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 5fe07df594..9afe37fcbd 100644 --- a/go.mod +++ b/go.mod @@ -44,7 +44,7 @@ require ( github.com/tendermint/btcd v0.1.1 github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 github.com/tendermint/go-amino v0.16.0 - github.com/tendermint/tendermint v0.34.10 + github.com/tendermint/tendermint v0.34.11 github.com/tendermint/tm-db v0.6.4 golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c diff --git a/go.sum b/go.sum index 12f4306206..aaa9d8d323 100644 --- a/go.sum +++ b/go.sum @@ -750,8 +750,9 @@ github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoM github.com/tendermint/tendermint v0.34.0-rc4/go.mod h1:yotsojf2C1QBOw4dZrTcxbyxmPUrT4hNuOQWX9XUwB4= github.com/tendermint/tendermint v0.34.0-rc6/go.mod h1:ugzyZO5foutZImv0Iyx/gOFCX6mjJTgbLHTwi17VDVg= github.com/tendermint/tendermint v0.34.0/go.mod h1:Aj3PIipBFSNO21r+Lq3TtzQ+uKESxkbA3yo/INM4QwQ= -github.com/tendermint/tendermint v0.34.10 h1:wBOc/It8sh/pVH9np2V5fBvRmIyFN/bUrGPx+eAHexs= github.com/tendermint/tendermint v0.34.10/go.mod h1:aeHL7alPh4uTBIJQ8mgFEE8VwJLXI1VD3rVOmH2Mcy0= +github.com/tendermint/tendermint v0.34.11 h1:q1Yh76oG4QbS07xhmIJh5iAE0fYpJ8P8YKYtjnWfJRY= +github.com/tendermint/tendermint v0.34.11/go.mod h1:aeHL7alPh4uTBIJQ8mgFEE8VwJLXI1VD3rVOmH2Mcy0= github.com/tendermint/tm-db v0.6.2/go.mod h1:GYtQ67SUvATOcoY8/+x6ylk8Qo02BQyLrAs+yAcLvGI= github.com/tendermint/tm-db v0.6.3/go.mod h1:lfA1dL9/Y/Y8wwyPp2NMLyn5P5Ptr/gvDFNWtrCWSf8= github.com/tendermint/tm-db v0.6.4 h1:3N2jlnYQkXNQclQwd/eKV/NzlqPlfK21cpRRIx80XXQ= From 105ad99a8ee2deeb136ab451cf21dd409390fbe2 Mon Sep 17 00:00:00 2001 From: Marko Date: Fri, 18 Jun 2021 12:56:55 +0000 Subject: [PATCH 16/50] feat: add cosmos-sdk Version (#9429) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Add CosmosSDKVersion to nodeInfo. closes: #9420 --- CHANGELOG.md | 1 + CONTRIBUTING.md | 3 +- client/grpc/tmservice/query.pb.go | 202 +++++++++++------- client/grpc/tmservice/service.go | 15 +- docs/core/proto-docs.md | 1 + .../base/tendermint/v1beta1/query.proto | 15 +- version/version.go | 46 ++-- version/version_test.go | 13 +- 8 files changed, 186 insertions(+), 110 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06289b0ccd..e0caf62412 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ if input key is empty, or input data contains empty key. * [\#9133](https://github.com/cosmos/cosmos-sdk/pull/9133) Added hooks for governance actions. * (x/staking) [\#9214](https://github.com/cosmos/cosmos-sdk/pull/9214) Added `new_shares` attribute inside `EventTypeDelegate` event. * [\#9382](https://github.com/cosmos/cosmos-sdk/pull/9382) feat: add Dec.Float64() function. +* [\#9429](https://github.com/cosmos/cosmos-sdk/pull/9429) Add `cosmos_sdk_version` to node_info * [\#9457](https://github.com/cosmos/cosmos-sdk/pull/9457) Add amino support for x/authz and x/feegrant Msgs. * [\#9498](https://github.com/cosmos/cosmos-sdk/pull/9498) Added `Codec: codec.Codec` attribute to `client/Context` structure. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5474de823c..788c58d6f6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -75,12 +75,13 @@ of how these are written refer to the current [ADRs](https://github.com/cosmos/c PRs should be categorically broken up based on the type of changes being made (i.e. `fix`, `feat`, `refactor`, `docs`, etc.). The *type* must be included in the PR title as a prefix (e.g. `fix: `). This ensures that all changes committed to the base branch follow the -[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. +[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. Additionally, each PR should only address a single issue. ### Pull Request Templates There are currently three PR templates. The [default template](./.github/PULL_REQUEST_TEMPLATE.md) is for types `fix`, `feat`, and `refactor`. We also have a [docs template](./.github/PULL_REQUEST_TEMPLATE/docs.md) for documentation changes and an [other template](./.github/PULL_REQUEST_TEMPLATE/other.md) for changes that do not affect production code. When previewing a PR before it has been opened, you can change the template by adding one of the following parameters to the url: + - `template=docs.md` - `template=other.md` diff --git a/client/grpc/tmservice/query.pb.go b/client/grpc/tmservice/query.pb.go index 8055c8c162..92b24cc324 100644 --- a/client/grpc/tmservice/query.pb.go +++ b/client/grpc/tmservice/query.pb.go @@ -688,13 +688,14 @@ func (m *GetNodeInfoResponse) GetApplicationVersion() *VersionInfo { // VersionInfo is the type for the GetNodeInfoResponse message. type VersionInfo struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - AppName string `protobuf:"bytes,2,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"` - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - GitCommit string `protobuf:"bytes,4,opt,name=git_commit,json=gitCommit,proto3" json:"git_commit,omitempty"` - BuildTags string `protobuf:"bytes,5,opt,name=build_tags,json=buildTags,proto3" json:"build_tags,omitempty"` - GoVersion string `protobuf:"bytes,6,opt,name=go_version,json=goVersion,proto3" json:"go_version,omitempty"` - BuildDeps []*Module `protobuf:"bytes,7,rep,name=build_deps,json=buildDeps,proto3" json:"build_deps,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + AppName string `protobuf:"bytes,2,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + GitCommit string `protobuf:"bytes,4,opt,name=git_commit,json=gitCommit,proto3" json:"git_commit,omitempty"` + BuildTags string `protobuf:"bytes,5,opt,name=build_tags,json=buildTags,proto3" json:"build_tags,omitempty"` + GoVersion string `protobuf:"bytes,6,opt,name=go_version,json=goVersion,proto3" json:"go_version,omitempty"` + BuildDeps []*Module `protobuf:"bytes,7,rep,name=build_deps,json=buildDeps,proto3" json:"build_deps,omitempty"` + CosmosSdkVersion string `protobuf:"bytes,8,opt,name=cosmos_sdk_version,json=cosmosSdkVersion,proto3" json:"cosmos_sdk_version,omitempty"` } func (m *VersionInfo) Reset() { *m = VersionInfo{} } @@ -779,6 +780,13 @@ func (m *VersionInfo) GetBuildDeps() []*Module { return nil } +func (m *VersionInfo) GetCosmosSdkVersion() string { + if m != nil { + return m.CosmosSdkVersion + } + return "" +} + // Module is the type for VersionInfo type Module struct { // module path @@ -866,74 +874,75 @@ func init() { } var fileDescriptor_40c93fb3ef485c5d = []byte{ - // 1060 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0x4f, 0x6f, 0xdc, 0x44, - 0x14, 0xaf, 0xb3, 0x6d, 0x36, 0x79, 0x8b, 0x20, 0x99, 0x84, 0xc6, 0xb1, 0xd2, 0x6d, 0xf0, 0xa1, - 0x4d, 0x88, 0x62, 0x6b, 0xb7, 0x6d, 0xda, 0x43, 0x29, 0x22, 0x04, 0xd2, 0xa8, 0xa5, 0x8a, 0x1c, - 0xc4, 0x01, 0x21, 0x59, 0xde, 0xf5, 0xc4, 0x19, 0x65, 0xd7, 0x33, 0xf5, 0x8c, 0x83, 0x56, 0xa8, - 0x02, 0x71, 0xe2, 0x88, 0xc4, 0x57, 0xe8, 0x85, 0x2f, 0xc0, 0x11, 0x71, 0xe4, 0x58, 0x81, 0x84, - 0x2a, 0x4e, 0x28, 0xe1, 0x53, 0x70, 0x42, 0x9e, 0x19, 0xef, 0xda, 0x4d, 0xd2, 0xdd, 0xcd, 0x01, - 0x89, 0x93, 0x67, 0xde, 0xbf, 0xf9, 0xfd, 0xde, 0xbc, 0xf7, 0x3c, 0xf0, 0x6e, 0x9b, 0xf2, 0x2e, - 0xe5, 0x6e, 0x2b, 0xe0, 0xd8, 0x15, 0x38, 0x0e, 0x71, 0xd2, 0x25, 0xb1, 0x70, 0x8f, 0x1a, 0x2d, - 0x2c, 0x82, 0x86, 0xfb, 0x34, 0xc5, 0x49, 0xcf, 0x61, 0x09, 0x15, 0x14, 0xd5, 0x95, 0xad, 0x93, - 0xd9, 0x3a, 0x03, 0x5b, 0x47, 0xdb, 0x5a, 0xf3, 0x11, 0x8d, 0xa8, 0x34, 0x75, 0xb3, 0x95, 0xf2, - 0xb2, 0x16, 0x23, 0x4a, 0xa3, 0x0e, 0x76, 0xe5, 0xae, 0x95, 0xee, 0xbb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, 0x97, 0xb8, 0xe6, 0x60, 0x76, 0x1b, - 0x8b, 0xbd, 0x5e, 0xdc, 0x26, 0x71, 0x94, 0x63, 0x72, 0x00, 0x15, 0x85, 0x1a, 0x8f, 0x09, 0x55, - 0xae, 0x44, 0x12, 0xce, 0x94, 0x97, 0x6f, 0xed, 0x79, 0x69, 0xff, 0x84, 0x86, 0x78, 0x27, 0xde, - 0xa7, 0x79, 0x94, 0x5f, 0x0c, 0x98, 0x2b, 0x89, 0x75, 0x9c, 0x47, 0x30, 0x1b, 0xe2, 0xfd, 0x20, - 0xed, 0x08, 0x3f, 0xa6, 0x21, 0xf6, 0x49, 0xbc, 0x4f, 0x35, 0xc1, 0xeb, 0x45, 0xb4, 0xac, 0xc9, - 0x9c, 0x2d, 0x65, 0xd8, 0x8f, 0xf1, 0x56, 0x58, 0x16, 0xa0, 0x2f, 0x60, 0x2e, 0x60, 0xac, 0x43, - 0xda, 0xb2, 0x82, 0xfd, 0x23, 0x9c, 0xf0, 0xc1, 0x7c, 0x5c, 0x1b, 0xda, 0x4f, 0xca, 0x5c, 0x86, - 0x46, 0x85, 0x38, 0x5a, 0x6e, 0xff, 0x63, 0x40, 0xad, 0x60, 0x83, 0x10, 0x5c, 0x8e, 0x83, 0x2e, - 0xd6, 0xfd, 0x20, 0xd7, 0x68, 0x11, 0xa6, 0x02, 0xc6, 0x7c, 0x29, 0x9f, 0xd0, 0x7d, 0xc2, 0xd8, - 0x93, 0x4c, 0x65, 0x42, 0x35, 0x07, 0x54, 0x51, 0x1a, 0xbd, 0x45, 0xd7, 0x00, 0x22, 0x22, 0xfc, - 0x36, 0xed, 0x76, 0x89, 0x90, 0x85, 0x3e, 0xed, 0x4d, 0x47, 0x44, 0x7c, 0x28, 0x05, 0x99, 0xba, - 0x95, 0x92, 0x4e, 0xe8, 0x8b, 0x20, 0xe2, 0xe6, 0x15, 0xa5, 0x96, 0x92, 0x4f, 0x83, 0x88, 0x4b, - 0x6f, 0xda, 0xe7, 0x3a, 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 0x1b, 0xc8, 0x1d, 0x11, 0xfe, - 0x57, 0xea, 0xaf, 0xf2, 0x0c, 0xfd, 0x66, 0x14, 0xc6, 0x7a, 0xf1, 0x25, 0x80, 0xee, 0x8f, 0x9c, - 0xc9, 0x33, 0x5e, 0x2a, 0xd6, 0x7b, 0x17, 0xf4, 0xd6, 0x7c, 0xee, 0x4b, 0x3e, 0x1b, 0xe8, 0xf6, - 0x30, 0x3e, 0x83, 0x47, 0x04, 0x16, 0xfd, 0x5b, 0xf9, 0xd3, 0x90, 0xff, 0xd7, 0xb3, 0x5e, 0x88, - 0xe8, 0xc1, 0x08, 0xc0, 0x5e, 0xf3, 0xba, 0xb5, 0xde, 0xbf, 0xb0, 0xbf, 0xa6, 0xf6, 0x40, 0x52, - 0xbb, 0x87, 0x36, 0xc6, 0xa3, 0x96, 0xdf, 0xd8, 0xe6, 0xe3, 0x5f, 0x8f, 0xeb, 0xc6, 0x8b, 0xe3, - 0xba, 0xf1, 0xd7, 0x71, 0xdd, 0xf8, 0xfe, 0xa4, 0x7e, 0xe9, 0xc5, 0x49, 0xfd, 0xd2, 0xcb, 0x93, - 0xfa, 0xa5, 0xcf, 0x9b, 0x11, 0x11, 0x07, 0x69, 0xcb, 0x69, 0xd3, 0x6e, 0x1e, 0x5b, 0x7d, 0xd6, - 0x79, 0x78, 0xe8, 0xb6, 0x3b, 0x04, 0xc7, 0xc2, 0x8d, 0x12, 0xd6, 0x76, 0x45, 0x97, 0xab, 0x61, - 0xd6, 0x9a, 0x94, 0xef, 0x9d, 0x5b, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x08, 0x32, 0x9c, 0x36, - 0xf7, 0x0c, 0x00, 0x00, + // 1081 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0x4d, 0x6f, 0xdc, 0x44, + 0x18, 0x8e, 0x77, 0xdb, 0x6c, 0xf2, 0x2e, 0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, 0x3f, 0x8c, 0xdc, 0x4f, 0x20, 0xff, + 0x6e, 0x40, 0xf7, 0x46, 0x56, 0xf2, 0x8c, 0x77, 0x8d, 0xf5, 0xfe, 0x05, 0xb3, 0x35, 0x9f, 0x7b, + 0x92, 0xcf, 0x06, 0xba, 0x35, 0x8c, 0xcf, 0xe0, 0xc9, 0x81, 0x45, 0x7f, 0x57, 0xfe, 0x36, 0xe4, + 0xdf, 0xf8, 0xac, 0xf7, 0x24, 0xba, 0x3f, 0x02, 0xb0, 0x57, 0xbc, 0x85, 0xad, 0x0f, 0x2e, 0x9c, + 0xaf, 0xa9, 0xdd, 0x97, 0xd4, 0xee, 0xa2, 0x8d, 0xf1, 0xa8, 0x65, 0x3b, 0xb6, 0xf9, 0xe8, 0xf7, + 0xe3, 0x9a, 0xf1, 0xfc, 0xb8, 0x66, 0xfc, 0x73, 0x5c, 0x33, 0x7e, 0x38, 0xa9, 0x4d, 0x3c, 0x3f, + 0xa9, 0x4d, 0xbc, 0x38, 0xa9, 0x4d, 0x7c, 0xd1, 0x0c, 0x89, 0x38, 0x48, 0x5a, 0x76, 0x9b, 0x76, + 0xb3, 0xda, 0xea, 0xb3, 0xce, 0x83, 0x43, 0xa7, 0xdd, 0x21, 0x38, 0x12, 0x4e, 0x18, 0xb3, 0xb6, + 0x23, 0xba, 0x5c, 0x5d, 0x66, 0xad, 0x49, 0xf9, 0x3a, 0xba, 0xf9, 0x5f, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x9d, 0x37, 0x87, 0xe4, 0x25, 0x0d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1734,6 +1743,13 @@ func (m *VersionInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.CosmosSdkVersion) > 0 { + i -= len(m.CosmosSdkVersion) + copy(dAtA[i:], m.CosmosSdkVersion) + i = encodeVarintQuery(dAtA, i, uint64(len(m.CosmosSdkVersion))) + i-- + dAtA[i] = 0x42 + } if len(m.BuildDeps) > 0 { for iNdEx := len(m.BuildDeps) - 1; iNdEx >= 0; iNdEx-- { { @@ -2082,6 +2098,10 @@ func (m *VersionInfo) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) } } + l = len(m.CosmosSdkVersion) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -3647,6 +3667,38 @@ func (m *VersionInfo) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CosmosSdkVersion", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CosmosSdkVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) diff --git a/client/grpc/tmservice/service.go b/client/grpc/tmservice/service.go index a86f16c26b..cd6e7e5313 100644 --- a/client/grpc/tmservice/service.go +++ b/client/grpc/tmservice/service.go @@ -184,13 +184,14 @@ func (s queryServer) GetNodeInfo(ctx context.Context, req *GetNodeInfoRequest) ( resp := GetNodeInfoResponse{ DefaultNodeInfo: protoNodeInfo, ApplicationVersion: &VersionInfo{ - AppName: nodeInfo.AppName, - Name: nodeInfo.Name, - GitCommit: nodeInfo.GitCommit, - GoVersion: nodeInfo.GoVersion, - Version: nodeInfo.Version, - BuildTags: nodeInfo.BuildTags, - BuildDeps: deps, + AppName: nodeInfo.AppName, + Name: nodeInfo.Name, + GitCommit: nodeInfo.GitCommit, + GoVersion: nodeInfo.GoVersion, + Version: nodeInfo.Version, + BuildTags: nodeInfo.BuildTags, + BuildDeps: deps, + CosmosSdkVersion: nodeInfo.CosmosSdkVersion, }, } return &resp, nil diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index fe31a7f910..b5dc37dae6 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -3015,6 +3015,7 @@ VersionInfo is the type for the GetNodeInfoResponse message. | `build_tags` | [string](#string) | | | | `go_version` | [string](#string) | | | | `build_deps` | [Module](#cosmos.base.tendermint.v1beta1.Module) | repeated | | +| `cosmos_sdk_version` | [string](#string) | | | diff --git a/proto/cosmos/base/tendermint/v1beta1/query.proto b/proto/cosmos/base/tendermint/v1beta1/query.proto index 50cb5852cd..505d4131d9 100644 --- a/proto/cosmos/base/tendermint/v1beta1/query.proto +++ b/proto/cosmos/base/tendermint/v1beta1/query.proto @@ -116,13 +116,14 @@ message GetNodeInfoResponse { // VersionInfo is the type for the GetNodeInfoResponse message. message VersionInfo { - string name = 1; - string app_name = 2; - string version = 3; - string git_commit = 4; - string build_tags = 5; - string go_version = 6; - repeated Module build_deps = 7; + string name = 1; + string app_name = 2; + string version = 3; + string git_commit = 4; + string build_tags = 5; + string go_version = 6; + repeated Module build_deps = 7; + string cosmos_sdk_version = 8; } // Module is the type for VersionInfo diff --git a/version/version.go b/version/version.go index a179b37fe3..cfb37683f1 100644 --- a/version/version.go +++ b/version/version.go @@ -36,26 +36,44 @@ var ( BuildTags = "" ) +func getSDKVersion() string { + deps, ok := debug.ReadBuildInfo() + if !ok { + return "unable to read deps" + } + var sdkVersion string + for _, dep := range deps.Deps { + if dep.Path == "github.com/cosmos/cosmos-sdk" { + sdkVersion = dep.Version + } + } + + return sdkVersion +} + // Info defines the application version information. type Info struct { - Name string `json:"name" yaml:"name"` - AppName string `json:"server_name" yaml:"server_name"` - Version string `json:"version" yaml:"version"` - GitCommit string `json:"commit" yaml:"commit"` - BuildTags string `json:"build_tags" yaml:"build_tags"` - GoVersion string `json:"go" yaml:"go"` - BuildDeps []buildDep `json:"build_deps" yaml:"build_deps"` + Name string `json:"name" yaml:"name"` + AppName string `json:"server_name" yaml:"server_name"` + Version string `json:"version" yaml:"version"` + GitCommit string `json:"commit" yaml:"commit"` + BuildTags string `json:"build_tags" yaml:"build_tags"` + GoVersion string `json:"go" yaml:"go"` + BuildDeps []buildDep `json:"build_deps" yaml:"build_deps"` + CosmosSdkVersion string `json:"cosmos_sdk_version" yaml:"cosmos_sdk_version"` } func NewInfo() Info { + sdkVersion := getSDKVersion() return Info{ - Name: Name, - AppName: AppName, - Version: Version, - GitCommit: Commit, - BuildTags: BuildTags, - GoVersion: fmt.Sprintf("go version %s %s/%s", runtime.Version(), runtime.GOOS, runtime.GOARCH), - BuildDeps: depsFromBuildInfo(), + Name: Name, + AppName: AppName, + Version: Version, + GitCommit: Commit, + BuildTags: BuildTags, + GoVersion: fmt.Sprintf("go version %s %s/%s", runtime.Version(), runtime.GOOS, runtime.GOARCH), + BuildDeps: depsFromBuildInfo(), + CosmosSdkVersion: sdkVersion, } } diff --git a/version/version_test.go b/version/version_test.go index 87608cfdbb..ccfbf189d5 100644 --- a/version/version_test.go +++ b/version/version_test.go @@ -25,12 +25,13 @@ build tags: func TestInfo_String(t *testing.T) { info := version.Info{ - Name: "testapp", - AppName: "testappd", - Version: "1.0.0", - GitCommit: "1b78457135a4104bc3af97f20654d49e2ea87454", - BuildTags: "netgo,ledger", - GoVersion: "go version go1.14 linux/amd64", + Name: "testapp", + AppName: "testappd", + Version: "1.0.0", + GitCommit: "1b78457135a4104bc3af97f20654d49e2ea87454", + BuildTags: "netgo,ledger", + GoVersion: "go version go1.14 linux/amd64", + CosmosSdkVersion: "0.42.5", } want := `testapp: 1.0.0 git commit: 1b78457135a4104bc3af97f20654d49e2ea87454 From 6a5a2de798d4e61302783ae84ecfe2958c7088d5 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Fri, 18 Jun 2021 21:06:10 +0200 Subject: [PATCH 17/50] fix: collect all responses from authz/MsgExec (#9538) ## Description Closes: #9536 ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- docs/core/proto-docs.md | 2 +- proto/cosmos/authz/v1beta1/tx.proto | 2 +- x/authz/keeper/keeper.go | 14 ++-- x/authz/keeper/msg_server.go | 4 +- x/authz/tx.pb.go | 118 +++++++++++++--------------- 5 files changed, 67 insertions(+), 73 deletions(-) diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index b5dc37dae6..1f6a1dd02e 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -1308,7 +1308,7 @@ MsgExecResponse defines the Msg/MsgExecResponse response type. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `result` | [cosmos.base.abci.v1beta1.Result](#cosmos.base.abci.v1beta1.Result) | | | +| `results` | [bytes](#bytes) | repeated | | diff --git a/proto/cosmos/authz/v1beta1/tx.proto b/proto/cosmos/authz/v1beta1/tx.proto index ffff463409..dd68984e92 100644 --- a/proto/cosmos/authz/v1beta1/tx.proto +++ b/proto/cosmos/authz/v1beta1/tx.proto @@ -40,7 +40,7 @@ message MsgGrant { // MsgExecResponse defines the Msg/MsgExecResponse response type. message MsgExecResponse { - cosmos.base.abci.v1beta1.Result result = 1; + repeated bytes results = 1; } // MsgExec attempts to execute the provided messages using diff --git a/x/authz/keeper/keeper.go b/x/authz/keeper/keeper.go index 10d5160400..7d541c374b 100644 --- a/x/authz/keeper/keeper.go +++ b/x/authz/keeper/keeper.go @@ -72,10 +72,9 @@ func (k Keeper) update(ctx sdk.Context, grantee sdk.AccAddress, granter sdk.AccA // DispatchActions attempts to execute the provided messages via authorization // grants from the message signer to the grantee. -func (k Keeper) DispatchActions(ctx sdk.Context, grantee sdk.AccAddress, msgs []sdk.Msg) (*sdk.Result, error) { - var msgResult *sdk.Result - var err error - for _, msg := range msgs { +func (k Keeper) DispatchActions(ctx sdk.Context, grantee sdk.AccAddress, msgs []sdk.Msg) ([][]byte, error) { + var results = make([][]byte, len(msgs)) + for i, msg := range msgs { signers := msg.GetSigners() if len(signers) != 1 { return nil, sdkerrors.ErrInvalidRequest.Wrap("authorization can be given to msg with only one signer") @@ -103,19 +102,20 @@ func (k Keeper) DispatchActions(ctx sdk.Context, grantee sdk.AccAddress, msgs [] return nil, sdkerrors.ErrUnauthorized } } - handler := k.router.Handler(msg) + handler := k.router.Handler(msg) if handler == nil { return nil, sdkerrors.ErrUnknownRequest.Wrapf("unrecognized message route: %s", sdk.MsgTypeURL(msg)) } - msgResult, err = handler(ctx, msg) + msgResp, err := handler(ctx, msg) if err != nil { return nil, sdkerrors.Wrapf(err, "failed to execute message; message %v", msg) } + results[i] = msgResp.Data } - return msgResult, nil + return results, nil } // SaveGrant method grants the provided authorization to the grantee on the granter's account diff --git a/x/authz/keeper/msg_server.go b/x/authz/keeper/msg_server.go index 0d96599087..e13b29fbd4 100644 --- a/x/authz/keeper/msg_server.go +++ b/x/authz/keeper/msg_server.go @@ -70,9 +70,9 @@ func (k Keeper) Exec(goCtx context.Context, msg *authz.MsgExec) (*authz.MsgExecR if err != nil { return nil, err } - result, err := k.DispatchActions(ctx, grantee, msgs) + results, err := k.DispatchActions(ctx, grantee, msgs) if err != nil { return nil, err } - return &authz.MsgExecResponse{Result: result}, nil + return &authz.MsgExecResponse{Results: results}, nil } diff --git a/x/authz/tx.pb.go b/x/authz/tx.pb.go index cac4f3b3cc..9f75a19361 100644 --- a/x/authz/tx.pb.go +++ b/x/authz/tx.pb.go @@ -6,8 +6,8 @@ package authz import ( context "context" fmt "fmt" - types1 "github.com/cosmos/cosmos-sdk/codec/types" - types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" @@ -75,7 +75,7 @@ var xxx_messageInfo_MsgGrant proto.InternalMessageInfo // MsgExecResponse defines the Msg/MsgExecResponse response type. type MsgExecResponse struct { - Result *types.Result `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` + Results [][]byte `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` } func (m *MsgExecResponse) Reset() { *m = MsgExecResponse{} } @@ -119,7 +119,7 @@ type MsgExec struct { // Authorization Msg requests to execute. Each msg must implement Authorization interface // The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) // triple and validate it. - Msgs []*types1.Any `protobuf:"bytes,2,rep,name=msgs,proto3" json:"msgs,omitempty"` + Msgs []*types.Any `protobuf:"bytes,2,rep,name=msgs,proto3" json:"msgs,omitempty"` } func (m *MsgExec) Reset() { *m = MsgExec{} } @@ -282,39 +282,38 @@ func init() { func init() { proto.RegisterFile("cosmos/authz/v1beta1/tx.proto", fileDescriptor_3ceddab7d8589ad1) } var fileDescriptor_3ceddab7d8589ad1 = []byte{ - // 498 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0xcb, 0x6e, 0xd3, 0x40, - 0x14, 0xb5, 0x9b, 0x34, 0x25, 0x13, 0x24, 0xc0, 0x64, 0xe1, 0x1a, 0xea, 0x58, 0xe6, 0x95, 0x05, - 0x1d, 0xab, 0x61, 0x01, 0xdb, 0x46, 0x42, 0x48, 0x80, 0x85, 0x64, 0xc1, 0x86, 0x4d, 0x64, 0xa7, - 0xc3, 0xc4, 0x4a, 0xec, 0xb1, 0x7c, 0xc7, 0x25, 0xe9, 0x57, 0xf0, 0x31, 0x7c, 0x44, 0xc4, 0xaa, - 0x4b, 0x56, 0x08, 0x92, 0x9f, 0x60, 0x89, 0x3c, 0x8f, 0x50, 0x50, 0x5a, 0x24, 0x56, 0x99, 0x3b, - 0xe7, 0xe4, 0xdc, 0x73, 0xcf, 0xf5, 0xa0, 0x83, 0x31, 0x83, 0x8c, 0x41, 0x10, 0x57, 0x7c, 0x72, - 0x16, 0x9c, 0x1e, 0x25, 0x84, 0xc7, 0x47, 0x01, 0x9f, 0xe3, 0xa2, 0x64, 0x9c, 0x59, 0x5d, 0x09, - 0x63, 0x01, 0x63, 0x05, 0x3b, 0xfb, 0xf2, 0x76, 0x24, 0x38, 0x81, 0xa2, 0x88, 0xc2, 0xe9, 0x52, - 0x46, 0x99, 0xbc, 0xaf, 0x4f, 0xea, 0xb6, 0x47, 0x19, 0xa3, 0x33, 0x12, 0x88, 0x2a, 0xa9, 0x3e, - 0x04, 0x3c, 0xcd, 0x08, 0xf0, 0x38, 0x2b, 0x14, 0x61, 0xff, 0x6f, 0x42, 0x9c, 0x2f, 0x14, 0x74, - 0x4f, 0x39, 0x4c, 0x62, 0x20, 0x41, 0x9c, 0x8c,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, 0x9e, - 0x01, 0x1d, 0xf1, 0x45, 0x41, 0x46, 0x55, 0x39, 0x13, 0x91, 0xb6, 0x23, 0x94, 0x01, 0x7d, 0xbb, - 0x28, 0xc8, 0xbb, 0x72, 0xe6, 0xdf, 0x46, 0xb7, 0x36, 0x2d, 0x74, 0xdf, 0xc1, 0x4f, 0x13, 0x35, - 0x42, 0xa0, 0xd6, 0x1b, 0xb4, 0x2b, 0xf7, 0xe8, 0x6e, 0x5f, 0x82, 0x36, 0xec, 0x3c, 0xbc, 0x1a, - 0xdf, 0xec, 0xe3, 0x35, 0x6a, 0x8a, 0x48, 0x0f, 0x2e, 0xe5, 0xd7, 0xb0, 0xf3, 0xe0, 0x4a, 0x78, - 0xa3, 0x16, 0xa1, 0x96, 0xca, 0xa6, 0x77, 0xe9, 0x1f, 0x24, 0xc1, 0x79, 0xf4, 0x0f, 0x82, 0xd6, - 0x1c, 0x0e, 0x97, 0x3f, 0x5c, 0x63, 0xb9, 0x72, 0xcd, 0xf3, 0x95, 0x6b, 0x7e, 0x5f, 0xb9, 0xe6, - 0xa7, 0xb5, 0x6b, 0x9c, 0xaf, 0x5d, 0xe3, 0xeb, 0xda, 0x35, 0xde, 0xdf, 0xa7, 0x29, 0x9f, 0x54, - 0x09, 0x1e, 0xb3, 0x4c, 0xbd, 0x46, 0xf5, 0x73, 0x08, 0x27, 0xd3, 0x60, 0x2e, 0xdf, 0x41, 0xd2, - 0x12, 0x1f, 0xc0, 0x93, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x4a, 0xa9, 0xb0, 0x59, 0xf3, 0x03, - 0x00, 0x00, + // 487 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0xcf, 0x6e, 0xd3, 0x40, + 0x10, 0xc6, 0xb3, 0x4d, 0xda, 0x92, 0x6d, 0x25, 0xc0, 0xe4, 0xe0, 0x1a, 0xea, 0x58, 0xe6, 0x5f, + 0x24, 0xe8, 0x5a, 0x0d, 0x07, 0xce, 0x8d, 0x84, 0x90, 0x10, 0x16, 0x92, 0x05, 0x17, 0x2e, 0xd1, + 0x3a, 0x5d, 0x36, 0x56, 0x62, 0xaf, 0xe5, 0x59, 0x97, 0xa4, 0x4f, 0xc1, 0xc3, 0xf0, 0x10, 0x11, + 0xa7, 0x1e, 0x39, 0x21, 0x48, 0x5e, 0x82, 0x23, 0xf2, 0xee, 0x3a, 0x14, 0x94, 0x16, 0x89, 0x53, + 0x76, 0xe6, 0xfb, 0x65, 0xe6, 0xf3, 0xe7, 0x35, 0x3e, 0x1c, 0x09, 0x48, 0x05, 0x04, 0xb4, 0x94, + 0xe3, 0xf3, 0xe0, 0xec, 0x38, 0x66, 0x92, 0x1e, 0x07, 0x72, 0x46, 0xf2, 0x42, 0x48, 0x61, 0x75, + 0xb4, 0x4c, 0x94, 0x4c, 0x8c, 0xec, 0x1c, 0xe8, 0xee, 0x50, 0x31, 0x81, 0x41, 0x54, 0xe1, 0x74, + 0xb8, 0xe0, 0x42, 0xf7, 0xab, 0x93, 0xe9, 0x76, 0xb9, 0x10, 0x7c, 0xca, 0x02, 0x55, 0xc5, 0xe5, + 0x87, 0x40, 0x26, 0x29, 0x03, 0x49, 0xd3, 0xdc, 0x00, 0x07, 0x7f, 0x03, 0x34, 0x9b, 0x1b, 0xe9, + 0xbe, 0x71, 0x18, 0x53, 0x60, 0x01, 0x8d, 0x47, 0xc9, 0xda, 0x65, 0x55, 0x18, 0xc8, 0xdb, 0xf8, + 0x18, 0xda, 0xb5, 0x22, 0xfc, 0x8f, 0xf8, 0x46, 0x08, 0xfc, 0x65, 0x41, 0x33, 0x69, 0xd9, 0x78, + 0x97, 0x57, 0x07, 0x56, 0xd8, 0xc8, 0x43, 0xbd, 0x76, 0x54, 0x97, 0xbf, 0x15, 0x66, 0x6f, 0x5d, + 0x56, 0x98, 0xf5, 0x1c, 0x6f, 0xab, 0xa3, 0xdd, 0xf4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 0xaf, + 0x64, 0xe7, 0xe1, 0xb5, 0xf2, 0x7a, 0x5a, 0x84, 0x77, 0x4c, 0x36, 0xdd, 0x2b, 0xff, 0xa0, 0x01, + 0xe7, 0xf1, 0x3f, 0x80, 0x7a, 0xe6, 0x60, 0xb0, 0xf8, 0xe1, 0x36, 0x16, 0x4b, 0x17, 0x5d, 0x2c, + 0x5d, 0xf4, 0x7d, 0xe9, 0xa2, 0x4f, 0x2b, 0xb7, 0x71, 0xb1, 0x72, 0x1b, 0x5f, 0x57, 0x6e, 0xe3, + 0xfd, 0x03, 0x9e, 0xc8, 0x71, 0x19, 0x93, 0x91, 0x48, 0xcd, 0xd7, 0x66, 0x7e, 0x8e, 0xe0, 0x74, + 0x12, 0xcc, 0xf4, 0x3d, 0x8f, 0x77, 0xd4, 0x05, 0x78, 0xf6, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xe3, + 0x02, 0xf3, 0xbe, 0xd3, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -554,17 +553,14 @@ func (m *MsgExecResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.Result != nil { - { - size, err := m.Result.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) + if len(m.Results) > 0 { + for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Results[iNdEx]) + copy(dAtA[i:], m.Results[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Results[iNdEx]))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa } return len(dAtA) - i, nil } @@ -739,9 +735,11 @@ func (m *MsgExecResponse) Size() (n int) { } var l int _ = l - if m.Result != nil { - l = m.Result.Size() - n += 1 + l + sovTx(uint64(l)) + if len(m.Results) > 0 { + for _, b := range m.Results { + l = len(b) + n += 1 + l + sovTx(uint64(l)) + } } return n } @@ -988,9 +986,9 @@ func (m *MsgExecResponse) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1000,27 +998,23 @@ func (m *MsgExecResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Result == nil { - m.Result = &types.Result{} - } - if err := m.Result.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Results = append(m.Results, make([]byte, postIndex-iNdEx)) + copy(m.Results[len(m.Results)-1], dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1133,7 +1127,7 @@ func (m *MsgExec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Msgs = append(m.Msgs, &types1.Any{}) + m.Msgs = append(m.Msgs, &types.Any{}) if err := m.Msgs[len(m.Msgs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } From 304d0ff648bb30be82a4e4006dab05537a47895c Mon Sep 17 00:00:00 2001 From: vincent Date: Mon, 21 Jun 2021 18:40:56 +0800 Subject: [PATCH 18/50] fix: query txs command adds output flag (#9540) ## Description * `Query txs` command adds `output` flag, to make it consistent with other query commands. * Delete unused flag `keyring-backend`. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- CHANGELOG.md | 1 + x/auth/client/cli/query.go | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0caf62412..c5fc142f4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +* [\#9540](https://github.com/cosmos/cosmos-sdk/pull/9540) Add output flag for query txs command. * [\#9460](https://github.com/cosmos/cosmos-sdk/pull/9460) Fix lint error in `MigratePrefixAddress`. * [\#9428](https://github.com/cosmos/cosmos-sdk/pull/9428) Optimize bank InitGenesis. Removed bank keeper's `k.setBalances` and `k.clearBalances`. Added `k.initBalances`. * [\#9231](https://github.com/cosmos/cosmos-sdk/pull/9231) Remove redundant staking errors. diff --git a/x/auth/client/cli/query.go b/x/auth/client/cli/query.go index 9604959cbd..4db62a4433 100644 --- a/x/auth/client/cli/query.go +++ b/x/auth/client/cli/query.go @@ -198,8 +198,7 @@ $ %s query txs --%s 'message.sender=cosmos1...&message.action=withdraw_delegator }, } - cmd.Flags().StringP(flags.FlagNode, "n", "tcp://localhost:26657", "Node to connect to") - cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|kwallet|pass|test)") + flags.AddQueryFlagsToCmd(cmd) cmd.Flags().Int(flags.FlagPage, rest.DefaultPage, "Query a specific page of paginated results") cmd.Flags().Int(flags.FlagLimit, rest.DefaultLimit, "Query number of transactions results per page returned") cmd.Flags().String(flagEvents, "", fmt.Sprintf("list of transaction events in the form of %s", eventFormat)) From 0540ed2f06781c1b5ad04d298b3b1e19c20ac90f Mon Sep 17 00:00:00 2001 From: yihuang Date: Mon, 21 Jun 2021 20:48:15 +0800 Subject: [PATCH 19/50] fix: Dumping upgrade info interrupted by cosmovisor (#9384) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Solution: - dumping upgrade info before emit `UPGRADED NEEDED` log which will cause cosmovisor to kill chain process ## Description The problematic procedure: 1. chain process output UPGRADE NEEDED log 2. cosmovisor see the message and kill the chain binary 3. chain process dump upgrade info and panic itself the step 2 and 3 runs concurrently, so the dumping process can be interrupted by cosmovisor's terminate signal. The proposed solution is to dump upgrade info before emitting the log. there are two problematic situation: 1. the upgrade info file is created, but content is not written or flushed before killed, when the chain process restart, it'll panic because of json parsing error. 2. the upgrade info file is not created at all, when the chain process restart, the [store upgrades](https://github.com/crypto-org-chain/chain-main/blob/master/app/app.go#L436) are not activated, will cause app hash mismatch error later on. --- Before we can merge this PR, please make sure that all the following items have been checked off. If any of the checklist items are not applicable, please leave them but write a little note why. - [x] Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. - [x] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules/structure.md). - [ ] Wrote unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] Updated relevant documentation (`docs/`) or specification (`x//spec/`) - [ ] Added relevant `godoc` [comments](https://blog.golang.org/godoc-documenting-go-code). - [ ] Added a relevant changelog entry to the `Unreleased` section in `CHANGELOG.md` - [x] Re-reviewed `Files changed` in the Github PR explorer - [x] Review `Codecov Report` in the comment section below once CI passes --- x/upgrade/abci.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/x/upgrade/abci.go b/x/upgrade/abci.go index d346decb02..f78f776d31 100644 --- a/x/upgrade/abci.go +++ b/x/upgrade/abci.go @@ -40,10 +40,6 @@ func BeginBlocker(k keeper.Keeper, ctx sdk.Context, _ abci.RequestBeginBlock) { } if !k.HasHandler(plan.Name) { - upgradeMsg := BuildUpgradeNeededMsg(plan) - // We don't have an upgrade handler for this upgrade name, meaning this software is out of date so shutdown - ctx.Logger().Error(upgradeMsg) - // Write the upgrade info to disk. The UpgradeStoreLoader uses this info to perform or skip // store migrations. err := k.DumpUpgradeInfoToDisk(ctx.BlockHeight(), plan.Name) @@ -51,6 +47,10 @@ func BeginBlocker(k keeper.Keeper, ctx sdk.Context, _ abci.RequestBeginBlock) { panic(fmt.Errorf("unable to write upgrade info to filesystem: %s", err.Error())) } + upgradeMsg := BuildUpgradeNeededMsg(plan) + // We don't have an upgrade handler for this upgrade name, meaning this software is out of date so shutdown + ctx.Logger().Error(upgradeMsg) + panic(upgradeMsg) } // We have an upgrade handler for this upgrade name, so apply the upgrade From 81747b4a9ea33f8823b04478a7cbf772d2102d97 Mon Sep 17 00:00:00 2001 From: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Date: Mon, 21 Jun 2021 09:24:34 -0400 Subject: [PATCH 20/50] fix: set header hash every block (#9552) ## Description - Sets the header hash on every block (ref #9390). Previously was only set during initialization for `deliverState`. - Closes #9514 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed all author checklist items have been addressed - [ ] confirmed that this PR does not change production code --- CHANGELOG.md | 1 + baseapp/abci.go | 17 ++++++++++++++--- baseapp/baseapp_test.go | 6 +++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5fc142f4b..396b8821da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -149,6 +149,7 @@ if input key is empty, or input data contains empty key. ### Bug Fixes +* [\#9514](https://github.com/cosmos/cosmos-sdk/issues/9514) Fix panic when retrieving the `BlockGasMeter` on `(Re)CheckTx` mode. * [\#9454](https://github.com/cosmos/cosmos-sdk/pull/9454) Fix testnet command with --node-dir-prefix accepts `-` and change `node-dir-prefix token` to `testtoken`. * (x/gov) [\#8813](https://github.com/cosmos/cosmos-sdk/pull/8813) fix `GET /cosmos/gov/v1beta1/proposals/{proposal_id}/deposits` to include initial deposit * (gRPC) [\#8945](https://github.com/cosmos/cosmos-sdk/pull/8945) gRPC reflection now works correctly. diff --git a/baseapp/abci.go b/baseapp/abci.go index a5cff07c5a..3464a5d436 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -164,8 +164,7 @@ func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeg // by InitChain. Context is now updated with Header information. app.deliverState.ctx = app.deliverState.ctx. WithBlockHeader(req.Header). - WithBlockHeight(req.Header.Height). - WithHeaderHash(req.Hash) + WithBlockHeight(req.Header.Height) } // add block gas meter @@ -176,7 +175,19 @@ func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeg gasMeter = sdk.NewInfiniteGasMeter() } - app.deliverState.ctx = app.deliverState.ctx.WithBlockGasMeter(gasMeter) + // NOTE: header hash is not set in NewContext, so we manually set it here + + app.deliverState.ctx = app.deliverState.ctx. + WithBlockGasMeter(gasMeter). + WithHeaderHash(req.Hash) + + // we also set block gas meter to checkState in case the application needs to + // verify gas consumption during (Re)CheckTx + if app.checkState != nil { + app.checkState.ctx = app.checkState.ctx. + WithBlockGasMeter(gasMeter). + WithHeaderHash(req.Hash) + } if app.beginBlocker != nil { res = app.beginBlocker(app.deliverState.ctx, req) diff --git a/baseapp/baseapp_test.go b/baseapp/baseapp_test.go index 80d0f179ef..ff307b105f 100644 --- a/baseapp/baseapp_test.go +++ b/baseapp/baseapp_test.go @@ -950,7 +950,11 @@ func TestCheckTx(t *testing.T) { // If a block is committed, CheckTx state should be reset. header := tmproto.Header{Height: 1} - app.BeginBlock(abci.RequestBeginBlock{Header: header}) + app.BeginBlock(abci.RequestBeginBlock{Header: header, Hash: []byte("hash")}) + + require.NotNil(t, app.checkState.ctx.BlockGasMeter(), "block gas meter should have been set to checkState") + require.NotEmpty(t, app.checkState.ctx.HeaderHash()) + app.EndBlock(abci.RequestEndBlock{}) app.Commit() From 856cc5b0963a8c6b1250746d4cf795ec1d2722a0 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Tue, 22 Jun 2021 02:04:55 +0200 Subject: [PATCH 21/50] docs: use RFC 2119 keywords (#9532) ## Description Recently when discussing NFT standard we stumbled upon the proper use of keywards such as SHOULD, MAY etc ... Let's add them to our guidelines. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct `docs:` prefix in the PR title - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [x] followed the [documentation writing guidelines](https://github.com/cosmos/cosmos-sdk/blob/master/docs/DOC_WRITING_GUIDELINES.md) - [x] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [x] confirmed the correct `docs:` prefix in the PR title - [ ] confirmed all author checklist items have been addressed - [x] confirmed that this PR only changes documentation - [x] reviewed content for consistency - [x] reviewed content for thoroughness - [x] reviewed content for spelling and grammar - [ ] tested instructions (if applicable) --- docs/DOC_WRITING_GUIDELINES.md | 1 + docs/architecture/README.md | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/docs/DOC_WRITING_GUIDELINES.md b/docs/DOC_WRITING_GUIDELINES.md index 7547e720d9..424da301ff 100644 --- a/docs/DOC_WRITING_GUIDELINES.md +++ b/docs/DOC_WRITING_GUIDELINES.md @@ -8,6 +8,7 @@ + Don't abuse `code` format when writing in plain English. + Follow Google developer documentation [style guide](https://developers.google.com/style). + Check the meaning of words in Microsoft's [A-Z word list and term collections](https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/accessibility-terms) (use the search input!). ++ RFC keywords should be used in technical documents (uppercase) and we recommend to use them in user documentation (lowercase). The RFC keywords are: "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL. They are to be interpreted as described in [RFC 2119](https://datatracker.ietf.org/doc/html/rfc2119). ## Technical Writing Course diff --git a/docs/architecture/README.md b/docs/architecture/README.md index 44adb3f500..5455df9f85 100644 --- a/docs/architecture/README.md +++ b/docs/architecture/README.md @@ -36,6 +36,10 @@ If recorded decisions turned out to be lacking, convene a discussion, record the Read about the [PROCESS](./PROCESS.md). +#### Use RFC 2119 Keywords + +When writing ADRs, follow the same best practices for writing RFCs. When writing RFCs, key words are used to signify the requirements in the specification. These words are often capitalized: "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL. They are to be interpreted as described in [RFC 2119](https://datatracker.ietf.org/doc/html/rfc2119). + ## ADR Table of Contents ### Accepted From 5e564352ae770ec2bfb259b41f01d6cf73e7d46b Mon Sep 17 00:00:00 2001 From: Amaury <1293565+amaurym@users.noreply.github.com> Date: Tue, 22 Jun 2021 10:02:49 +0200 Subject: [PATCH 22/50] chore: Update CHANGELOG with 0.42.5 and 0.42.6 (#9558) ## Description 0.42.5 and 0.42.6 have both been released. This PR forward-ports the Changelog updates to master. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [x] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [x] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- CHANGELOG.md | 43 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 396b8821da..861a5f3c8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,11 +38,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [\#9540](https://github.com/cosmos/cosmos-sdk/pull/9540) Add output flag for query txs command. * [\#9460](https://github.com/cosmos/cosmos-sdk/pull/9460) Fix lint error in `MigratePrefixAddress`. -* [\#9428](https://github.com/cosmos/cosmos-sdk/pull/9428) Optimize bank InitGenesis. Removed bank keeper's `k.setBalances` and `k.clearBalances`. Added `k.initBalances`. * [\#9231](https://github.com/cosmos/cosmos-sdk/pull/9231) Remove redundant staking errors. * [\#9205](https://github.com/cosmos/cosmos-sdk/pull/9205) Improve readability in `abci` handleQueryP2P -* [\#9235](https://github.com/cosmos/cosmos-sdk/pull/9235) CreateMembershipProof/CreateNonMembershipProof now returns an error -if input key is empty, or input data contains empty key. * [\#9314](https://github.com/cosmos/cosmos-sdk/pull/9314) Update Rosetta SDK to upstream's latest release. ### Features @@ -57,7 +54,6 @@ if input key is empty, or input data contains empty key. * [\#9133](https://github.com/cosmos/cosmos-sdk/pull/9133) Added hooks for governance actions. * (x/staking) [\#9214](https://github.com/cosmos/cosmos-sdk/pull/9214) Added `new_shares` attribute inside `EventTypeDelegate` event. * [\#9382](https://github.com/cosmos/cosmos-sdk/pull/9382) feat: add Dec.Float64() function. -* [\#9429](https://github.com/cosmos/cosmos-sdk/pull/9429) Add `cosmos_sdk_version` to node_info * [\#9457](https://github.com/cosmos/cosmos-sdk/pull/9457) Add amino support for x/authz and x/feegrant Msgs. * [\#9498](https://github.com/cosmos/cosmos-sdk/pull/9498) Added `Codec: codec.Codec` attribute to `client/Context` structure. @@ -135,8 +131,6 @@ if input key is empty, or input data contains empty key. * (gRPC-Web) [\#9493](https://github.com/cosmos/cosmos-sdk/pull/9493) Add `EnableUnsafeCORS` flag to grpc-web config. * (x/params) [\#9481](https://github.com/cosmos/cosmos-sdk/issues/9481) Speedup simulator for parameter change proposals. -* (store) [\#9403](https://github.com/cosmos/cosmos-sdk/pull/9403) Add `RefundGas` function to `GasMeter` interface -* (baseapp, types) [\#9390](https://github.com/cosmos/cosmos-sdk/pull/9390) Add current block header hash to `Context` * (x/staking) [\#9423](https://github.com/cosmos/cosmos-sdk/pull/9423) Staking delegations now returns empty list instead of rpc error when no records found. * (x/bank) [\#8614](https://github.com/cosmos/cosmos-sdk/issues/8614) Add `Name` and `Symbol` fields to denom metadata * (x/auth) [\#8522](https://github.com/cosmos/cosmos-sdk/pull/8522) Allow to query all stored accounts @@ -149,7 +143,6 @@ if input key is empty, or input data contains empty key. ### Bug Fixes -* [\#9514](https://github.com/cosmos/cosmos-sdk/issues/9514) Fix panic when retrieving the `BlockGasMeter` on `(Re)CheckTx` mode. * [\#9454](https://github.com/cosmos/cosmos-sdk/pull/9454) Fix testnet command with --node-dir-prefix accepts `-` and change `node-dir-prefix token` to `testtoken`. * (x/gov) [\#8813](https://github.com/cosmos/cosmos-sdk/pull/8813) fix `GET /cosmos/gov/v1beta1/proposals/{proposal_id}/deposits` to include initial deposit * (gRPC) [\#8945](https://github.com/cosmos/cosmos-sdk/pull/8945) gRPC reflection now works correctly. @@ -164,6 +157,42 @@ if input key is empty, or input data contains empty key. * (grpc) [\#8926](https://github.com/cosmos/cosmos-sdk/pull/8926) The `tx` field in `SimulateRequest` has been deprecated, prefer to pass `tx_bytes` instead. * (sdk types) [\#9498](https://github.com/cosmos/cosmos-sdk/pull/9498) `clientContext.JSONCodec` will be removed in the next version. use `clientContext.Codec` instead. +## [v0.42.6](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.6) - 2021-06-18 + +### Improvements + +* [\#9428](https://github.com/cosmos/cosmos-sdk/pull/9428) Optimize bank InitGenesis. Added `k.initBalances`. +* [\#9429](https://github.com/cosmos/cosmos-sdk/pull/9429) Add `cosmos_sdk_version` to node_info +* [\#9541](https://github.com/cosmos/cosmos-sdk/pull/9541) Bump tendermint dependency to v0.34.11. + +### Bug Fixes + +* [\#9385](https://github.com/cosmos/cosmos-sdk/pull/9385) Fix IBC `query ibc client header` cli command. Support historical queries for query header/node-state commands. +* [\#9401](https://github.com/cosmos/cosmos-sdk/pull/9401) Fixes incorrect export of IBC identifier sequences. Previously, the next identifier sequence for clients/connections/channels was not set during genesis export. This resulted in the next identifiers being generated on the new chain to reuse old identifiers (the sequences began again from 0). +* [\#9408](https://github.com/cosmos/cosmos-sdk/pull/9408) Update simapp to use correct default broadcast mode. +* [\#9513](https://github.com/cosmos/cosmos-sdk/pull/9513) Fixes testnet CLI command. Testnet now updates the supply in genesis. Previously, when using add-genesis-account and testnet together, inconsistent genesis files would be produced, as only add-genesis-account was updating the supply. +* (x/gov) [\#8813](https://github.com/cosmos/cosmos-sdk/pull/8813) fix `GET /cosmos/gov/v1beta1/proposals/{proposal_id}/deposits` to include initial deposit + +### Features + +* [\#9383](https://github.com/cosmos/cosmos-sdk/pull/9383) New CLI command `query ibc-transfer escrow-address ` to get the escrow address for a channel; can be used to then query balance of escrowed tokens +* (baseapp, types) [#\9390](https://github.com/cosmos/cosmos-sdk/pull/9390) Add current block header hash to `Context` +* (store) [\#9403](https://github.com/cosmos/cosmos-sdk/pull/9403) Add `RefundGas` function to `GasMeter` interface + +## [v0.42.5](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.5) - 2021-05-18 + +### Bug Fixes + +* [\#9514](https://github.com/cosmos/cosmos-sdk/issues/9514) Fix panic when retrieving the `BlockGasMeter` on `(Re)CheckTx` mode. +* [\#9235](https://github.com/cosmos/cosmos-sdk/pull/9235) CreateMembershipProof/CreateNonMembershipProof now returns an error +if input key is empty, or input data contains empty key. +* [\#9108](https://github.com/cosmos/cosmos-sdk/pull/9108) Fixed the bug with querying multisig account, which is not showing threshold and public_keys. +* [\#9345](https://github.com/cosmos/cosmos-sdk/pull/9345) Fix ARM support. +* [\#9040](https://github.com/cosmos/cosmos-sdk/pull/9040) Fix ENV variables binding to CLI flags for client config. + +### Features + +* [\#8953](https://github.com/cosmos/cosmos-sdk/pull/8953) Add the `config` CLI subcommand back to the SDK, which saves client-side configuration in a `client.toml` file. ## [v0.42.4](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.4) - 2021-04-08 From d60cb3a49f73c8f51da80076d22d3553c5a8b20b Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Tue, 22 Jun 2021 14:41:56 +0200 Subject: [PATCH 23/50] test(bank): check that zero balances are deleted (#9559) ## Description Ref: zero balance check for v0.43 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [x] included comments for [documenting Go code](https://blog.golang.org/godoc) - [x] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- x/bank/keeper/keeper_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index cd2f83d776..f9074f423e 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -443,6 +443,15 @@ func (suite *IntegrationTestSuite) TestSendCoins() { acc2Balances := app.BankKeeper.GetAllBalances(ctx, addr2) expected = sdk.NewCoins(newFooCoin(150), newBarCoin(75)) suite.Require().Equal(expected, acc2Balances) + + // we sent all foo coins to acc2, so foo balance should be deleted for acc1 and bar should be still there + var coins []sdk.Coin + app.BankKeeper.IterateAccountBalances(ctx, addr1, func(c sdk.Coin) (stop bool) { + coins = append(coins, c) + return true + }) + suite.Require().Len(coins, 1) + suite.Require().Equal(newBarCoin(25), coins[0], "expected only bar coins in the account balance, got: %v", coins) } func (suite *IntegrationTestSuite) TestValidateBalance() { From 00a5a8b1e9a7645fd5fa4a01dac0a4ebaaf9a2a2 Mon Sep 17 00:00:00 2001 From: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> Date: Tue, 22 Jun 2021 09:20:22 -0700 Subject: [PATCH 24/50] docs: fix cosmovisor readme (#9549) ## Description The pull request fixes the staking amount, adds the auto-restart option, and improves the user flow for the simd example. This pull request also fixes spelling and grammar, updates content for clarity, and applies consistent formatting. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct `docs:` prefix in the PR title - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [x] followed the [documentation writing guidelines](https://github.com/cosmos/cosmos-sdk/blob/master/docs/DOC_WRITING_GUIDELINES.md) - [x] reviewed "Files changed" and left comments if necessary - [x] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct `docs:` prefix in the PR title - [ ] confirmed all author checklist items have been addressed - [ ] confirmed that this PR only changes documentation - [ ] reviewed content for consistency - [ ] reviewed content for thoroughness - [ ] reviewed content for spelling and grammar - [ ] tested instructions (if applicable) --- cosmovisor/README.md | 171 +++++++++++++++++++------------------------ 1 file changed, 77 insertions(+), 94 deletions(-) diff --git a/cosmovisor/README.md b/cosmovisor/README.md index d61f40e57b..c150790c02 100644 --- a/cosmovisor/README.md +++ b/cosmovisor/README.md @@ -1,35 +1,29 @@ # Cosmosvisor Quick Start -`cosmovisor` is a small process manager around Cosmos SDK binaries that monitors the governance module via stdout to see if there's a chain upgrade proposal coming in. If it see a proposal that gets approved it can be run manually or automatically to download the new code, stop the node, run the migration script, replace the node binary, and start with the new genesis file. +`cosmovisor` is a small process manager for Cosmos SDK binaries that monitors the governance module via stdout for incoming chain upgrade proposals. If it sees a proposal that gets approved, it can be run manually or automatically to download the new binary, stop the current binary, run the migration script, replace the old node binary with the new one, and finally restart the node with the new genesis file. ## Installation -Run: +To install `cosmovisor`, run the following command: -`go get github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor` +``` +go get github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor +``` ## Command Line Arguments And Environment Variables -All arguments passed to the `cosmovisor` program will be passed to the current daemon binary (as a subprocess). -It will return `/dev/stdout` and `/dev/stderr` of the subprocess as its own. Because of that, it cannot accept -any command line arguments, nor print anything to output (unless it terminates unexpectedly before executing a -binary). +All arguments passed to the `cosmovisor` program will be passed to the current daemon binary (as a subprocess). `cosmovisor` will return `/dev/stdout` and `/dev/stderr` of the subprocess as its own. For this reason, `cosmovisor` cannot accept any command line arguments, nor print anything to output (unless it terminates unexpectedly before executing a binary). `cosmovisor` reads its configuration from environment variables: -* `DAEMON_HOME` is the location where upgrade binaries should be kept (e.g. `$HOME/.gaiad` or `$HOME/.xrnd`). -* `DAEMON_NAME` is the name of the binary itself (eg. `xrnd`, `gaiad`, `simd`, etc). -* `DAEMON_ALLOW_DOWNLOAD_BINARIES` (*optional*) if set to `true` will enable auto-downloading of new binaries -(for security reasons, this is intended for full nodes rather than validators). -* `DAEMON_RESTART_AFTER_UPGRADE` (*optional*) if set to `true` it will restart the sub-process with the same -command line arguments and flags (but new binary) after a successful upgrade. By default, `cosmovisor` dies -afterwards and allows the supervisor to restart it if needed. Note that this will not auto-restart the child -if there was an error. +* `DAEMON_HOME` is the location where the `cosmovisor/` directory is kept that contains the upgrade binaries (e.g. `$HOME/.gaiad`, `$HOME/.regend`, `$HOME/.simd`, etc.). +* `DAEMON_NAME` is the name of the binary itself (e.g. `gaiad`, `regend`, `simd`, etc.). +* `DAEMON_ALLOW_DOWNLOAD_BINARIES` (*optional*), if set to `true`, will enable auto-downloading of new binaries (for security reasons, this is intended for full nodes rather than validators). By default, `cosmovisor` will not auto-download new binaries. +* `DAEMON_RESTART_AFTER_UPGRADE` (*optional*), if set to `true`, will restart the subprocess with the same command line arguments and flags (but with the new binary) after a successful upgrade. By default, `cosmovisor` stops running after an upgrade and requires the system administrator to manually restart it. Note that `cosmovisor` will not auto-restart the subprocess if there was an error. ## Data Folder Layout -`$DAEMON_HOME/cosmovisor` is expected to belong completely to `cosmovisor` and -subprocesses that are controlled by it. The folder content is organised as follows: +`$DAEMON_HOME/cosmovisor` is expected to belong completely to `cosmovisor` and the subprocesses that are controlled by it. The folder content is organized as follows: ``` . @@ -43,18 +37,11 @@ subprocesses that are controlled by it. The folder content is organised as follo └── $DAEMON_NAME ``` -Each version of the Cosmos SDK application is stored under either `genesis` or `upgrades/`, which holds `bin/$DAEMON_NAME` -along with any other needed files such as auxiliary client programs or libraries. `current` is a symbolic link to the currently -active folder (so `current/bin/$DAEMON_NAME` is the currently active binary). +Each version of the Cosmos SDK application is stored under either `genesis` or `upgrades/`, which holds `bin/$DAEMON_NAME` along with any other needed files such as auxiliary client programs or libraries. `current` is a symbolic link to the currently active folder and `current/bin/$DAEMON_NAME` is the currently active binary. -*Note: the `name` variable in `upgrades/` holds the URI-encoded name of the upgrade as specified in the upgrade module plan.* +*Note: The `name` variable in `upgrades/` holds the URI-encoded name of the upgrade as specified in the upgrade module plan.* -Please note that `$DAEMON_HOME/cosmovisor` just stores the *binaries* and associated *program code*. -The `cosmovisor` binary can be stored in any typical location (eg `/usr/local/bin`). The actual blockchain -program will store it's data under their default data directory (e.g. `$HOME/.gaiad`) which is independent of -the `$DAEMON_HOME`. You can choose to set `$DAEMON_HOME` to the actual binary's home directory and then end up -with a configuation like the following, but this is left as a choice to the system admininstrator for best -directory layout: +Please note that `$DAEMON_HOME/cosmovisor` just stores the *binaries* and associated *program code*. The `cosmovisor` binary can be stored in any typical location (e.g. `/usr/local/bin`). The actual blockchain program will store its data under the default data directory (e.g. `$HOME/.gaiad`) which is independent of `$DAEMON_HOME`. `$DAEMON_HOME` can be set to any location. If you set `$DAEMON_HOME` to the default data directory, you will end up with a configuation like the following: ``` .gaiad @@ -65,37 +52,27 @@ directory layout: ## Usage -The system administrator admin is responsible for: +The system administrator is responsible for: -* installing the `cosmovisor` binary and configure the host's init system (e.g. `systemd`, `launchd`, etc) along with the environmental variables appropriately; -* installing the `genesis` folder manually; -* installing the `upgrades/` folders manually. +- installing the `cosmovisor` binary +- configuring the host's init system (e.g. `systemd`, `launchd`, etc.) +- appropriately setting the environmental variables +- installing the `genesis` folder manually +- installing the `upgrades/` folders manually -`cosmovisor` will set the `current` link to point to `genesis` at first start (when no `current` link exists) and handles -binaries switch overs at the correct points in time, so that the system administrator can prepare days in advance and relax at upgrade time. +`cosmovisor` will set the `current` link to point to `genesis` at first start (when no `current` link exists) and will handle switching binaries at the correct points in time so that the system administrator can prepare days in advance and relax at upgrade time. -Note that blockchain applications that wish to support upgrades may package up a genesis `cosmovisor` tarball with this information, -just as they prepare the genesis binary tarball. In fact, they may offer a tarball will all upgrades up to current point for easy download -for those who wish to sync a fullnode from start. +Note that blockchain applications that wish to support upgrades may package up a genesis `cosmovisor` tarball with this information, just as they prepare the genesis binary tarball. In fact, they may package up a tarball with all upgrades up to a current point so that the upgrades can be easily downloaded for others who wish to sync a fullnode from start. -The `DAEMON` specific code and operations (e.g. tendermint config, the application db, syncing blocks, etc) are performed as normal. -Application binaries' directives such as command-line flags and environment variables work normally. +The `DAEMON` specific code and operations (e.g. tendermint config, the application db, syncing blocks, etc.) all work as expected. The application binaries' directives such as command-line flags and environment variables also work as expected. ## Auto-Download -Generally, the system requires that the system administrator place all relevant binaries -on the disk before the upgrade happens. However, for people who don't need such -control and want an easier setup (maybe they are syncing a non-validating fullnode -and want to do little maintenance), there is another option. +Generally, the system requires that the system administrator place all relevant binaries on the disk before the upgrade happens. However, for people who don't need such control and want an easier setup (maybe they are syncing a non-validating fullnode and want to do little maintenance), there is another option. -If you set `DAEMON_ALLOW_DOWNLOAD_BINARIES=on` then when an upgrade is triggered and no local binary -can be found, the `cosmovisor` will attempt to download and install the binary itself. -The plan stored in the upgrade module has an info field for arbitrary json. -This info is expected to be outputed on the halt log message. There are two -valid format to specify a download in such a message: +If you set `DAEMON_ALLOW_DOWNLOAD_BINARIES=on`, and no local binary can be found when an upgrade is triggered, `cosmovisor` will attempt to download and install the binary itself. The plan stored in the upgrade module has an info field for arbitrary JSON. This info is expected to be outputed on the halt log message. There are two valid formats to specify a download in such a message: -1. Store an os/architecture -> binary URI map in the upgrade plan info field -as JSON under the `"binaries"` key, eg: +1. Store an os/architecture -> binary URI map in the upgrade plan info field as JSON under the `"binaries"` key. For example: ```json { @@ -105,74 +82,76 @@ as JSON under the `"binaries"` key, eg: } ``` -2. Store a link to a file that contains all information in the above format (eg. if you want -to specify lots of binaries, changelog info, etc without filling up the blockchain). +2. Store a link to a file that contains all information in the above format (e.g. if you want to specify lots of binaries, changelog info, etc. without filling up the blockchain). For example: -e.g. `https://example.com/testnet-1001-info.json?checksum=sha256:deaaa99fda9407c4dbe1d04bd49bab0cc3c1dd76fa392cd55a9425be074af01e` +``` +https://example.com/testnet-1001-info.json?checksum=sha256:deaaa99fda9407c4dbe1d04bd49bab0cc3c1dd76fa392cd55a9425be074af01e +``` -This file contained in the link will be retrieved by [go-getter](https://github.com/hashicorp/go-getter) -and the `"binaries"` field will be parsed as above. +This file contained in the link will be retrieved by [go-getter](https://github.com/hashicorp/go-getter) and the `"binaries"` field will be parsed as above. -If there is no local binary, `DAEMON_ALLOW_DOWNLOAD_BINARIES=on`, and we can access a canonical url for the new binary, -then the `cosmovisor` will download it with [go-getter](https://github.com/hashicorp/go-getter) and -unpack it into the `upgrades/` folder to be run as if we installed it manually. +If there is no local binary, `DAEMON_ALLOW_DOWNLOAD_BINARIES=on`, and we can access a canonical url for the new binary, then the `cosmovisor` will download it with [go-getter](https://github.com/hashicorp/go-getter) and unpack it into the `upgrades/` folder to be run as if we installed it manually. -Note that for this mechanism to provide strong security guarantees, all URLS should include a -sha{256,512} checksum. This ensures that no false binary is run, even if someone hacks the server -or hijacks the DNS. go-getter will always ensure the downloaded file matches the checksum if it -is provided. go-getter will also handle unpacking archives into directories (so these download links should be -a zip of all data in the `bin` directory). +Note that for this mechanism to provide strong security guarantees, all URLs should include a SHA 256/512 checksum. This ensures that no false binary is run, even if someone hacks the server or hijacks the DNS. `go-getter` will always ensure the downloaded file matches the checksum if it is provided. `go-getter` will also handle unpacking archives into directories (in this case the download link should point to a `zip` file of all data in the `bin` directory). -To properly create a checksum on linux, you can use the `sha256sum` utility. e.g. -`sha256sum ./testdata/repo/zip_directory/autod.zip` -which should return `29139e1381b8177aec909fab9a75d11381cab5adf7d3af0c05ff1c9c117743a7`. -You can also use `sha512sum` if you like longer hashes, or `md5sum` if you like to use broken hashes. -Make sure to set the hash algorithm properly in the checksum argument to the url. +To properly create a sha256 checksum on linux, you can use the `sha256sum` utility. For example: + +``` +sha256sum ./testdata/repo/zip_directory/autod.zip +``` + +The result will look something like the following: `29139e1381b8177aec909fab9a75d11381cab5adf7d3af0c05ff1c9c117743a7`. + +You can also use `sha512sum` if you would prefer to use longer hashes, or `md5sum` if you would prefer to use broken hashes. Whichever you choose, make sure to set the hash algorithm properly in the checksum argument to the URL. ## Example: simd -The following instructions provide a demonstration of `cosmovisor`'s integration with the `simd` application -shipped along the Cosmos SDK's source code. +The following instructions provide a demonstration of `cosmovisor`'s integration with the `simd` application shipped along the Cosmos SDK's source code. The following commands are to be run from within the `cosmos-sdk` repository. First compile `simd`: ``` -cd cosmos-sdk/ make build ``` -Create a new key and setup the `simd` node: +Create a new key and set up the `simd` node: ``` rm -rf $HOME/.simapp ./build/simd keys --keyring-backend=test add validator ./build/simd init testing --chain-id test -./build/simd add-genesis-account --keyring-backend=test $(./build/simd keys --keyring-backend=test show validator -a) 1000000000stake,1000000000validatortoken -./build/simd gentx --keyring-backend test --chain-id test validator 100000stake +./build/simd add-genesis-account --keyring-backend=test validator 1000000000stake +./build/simd gentx --keyring-backend test --chain-id test validator 1000000stake ./build/simd collect-gentxs ``` Set the required environment variables: ``` -export DAEMON_NAME=simd # binary name -export DAEMON_HOME=$HOME/.simapp # daemon's home directory +export DAEMON_NAME=simd +export DAEMON_HOME=$HOME/.simapp ``` -Create the `cosmovisor`’s genesis folders and deploy the binary: +Set the optional environment variable to trigger an automatic restart: + +``` +export DAEMON_RESTART_AFTER_UPGRADE=true +``` + +Create the `cosmovisor`’s genesis folders and copy the `simd` binary: ``` mkdir -p $DAEMON_HOME/cosmovisor/genesis/bin cp ./build/simd $DAEMON_HOME/cosmovisor/genesis/bin ``` -For the sake of this demonstration, we would amend `voting_params.voting_period` in `.simapp/config/genesis.json` to a reduced time ~5 minutes (300s) and eventually launch `cosmosvisor`: +For the sake of this demonstration, amend `voting_params.voting_period` in `$HOME/.simapp/config/genesis.json` to a reduced time of ~5 minutes (`300s`) and then start `cosmosvisor`: ``` cosmovisor start ``` -Submit a software upgrade proposal: +Open a new terminal window and submit a software upgrade proposal: ``` ./build/simd tx gov submit-proposal software-upgrade test1 --title "upgrade-demo" --description "upgrade" --from validator --upgrade-height 100 --deposit 10000000stake --chain-id test --keyring-backend test -y @@ -184,35 +163,39 @@ Query the proposal to ensure it was correctly broadcast and added to a block: ./build/simd query gov proposal 1 ``` -Submit a `Yes` vote for the upgrade proposal: +Submit a `yes` vote for the upgrade proposal: ``` ./build/simd tx gov vote 1 yes --from validator --keyring-backend test --chain-id test -y ``` -For the sake of this demonstration, we will hardcode a modification in `simapp` to simulate a code change. -In `simapp/app.go`, find the line containing the upgrade Keeper initialisation, it should look like -`app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath)`. +For the sake of this demonstration, we will hardcode a modification in `simapp` to simulate a code change. In `simapp/app.go`, find the line containing the `UpgradeKeeper` initialization. It should look like the following: + +``` +app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath) +``` + After that line, add the following snippet: ``` - app.UpgradeKeeper.SetUpgradeHandler("test1", func(ctx sdk.Context, plan upgradetypes.Plan) { - // Add some coins to a random account - addr, err := sdk.AccAddressFromBech32("cosmos18cgkqduwuh253twzmhedesw3l7v3fm37sppt58") - if err != nil { - panic(err) - } - err = app.BankKeeper.AddCoins(ctx, addr, sdk.Coins{sdk.Coin{Denom: "stake", Amount: sdk.NewInt(345600000)}}) - if err != nil { - panic(err) - } - }) +app.UpgradeKeeper.SetUpgradeHandler("test1", func(ctx sdk.Context, plan upgradetypes.Plan) { + // Add some coins to a random account + addr, err := sdk.AccAddressFromBech32("cosmos18cgkqduwuh253twzmhedesw3l7v3fm37sppt58") + if err != nil { + panic(err) + } + err = app.BankKeeper.AddCoins(ctx, addr, sdk.Coins{sdk.Coin{Denom: "stake", Amount: sdk.NewInt(345600000)}}) + if err != nil { + panic(err) + } +}) ``` -Now recompile a new binary and place it in `$DAEMON_HOME/cosmosvisor/upgrades/test1/bin`: +Now recompile a new binary and make a copy of it in `$DAEMON_HOME/cosmosvisor/upgrades/test1/bin` (you may need to run `export DAEMON_HOME=$HOME/.simapp` again if you are using a new window): ``` make build +mkdir -p $DAEMON_HOME/cosmovisor/upgrades/test1/bin cp ./build/simd $DAEMON_HOME/cosmovisor/upgrades/test1/bin ``` From 899b097da4b2f77e9929656b7025adb9d8f3a33b Mon Sep 17 00:00:00 2001 From: Tyler <48813565+technicallyty@users.noreply.github.com> Date: Tue, 22 Jun 2021 12:30:50 -0700 Subject: [PATCH 25/50] feat: make authz MsgExec emit events from all executed msgs (#9522) ## Description Closes: #9501 This PR makes MsgExec emit all events from each executed message. Adds a test to check for the additional events. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] ~~added a changelog entry to `CHANGELOG.md`~~ **N/A** - [x] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] ~~updated the relevant documentation or specification~~ **N/A** - [x] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- x/authz/keeper/keeper.go | 8 ++++++ x/authz/keeper/keeper_test.go | 51 +++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) diff --git a/x/authz/keeper/keeper.go b/x/authz/keeper/keeper.go index 7d541c374b..ce4e421c12 100644 --- a/x/authz/keeper/keeper.go +++ b/x/authz/keeper/keeper.go @@ -113,6 +113,14 @@ func (k Keeper) DispatchActions(ctx sdk.Context, grantee sdk.AccAddress, msgs [] return nil, sdkerrors.Wrapf(err, "failed to execute message; message %v", msg) } results[i] = msgResp.Data + + // emit the events from the dispatched actions + events := msgResp.Events + sdkEvents := make([]sdk.Event, 0, len(events)) + for i := 0; i < len(events); i++ { + sdkEvents = append(sdkEvents, sdk.Event(events[i])) + } + ctx.EventManager().EmitEvents(sdkEvents) } return results, nil diff --git a/x/authz/keeper/keeper_test.go b/x/authz/keeper/keeper_test.go index 5e0b79fc64..8dfebac95a 100644 --- a/x/authz/keeper/keeper_test.go +++ b/x/authz/keeper/keeper_test.go @@ -196,6 +196,57 @@ func (s *TestSuite) TestKeeperFees() { s.Require().NotNil(authorization) } +// Tests that all msg events included in an authz MsgExec tx +// Ref: https://github.com/cosmos/cosmos-sdk/issues/9501 +func (s *TestSuite) TestDispatchedEvents() { + require := s.Require() + app, addrs := s.app, s.addrs + granterAddr := addrs[0] + granteeAddr := addrs[1] + recipientAddr := addrs[2] + require.NoError(simapp.FundAccount(app.BankKeeper, s.ctx, granterAddr, sdk.NewCoins(sdk.NewInt64Coin("steak", 10000)))) + now := s.ctx.BlockHeader().Time + require.NotNil(now) + + smallCoin := sdk.NewCoins(sdk.NewInt64Coin("steak", 20)) + msgs := authz.NewMsgExec(granteeAddr, []sdk.Msg{ + &banktypes.MsgSend{ + Amount: sdk.NewCoins(sdk.NewInt64Coin("steak", 2)), + FromAddress: granterAddr.String(), + ToAddress: recipientAddr.String(), + }, + }) + + // grant authorization + err := app.AuthzKeeper.SaveGrant(s.ctx, granteeAddr, granterAddr, &banktypes.SendAuthorization{SpendLimit: smallCoin}, now) + require.NoError(err) + authorization, _ := app.AuthzKeeper.GetCleanAuthorization(s.ctx, granteeAddr, granterAddr, bankSendAuthMsgType) + require.NotNil(authorization) + require.Equal(authorization.MsgTypeURL(), bankSendAuthMsgType) + + executeMsgs, err := msgs.GetMessages() + require.NoError(err) + + result, err := app.AuthzKeeper.DispatchActions(s.ctx, granteeAddr, executeMsgs) + require.NoError(err) + require.NotNil(result) + events := s.ctx.EventManager().Events() + // get last 5 events (events that occur *after* the grant) + events = events[len(events)-5:] + requiredEvents := map[string]bool{ + "coin_spent": false, + "coin_received": false, + "transfer": false, + "message": false, + } + for _, e := range events { + requiredEvents[e.Type] = true + } + for _, v := range requiredEvents { + require.True(v) + } +} + func TestTestSuite(t *testing.T) { suite.Run(t, new(TestSuite)) } From 1c77766717e6c6215d3119967050cf21962f81fb Mon Sep 17 00:00:00 2001 From: Anil Kumar Kammari Date: Wed, 23 Jun 2021 14:12:39 +0530 Subject: [PATCH 26/50] feat: Allow app developers to override default appConfig template (#9550) ## Description Closes: #5540 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [x] included comments for [documenting Go code](https://blog.golang.org/godoc) - [x] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [x] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- docs/core/cli.md | 8 ++++++- server/config/toml.go | 18 +++++++++++++--- server/doc.go | 5 ++++- server/util.go | 35 +++++++++++++++++++++---------- server/util_test.go | 2 +- simapp/simd/cmd/root.go | 46 +++++++++++++++++++++++++++++++++++++++-- 6 files changed, 95 insertions(+), 19 deletions(-) diff --git a/docs/core/cli.md b/docs/core/cli.md index 7f17e0c515..5fbb82f0ec 100644 --- a/docs/core/cli.md +++ b/docs/core/cli.md @@ -60,7 +60,13 @@ The root command (called `rootCmd`) is what the user first types into the comman Next is an example `rootCmd` function from the `simapp` application. It instantiates the root command, adds a [_persistent_ flag](#flags) and `PreRun` function to be run before every execution, and adds all of the necessary subcommands. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/simapp/simd/cmd/root.go#L37-L93 ++++ https://github.com/cosmos/cosmos-sdk/blob/4eea4cafd3b8b1c2cd493886db524500c9dd745c/simapp/simd/cmd/root.go#L37-L150 + +`rootCmd` has a function called `initAppConfig()` which is useful for setting the application's custom configs. +By default app uses Tendermint app config template from SDK, which can be over-written via `initAppConfig()`. +Here's an example code to override default `appConfig` and `app.toml` template. + ++++ https://github.com/cosmos/cosmos-sdk/blob/4eea4cafd3b8b1c2cd493886db524500c9dd745c/simapp/simd/cmd/root.go#L84-L117 The root-level `status` and `keys` subcommands are common across most applications and do not interact with application state. The bulk of an application's functionality - what users can actually _do_ with it - is enabled by its `tx` and `query` commands. diff --git a/server/config/toml.go b/server/config/toml.go index d2eb2601e9..9ecce83bcd 100644 --- a/server/config/toml.go +++ b/server/config/toml.go @@ -8,7 +8,7 @@ import ( tmos "github.com/tendermint/tendermint/libs/os" ) -const defaultConfigTemplate = `# This is a TOML config file. +const DefaultConfigTemplate = `# This is a TOML config file. # For more information, see https://github.com/toml-lang/toml ############################################################################### @@ -210,7 +210,7 @@ func init() { tmpl := template.New("appConfigFileTemplate") - if configTemplate, err = tmpl.Parse(defaultConfigTemplate); err != nil { + if configTemplate, err = tmpl.Parse(DefaultConfigTemplate); err != nil { panic(err) } } @@ -224,9 +224,21 @@ func ParseConfig(v *viper.Viper) (*Config, error) { return conf, err } +// SetConfigTemplate sets the custom app config template for +// the application +func SetConfigTemplate(customTemplate string) { + var err error + + tmpl := template.New("appConfigFileTemplate") + + if configTemplate, err = tmpl.Parse(customTemplate); err != nil { + panic(err) + } +} + // WriteConfigFile renders config using the template and writes it to // configFilePath. -func WriteConfigFile(configFilePath string, config *Config) { +func WriteConfigFile(configFilePath string, config interface{}) { var buffer bytes.Buffer if err := configTemplate.Execute(&buffer, config); err != nil { diff --git a/server/doc.go b/server/doc.go index befac1302e..241c218259 100644 --- a/server/doc.go +++ b/server/doc.go @@ -22,6 +22,9 @@ value called `rpc.laddr` would be read from an environmental variable called Running the `InterceptConfigsPreRunHandler` also reads `app.toml` and `config.toml` from the home directory under the `config` directory. If `config.toml` or `app.toml` do not exist then those files are created -and populated with default values. +and populated with default values. `InterceptConfigsPreRunHandler` takes +two parameters to set/update a custom template to create custom `app.toml`. +If these parameters are empty, the server then creates a default template +provided by the SDK. */ package server diff --git a/server/util.go b/server/util.go index e39bb712c8..bc9ab45df1 100644 --- a/server/util.go +++ b/server/util.go @@ -99,10 +99,13 @@ func bindFlags(basename string, cmd *cobra.Command, v *viper.Viper) (err error) // application command. It will create a Viper literal and a default server // Context. The server Tendermint configuration will either be read and parsed // or created and saved to disk, where the server Context is updated to reflect -// the Tendermint configuration. The Viper literal is used to read and parse -// the application configuration. Command handlers can fetch the server Context -// to get the Tendermint configuration or to get access to Viper. -func InterceptConfigsPreRunHandler(cmd *cobra.Command) error { +// the Tendermint configuration. It takes custom app config template and config +// settings to create a custom Tendermint configuration. If the custom template +// is empty, it uses default-template provided by the server. The Viper literal +// is used to read and parse the application configuration. Command handlers can +// fetch the server Context to get the Tendermint configuration or to get access +// to Viper. +func InterceptConfigsPreRunHandler(cmd *cobra.Command, customAppConfigTemplate string, customAppConfig interface{}) error { serverCtx := NewDefaultContext() // Get the executable name and configure the viper instance so that environmental @@ -123,7 +126,7 @@ func InterceptConfigsPreRunHandler(cmd *cobra.Command) error { serverCtx.Viper.AutomaticEnv() // intercept configuration files, using both Viper instances separately - config, err := interceptConfigs(serverCtx.Viper) + config, err := interceptConfigs(serverCtx.Viper, customAppConfigTemplate, customAppConfig) if err != nil { return err } @@ -181,7 +184,7 @@ func SetCmdServerContext(cmd *cobra.Command, serverCtx *Context) error { // configuration file. The Tendermint configuration file is parsed given a root // Viper object, whereas the application is parsed with the private package-aware // viperCfg object. -func interceptConfigs(rootViper *viper.Viper) (*tmcfg.Config, error) { +func interceptConfigs(rootViper *viper.Viper, customAppTemplate string, customConfig interface{}) (*tmcfg.Config, error) { rootDir := rootViper.GetString(flags.FlagHome) configPath := filepath.Join(rootDir, "config") tmCfgFile := filepath.Join(configPath, "config.toml") @@ -226,12 +229,22 @@ func interceptConfigs(rootViper *viper.Viper) (*tmcfg.Config, error) { appCfgFilePath := filepath.Join(configPath, "app.toml") if _, err := os.Stat(appCfgFilePath); os.IsNotExist(err) { - appConf, err := config.ParseConfig(rootViper) - if err != nil { - return nil, fmt.Errorf("failed to parse %s: %w", appCfgFilePath, err) - } + if customAppTemplate != "" { + config.SetConfigTemplate(customAppTemplate) - config.WriteConfigFile(appCfgFilePath, appConf) + if err = rootViper.Unmarshal(&customConfig); err != nil { + return nil, fmt.Errorf("failed to parse %s: %w", appCfgFilePath, err) + } + + config.WriteConfigFile(appCfgFilePath, customConfig) + } else { + appConf, err := config.ParseConfig(rootViper) + if err != nil { + return nil, fmt.Errorf("failed to parse %s: %w", appCfgFilePath, err) + } + + config.WriteConfigFile(appCfgFilePath, appConf) + } } rootViper.SetConfigType("toml") diff --git a/server/util_test.go b/server/util_test.go index 0800b59a30..d5674be1a6 100644 --- a/server/util_test.go +++ b/server/util_test.go @@ -20,7 +20,7 @@ var CancelledInPreRun = errors.New("Canelled in prerun") // Used in each test to run the function under test via Cobra // but to always halt the command func preRunETestImpl(cmd *cobra.Command, args []string) error { - err := InterceptConfigsPreRunHandler(cmd) + err := InterceptConfigsPreRunHandler(cmd, "", nil) if err != nil { return err } diff --git a/simapp/simd/cmd/root.go b/simapp/simd/cmd/root.go index bb736b61d6..a6cbda0314 100644 --- a/simapp/simd/cmd/root.go +++ b/simapp/simd/cmd/root.go @@ -6,6 +6,7 @@ import ( "os" "path/filepath" + serverconfig "github.com/cosmos/cosmos-sdk/server/config" "github.com/spf13/cast" "github.com/spf13/cobra" tmcli "github.com/tendermint/tendermint/libs/cli" @@ -14,7 +15,7 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" - config "github.com/cosmos/cosmos-sdk/client/config" + "github.com/cosmos/cosmos-sdk/client/config" "github.com/cosmos/cosmos-sdk/client/debug" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/keys" @@ -66,7 +67,9 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) { return err } - return server.InterceptConfigsPreRunHandler(cmd) + customAppTemplate, customAppConfig := initAppConfig() + + return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig) }, } @@ -75,6 +78,45 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) { return rootCmd, encodingConfig } +// initAppConfig helps to override default appConfig template and configs. +// return "", nil if no custom configuration is required for the application. +func initAppConfig() (string, interface{}) { + // The following code snippet is just for reference. + + // WASMConfig defines configuration for the wasm module. + type WASMConfig struct { + // This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries + QueryGasLimit uint64 `mapstructure:"query_gas_limit"` + + // Address defines the gRPC-web server to listen on + LruSize uint64 `mapstructure:"lru_size"` + } + + type CustomAppConfig struct { + serverconfig.Config + + WASM WASMConfig `mapstructure:"wasm"` + } + + customAppConfig := CustomAppConfig{ + Config: *serverconfig.DefaultConfig(), + WASM: WASMConfig{ + LruSize: 1, + QueryGasLimit: 300000, + }, + } + + customAppTemplate := serverconfig.DefaultConfigTemplate + ` +[wasm] +# This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries +query_gas_limit = 300000 +# This is the number of wasm vm instances we keep cached in memory for speed-up +# Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally +lru_size = 0` + + return customAppTemplate, customAppConfig +} + func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { cfg := sdk.GetConfig() cfg.Seal() From 29c7a469feed13691e1b8244b5f9173126d8320c Mon Sep 17 00:00:00 2001 From: Amaury <1293565+amaurym@users.noreply.github.com> Date: Wed, 23 Jun 2021 15:03:33 +0200 Subject: [PATCH 27/50] refactor: Bring back deprecated proto fields to `v1beta1` (#9534) ## Description Closes: #9446 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [x] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [x] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- CHANGELOG.md | 4 +- buf.yaml | 2 - docs/core/proto-docs.md | 3 + proto/cosmos/gov/v1beta1/gov.proto | 6 +- proto/cosmos/upgrade/v1beta1/upgrade.proto | 13 +- x/genutil/legacy/v043/migrate.go | 3 +- x/gov/keeper/grpc_query_test.go | 6 +- x/gov/keeper/querier_test.go | 19 +- x/gov/keeper/vote.go | 19 + x/gov/keeper/vote_test.go | 4 + x/gov/legacy/v040/genesis.pb.go | 592 --------------------- x/gov/legacy/v040/gov.pb.go | 302 ----------- x/gov/legacy/v040/migrate.go | 2 +- x/gov/legacy/v040/migrate_test.go | 4 +- x/gov/legacy/v040/vote.go | 78 --- x/gov/legacy/v043/json.go | 5 +- x/gov/legacy/v043/json_test.go | 20 +- x/gov/legacy/v043/store.go | 18 +- x/gov/legacy/v043/store_test.go | 2 +- x/gov/types/gov.pb.go | 217 ++++---- x/gov/types/vote.go | 2 +- x/upgrade/types/plan.go | 6 + x/upgrade/types/plan_test.go | 15 +- x/upgrade/types/upgrade.pb.go | 170 +++++- 24 files changed, 376 insertions(+), 1136 deletions(-) delete mode 100644 x/gov/legacy/v040/genesis.pb.go delete mode 100644 x/gov/legacy/v040/gov.pb.go delete mode 100644 x/gov/legacy/v040/vote.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 861a5f3c8c..5f07cdbb3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -86,7 +86,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (client/keys) [\#8500](https://github.com/cosmos/cosmos-sdk/pull/8500) `InfoImporter` interface is removed from legacy keybase. * (x/staking) [\#8505](https://github.com/cosmos/cosmos-sdk/pull/8505) `sdk.PowerReduction` has been renamed to `sdk.DefaultPowerReduction`, and most staking functions relying on power reduction take a new function argument, instead of relying on that global variable. * [\#8629](https://github.com/cosmos/cosmos-sdk/pull/8629) Deprecated `SetFullFundraiserPath` from `Config` in favor of `SetPurpose` and `SetCoinType`. -* (x/upgrade) [\#8673](https://github.com/cosmos/cosmos-sdk/pull/8673) Remove IBC logic from x/upgrade. Deprecates IBC fields in an Upgrade Plan. IBC upgrade logic moved to 02-client and an IBC UpgradeProposal is added. +* (x/upgrade) [\#8673](https://github.com/cosmos/cosmos-sdk/pull/8673) Remove IBC logic from x/upgrade. Deprecates IBC fields in an Upgrade Plan, an error will be thrown if they are set. IBC upgrade logic moved to 02-client and an IBC UpgradeProposal is added. * (x/bank) [\#8517](https://github.com/cosmos/cosmos-sdk/pull/8517) `SupplyI` interface and `Supply` are removed and uses `sdk.Coins` for supply tracking * (x/upgrade) [\#8743](https://github.com/cosmos/cosmos-sdk/pull/8743) `UpgradeHandler` includes a new argument `VersionMap` which helps facilitate in-place migrations. * (x/auth) [\#8129](https://github.com/cosmos/cosmos-sdk/pull/8828) Updated `SigVerifiableTx.GetPubKeys` method signature to return error. @@ -121,7 +121,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/{bank,distrib,gov,slashing,staking}) [\#8363](https://github.com/cosmos/cosmos-sdk/issues/8363) Store keys have been modified to allow for variable-length addresses. * (x/evidence) [\#8502](https://github.com/cosmos/cosmos-sdk/pull/8502) `HandleEquivocationEvidence` persists the evidence to state. -* (x/gov) [\#7733](https://github.com/cosmos/cosmos-sdk/pull/7733) ADR 037 Implementation: Governance Split Votes +* (x/gov) [\#7733](https://github.com/cosmos/cosmos-sdk/pull/7733) ADR 037 Implementation: Governance Split Votes, use `MsgWeightedVote` to send a split vote. Sending a regular `MsgVote` will convert the underlying vote option into a weighted vote with weight 1. * (x/bank) [\#8656](https://github.com/cosmos/cosmos-sdk/pull/8656) balance and supply are now correctly tracked via `coin_spent`, `coin_received`, `coinbase` and `burn` events. * (x/bank) [\#8517](https://github.com/cosmos/cosmos-sdk/pull/8517) Supply is now stored and tracked as `sdk.Coins` * (store) [\#8790](https://github.com/cosmos/cosmos-sdk/pull/8790) Reduce gas costs by 10x for transient store operations. diff --git a/buf.yaml b/buf.yaml index 5418e29060..37f716caba 100644 --- a/buf.yaml +++ b/buf.yaml @@ -26,8 +26,6 @@ lint: breaking: use: - FILE - except: - - FIELD_NO_DELETE ignore: - tendermint - gogoproto diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 1f6a1dd02e..c4e33fd6d3 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -4987,6 +4987,7 @@ A Vote consists of a proposal ID, the voter, and the vote option. | ----- | ---- | ----- | ----------- | | `proposal_id` | [uint64](#uint64) | | | | `voter` | [string](#string) | | | +| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | **Deprecated.** Deprecated: Prefer to use `options` instead. This field is set in queries if an only if `len(options) == 1` and that option has weight 1. In all other cases, this field will default to OptionEmpty. | | `options` | [WeightedVoteOption](#cosmos.gov.v1beta1.WeightedVoteOption) | repeated | | @@ -7873,8 +7874,10 @@ Plan specifies information about a planned upgrade and when it should occur. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `name` | [string](#string) | | Sets the name for the upgrade. This name will be used by the upgraded version of the software to apply any special "on-upgrade" commands during the first BeginBlock method after the upgrade is applied. It is also used to detect whether a software version can handle a given upgrade. If no upgrade handler with this name has been set in the software, it will be assumed that the software is out-of-date when the upgrade Time or Height is reached and the software will exit. | +| `time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | **Deprecated.** Deprecated: Time based upgrades have been deprecated. Time based upgrade logic has been removed from the SDK. If this field is not empty, an error will be thrown. | | `height` | [int64](#int64) | | The height at which the upgrade must be performed. Only used if Time is not set. | | `info` | [string](#string) | | Any application specific upgrade info to be included on-chain such as a git commit that validators could automatically upgrade to | +| `upgraded_client_state` | [google.protobuf.Any](#google.protobuf.Any) | | **Deprecated.** Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been moved to the IBC module in the sub module 02-client. If this field is not empty, an error will be thrown. | diff --git a/proto/cosmos/gov/v1beta1/gov.proto b/proto/cosmos/gov/v1beta1/gov.proto index 392534c535..b38c14d06c 100644 --- a/proto/cosmos/gov/v1beta1/gov.proto +++ b/proto/cosmos/gov/v1beta1/gov.proto @@ -131,8 +131,10 @@ message Vote { uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; string voter = 2; - reserved 3; - reserved "option"; + // Deprecated: Prefer to use `options` instead. This field is set in queries + // if and only if `len(options) == 1` and that option has weight 1. In all + // other cases, this field will default to OptionEmpty. + VoteOption option = 3 [deprecated = true]; repeated WeightedVoteOption options = 4 [(gogoproto.nullable) = false]; } diff --git a/proto/cosmos/upgrade/v1beta1/upgrade.proto b/proto/cosmos/upgrade/v1beta1/upgrade.proto index ad3d34ca10..4e1d69aaaa 100644 --- a/proto/cosmos/upgrade/v1beta1/upgrade.proto +++ b/proto/cosmos/upgrade/v1beta1/upgrade.proto @@ -22,10 +22,10 @@ message Plan { // reached and the software will exit. string name = 1; - // Time based upgrades have been deprecated. Time based upgrade logic + // Deprecated: Time based upgrades have been deprecated. Time based upgrade logic // has been removed from the SDK. - reserved 2; - reserved "time"; + // If this field is not empty, an error will be thrown. + google.protobuf.Timestamp time = 2 [deprecated = true, (gogoproto.stdtime) = true, (gogoproto.nullable) = false]; // The height at which the upgrade must be performed. // Only used if Time is not set. @@ -35,10 +35,11 @@ message Plan { // such as a git commit that validators could automatically upgrade to string info = 4; - // UpgradedClientState field has been deprecated. IBC upgrade logic has been + // Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been // moved to the IBC module in the sub module 02-client. - reserved 5; - reserved "option"; + // If this field is not empty, an error will be thrown. + google.protobuf.Any upgraded_client_state = 5 + [deprecated = true, (gogoproto.moretags) = "yaml:\"upgraded_client_state\""]; } // SoftwareUpgradeProposal is a gov Content type for initiating a software diff --git a/x/genutil/legacy/v043/migrate.go b/x/genutil/legacy/v043/migrate.go index e932159393..8dba9ffe60 100644 --- a/x/genutil/legacy/v043/migrate.go +++ b/x/genutil/legacy/v043/migrate.go @@ -5,6 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/genutil/types" v040gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v040" v043gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v043" + gov "github.com/cosmos/cosmos-sdk/x/gov/types" ) // Migrate migrates exported state from v0.40 to a v0.43 genesis state. @@ -12,7 +13,7 @@ func Migrate(appState types.AppMap, clientCtx client.Context) types.AppMap { // Migrate x/gov. if appState[v040gov.ModuleName] != nil { // unmarshal relative source genesis application state - var oldGovState v040gov.GenesisState + var oldGovState gov.GenesisState clientCtx.Codec.MustUnmarshalJSON(appState[v040gov.ModuleName], &oldGovState) // delete deprecated x/gov genesis state diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index 32d0d2907c..49505d1f6b 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -298,7 +298,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { Voter: addrs[0].String(), } - expRes = &types.QueryVoteResponse{Vote: types.NewVote(proposal.ProposalId, addrs[0], types.NewNonSplitVoteOption(types.OptionAbstain))} + expRes = &types.QueryVoteResponse{Vote: types.Vote{ProposalId: proposal.ProposalId, Voter: addrs[0].String(), Option: types.OptionAbstain, Options: []types.WeightedVoteOption{{Option: types.OptionAbstain, Weight: sdk.MustNewDecFromStr("1.0")}}}} }, true, }, @@ -395,8 +395,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { app.GovKeeper.SetProposal(ctx, proposal) votes = []types.Vote{ - {proposal.ProposalId, addrs[0].String(), types.NewNonSplitVoteOption(types.OptionAbstain)}, - {proposal.ProposalId, addrs[1].String(), types.NewNonSplitVoteOption(types.OptionYes)}, + {ProposalId: proposal.ProposalId, Voter: addrs[0].String(), Options: types.NewNonSplitVoteOption(types.OptionAbstain)}, + {ProposalId: proposal.ProposalId, Voter: addrs[1].String(), Options: types.NewNonSplitVoteOption(types.OptionYes)}, } accAddr1, err1 := sdk.AccAddressFromBech32(votes[0].Voter) accAddr2, err2 := sdk.AccAddressFromBech32(votes[1].Voter) diff --git a/x/gov/keeper/querier_test.go b/x/gov/keeper/querier_test.go index 282f1a44c2..b3cf4dfd92 100644 --- a/x/gov/keeper/querier_test.go +++ b/x/gov/keeper/querier_test.go @@ -268,16 +268,16 @@ func TestQueries(t *testing.T) { // Test query votes on types.Proposal 2 votes := getQueriedVotes(t, ctx, legacyQuerierCdc, querier, proposal2.ProposalId, 1, 0) require.Len(t, votes, 1) - require.Equal(t, vote1, votes[0]) + checkEqualVotes(t, vote1, votes[0]) vote := getQueriedVote(t, ctx, legacyQuerierCdc, querier, proposal2.ProposalId, TestAddrs[0]) - require.Equal(t, vote1, vote) + checkEqualVotes(t, vote1, vote) // Test query votes on types.Proposal 3 votes = getQueriedVotes(t, ctx, legacyQuerierCdc, querier, proposal3.ProposalId, 1, 0) require.Len(t, votes, 2) - require.Equal(t, vote2, votes[0]) - require.Equal(t, vote3, votes[1]) + checkEqualVotes(t, vote2, votes[0]) + checkEqualVotes(t, vote3, votes[1]) // Test query all proposals proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, nil, types.StatusNil, 1, 0) @@ -384,3 +384,14 @@ func TestPaginatedVotesQuery(t *testing.T) { }) } } + +// checkEqualVotes checks that two votes are equal, without taking into account +// graceful fallback for `Option`. +// When querying, the keeper populates the `vote.Option` field when there's +// only 1 vote, this function checks equality of structs while skipping that +// field. +func checkEqualVotes(t *testing.T, vote1, vote2 types.Vote) { + require.Equal(t, vote1.Options, vote2.Options) + require.Equal(t, vote1.Voter, vote2.Voter) + require.Equal(t, vote1.ProposalId, vote2.ProposalId) +} diff --git a/x/gov/keeper/vote.go b/x/gov/keeper/vote.go index c54ce875c8..cb58c95da5 100644 --- a/x/gov/keeper/vote.go +++ b/x/gov/keeper/vote.go @@ -44,6 +44,7 @@ func (keeper Keeper) AddVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.A // GetAllVotes returns all the votes from the store func (keeper Keeper) GetAllVotes(ctx sdk.Context) (votes types.Votes) { keeper.IterateAllVotes(ctx, func(vote types.Vote) bool { + populateLegacyOption(&vote) votes = append(votes, vote) return false }) @@ -53,6 +54,7 @@ func (keeper Keeper) GetAllVotes(ctx sdk.Context) (votes types.Votes) { // GetVotes returns all the votes from a proposal func (keeper Keeper) GetVotes(ctx sdk.Context, proposalID uint64) (votes types.Votes) { keeper.IterateVotes(ctx, proposalID, func(vote types.Vote) bool { + populateLegacyOption(&vote) votes = append(votes, vote) return false }) @@ -68,11 +70,18 @@ func (keeper Keeper) GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.A } keeper.cdc.MustUnmarshal(bz, &vote) + populateLegacyOption(&vote) + return vote, true } // SetVote sets a Vote to the gov store func (keeper Keeper) SetVote(ctx sdk.Context, vote types.Vote) { + // vote.Option is a deprecated field, we don't set it in state + if vote.Option != types.OptionEmpty { //nolint + vote.Option = types.OptionEmpty //nolint + } + store := ctx.KVStore(keeper.storeKey) bz := keeper.cdc.MustMarshal(&vote) addr, err := sdk.AccAddressFromBech32(vote.Voter) @@ -91,6 +100,7 @@ func (keeper Keeper) IterateAllVotes(ctx sdk.Context, cb func(vote types.Vote) ( for ; iterator.Valid(); iterator.Next() { var vote types.Vote keeper.cdc.MustUnmarshal(iterator.Value(), &vote) + populateLegacyOption(&vote) if cb(vote) { break @@ -107,6 +117,7 @@ func (keeper Keeper) IterateVotes(ctx sdk.Context, proposalID uint64, cb func(vo for ; iterator.Valid(); iterator.Next() { var vote types.Vote keeper.cdc.MustUnmarshal(iterator.Value(), &vote) + populateLegacyOption(&vote) if cb(vote) { break @@ -119,3 +130,11 @@ func (keeper Keeper) deleteVote(ctx sdk.Context, proposalID uint64, voterAddr sd store := ctx.KVStore(keeper.storeKey) store.Delete(types.VoteKey(proposalID, voterAddr)) } + +// populateLegacyOption adds graceful fallback of deprecated `Option` field, in case +// there's only 1 VoteOption. +func populateLegacyOption(vote *types.Vote) { + if len(vote.Options) == 1 && vote.Options[0].Weight.Equal(sdk.MustNewDecFromStr("1.0")) { + vote.Option = vote.Options[0].Option //nolint + } +} diff --git a/x/gov/keeper/vote_test.go b/x/gov/keeper/vote_test.go index ae6ebc4a56..80df467166 100644 --- a/x/gov/keeper/vote_test.go +++ b/x/gov/keeper/vote_test.go @@ -40,6 +40,7 @@ func TestVotes(t *testing.T) { require.Equal(t, proposalID, vote.ProposalId) require.True(t, len(vote.Options) == 1) require.Equal(t, types.OptionAbstain, vote.Options[0].Option) + require.Equal(t, types.OptionAbstain, vote.Option) // Test change of vote require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], types.NewNonSplitVoteOption(types.OptionYes))) @@ -49,6 +50,7 @@ func TestVotes(t *testing.T) { require.Equal(t, proposalID, vote.ProposalId) require.True(t, len(vote.Options) == 1) require.Equal(t, types.OptionYes, vote.Options[0].Option) + require.Equal(t, types.OptionYes, vote.Option) // Test second vote require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], types.WeightedVoteOptions{ @@ -70,6 +72,7 @@ func TestVotes(t *testing.T) { require.True(t, vote.Options[1].Weight.Equal(sdk.NewDecWithPrec(30, 2))) require.True(t, vote.Options[2].Weight.Equal(sdk.NewDecWithPrec(5, 2))) require.True(t, vote.Options[3].Weight.Equal(sdk.NewDecWithPrec(5, 2))) + require.Equal(t, types.OptionEmpty, vote.Option) // Test vote iterator // NOTE order of deposits is determined by the addresses @@ -87,4 +90,5 @@ func TestVotes(t *testing.T) { require.True(t, votes[1].Options[1].Weight.Equal(sdk.NewDecWithPrec(30, 2))) require.True(t, votes[1].Options[2].Weight.Equal(sdk.NewDecWithPrec(5, 2))) require.True(t, votes[1].Options[3].Weight.Equal(sdk.NewDecWithPrec(5, 2))) + require.Equal(t, types.OptionEmpty, vote.Option) } diff --git a/x/gov/legacy/v040/genesis.pb.go b/x/gov/legacy/v040/genesis.pb.go deleted file mode 100644 index 2dc67061a9..0000000000 --- a/x/gov/legacy/v040/genesis.pb.go +++ /dev/null @@ -1,592 +0,0 @@ -// Package v040 is taken from: -// https://github.com/cosmos/cosmos-sdk/blob/v0.42.1/x/gov/types/genesis.pb.go -// by copy-pasted only the relevants parts for Genesis. -//nolint -package v040 - -import ( - fmt "fmt" - io "io" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - - "github.com/cosmos/cosmos-sdk/x/gov/types" -) - -// GenesisState defines the gov module's genesis state. -type GenesisState struct { - // starting_proposal_id is the ID of the starting proposal. - StartingProposalId uint64 `protobuf:"varint,1,opt,name=starting_proposal_id,json=startingProposalId,proto3" json:"starting_proposal_id,omitempty" yaml:"starting_proposal_id"` - // deposits defines all the deposits present at genesis. - Deposits types.Deposits `protobuf:"bytes,2,rep,name=deposits,proto3,castrepeated=Deposits" json:"deposits"` - // votes defines all the votes present at genesis. - Votes Votes `protobuf:"bytes,3,rep,name=votes,proto3,castrepeated=Votes" json:"votes"` - // proposals defines all the proposals present at genesis. - Proposals types.Proposals `protobuf:"bytes,4,rep,name=proposals,proto3,castrepeated=Proposals" json:"proposals"` - // params defines all the paramaters of related to deposit. - DepositParams types.DepositParams `protobuf:"bytes,5,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params" yaml:"deposit_params"` - // params defines all the paramaters of related to voting. - VotingParams types.VotingParams `protobuf:"bytes,6,opt,name=voting_params,json=votingParams,proto3" json:"voting_params" yaml:"voting_params"` - // params defines all the paramaters of related to tally. - TallyParams types.TallyParams `protobuf:"bytes,7,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params" yaml:"tally_params"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} - -func (m *GenesisState) GetStartingProposalId() uint64 { - if m != nil { - return m.StartingProposalId - } - return 0 -} - -func (m *GenesisState) GetDeposits() types.Deposits { - if m != nil { - return m.Deposits - } - return nil -} - -func (m *GenesisState) GetVotes() Votes { - if m != nil { - return m.Votes - } - return nil -} - -func (m *GenesisState) GetProposals() types.Proposals { - if m != nil { - return m.Proposals - } - return nil -} - -func (m *GenesisState) GetDepositParams() types.DepositParams { - if m != nil { - return m.DepositParams - } - return types.DepositParams{} -} - -func (m *GenesisState) GetVotingParams() types.VotingParams { - if m != nil { - return m.VotingParams - } - return types.VotingParams{} -} - -func (m *GenesisState) GetTallyParams() types.TallyParams { - if m != nil { - return m.TallyParams - } - return types.TallyParams{} -} - -func (m *GenesisState) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.TallyParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - { - size, err := m.VotingParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - { - size, err := m.DepositParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if len(m.Proposals) > 0 { - for iNdEx := len(m.Proposals) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Proposals[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Votes) > 0 { - for iNdEx := len(m.Votes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Votes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Deposits) > 0 { - for iNdEx := len(m.Deposits) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Deposits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.StartingProposalId != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.StartingProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.StartingProposalId != 0 { - n += 1 + sovGenesis(uint64(m.StartingProposalId)) - } - if len(m.Deposits) > 0 { - for _, e := range m.Deposits { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.Votes) > 0 { - for _, e := range m.Votes { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.Proposals) > 0 { - for _, e := range m.Proposals { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - l = m.DepositParams.Size() - n += 1 + l + sovGenesis(uint64(l)) - l = m.VotingParams.Size() - n += 1 + l + sovGenesis(uint64(l)) - l = m.TallyParams.Size() - n += 1 + l + sovGenesis(uint64(l)) - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func (m *GenesisState) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartingProposalId", wireType) - } - m.StartingProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartingProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Deposits", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Deposits = append(m.Deposits, types.Deposit{}) - if err := m.Deposits[len(m.Deposits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Votes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Votes = append(m.Votes, Vote{}) - if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposals", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Proposals = append(m.Proposals, types.Proposal{}) - if err := m.Proposals[len(m.Proposals)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DepositParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.DepositParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VotingParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.VotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TallyParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TallyParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/gov/legacy/v040/gov.pb.go b/x/gov/legacy/v040/gov.pb.go deleted file mode 100644 index 34ca3d82a0..0000000000 --- a/x/gov/legacy/v040/gov.pb.go +++ /dev/null @@ -1,302 +0,0 @@ -// Package v040 is taken from: -// https://github.com/cosmos/cosmos-sdk/blob/v0.41.1/x/gov/types/gov.pb.go -// by copy-pasted only the relevants parts for Vote. -package v040 - -import ( - "fmt" - "io" - math_bits "math/bits" - - "github.com/cosmos/cosmos-sdk/x/gov/types" -) - -type Vote struct { - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty" yaml:"proposal_id"` //nolint:golint - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - Option types.VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"` -} - -func (m *Vote) Reset() { *m = Vote{} } -func (*Vote) ProtoMessage() {} - -func (m *Vote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovGov(m.ProposalId) - } - l = len(m.Voter) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - if m.Option != 0 { - n += 1 + sovGov(uint64(m.Option)) - } - return n -} - -func (m *Vote) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Vote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Option != 0 { - i = encodeVarintGov(dAtA, i, uint64(m.Option)) - i-- - dAtA[i] = 0x18 - } - if len(m.Voter) > 0 { - i -= len(m.Voter) - copy(dAtA[i:], m.Voter) - i = encodeVarintGov(dAtA, i, uint64(len(m.Voter))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintGov(dAtA, i, m.ProposalId) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintGov(dAtA []byte, offset int, v uint64) int { - offset -= sovGov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func sovGov(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} - -func (m *Vote) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Vote: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Vote: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Voter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType) - } - m.Option = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Option |= types.VoteOption(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipGov(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGov - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGov - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGov - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGov - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGov - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGov - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGov = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGov = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGov = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/gov/legacy/v040/migrate.go b/x/gov/legacy/v040/migrate.go index 4845c8303d..3adedde509 100644 --- a/x/gov/legacy/v040/migrate.go +++ b/x/gov/legacy/v040/migrate.go @@ -163,7 +163,7 @@ func Migrate(oldGovState v036gov.GenesisState) *v040gov.GenesisState { newVotes[i] = v040gov.Vote{ ProposalId: oldVote.ProposalID, Voter: oldVote.Voter.String(), - Options: v040gov.NewNonSplitVoteOption(migrateVoteOption(oldVote.Option)), + Option: migrateVoteOption(oldVote.Option), } } diff --git a/x/gov/legacy/v040/migrate_test.go b/x/gov/legacy/v040/migrate_test.go index 3c9d512df5..664696bf29 100644 --- a/x/gov/legacy/v040/migrate_test.go +++ b/x/gov/legacy/v040/migrate_test.go @@ -175,7 +175,9 @@ func TestMigrate(t *testing.T) { "plan": { "height": "123", "info": "foo_upgrade_info", - "name": "foo_upgrade_name" + "name": "foo_upgrade_name", + "time": "0001-01-01T00:00:00Z", + "upgraded_client_state": null }, "title": "foo_software_upgrade" }, diff --git a/x/gov/legacy/v040/vote.go b/x/gov/legacy/v040/vote.go deleted file mode 100644 index 59bde95107..0000000000 --- a/x/gov/legacy/v040/vote.go +++ /dev/null @@ -1,78 +0,0 @@ -// Package v040 is copy-pasted from: -// https://github.com/cosmos/cosmos-sdk/blob/v0.41.1/x/gov/types/vote.go -package v040 - -import ( - "fmt" - - yaml "gopkg.in/yaml.v2" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/gov/types" -) - -// NewVote creates a new Vote instance -//nolint:interfacer -func NewVote(proposalID uint64, voter sdk.AccAddress, option types.VoteOption) Vote { - return Vote{proposalID, voter.String(), option} -} - -func (v Vote) String() string { - out, _ := yaml.Marshal(v) - return string(out) -} - -// Votes is a collection of Vote objects -type Votes []Vote - -// Equal returns true if two slices (order-dependant) of votes are equal. -func (v Votes) Equal(other Votes) bool { - if len(v) != len(other) { - return false - } - - for i, vote := range v { - if vote.String() != other[i].String() { - return false - } - } - - return true -} - -func (v Votes) String() string { - if len(v) == 0 { - return "[]" - } - out := fmt.Sprintf("Votes for Proposal %d:", v[0].ProposalId) - for _, vot := range v { - out += fmt.Sprintf("\n %s: %s", vot.Voter, vot.Option) - } - return out -} - -// Empty returns whether a vote is empty. -func (v Vote) Empty() bool { - return v.String() == Vote{}.String() -} - -// VoteOptionFromString returns a VoteOption from a string. It returns an error -// if the string is invalid. -func VoteOptionFromString(str string) (types.VoteOption, error) { - option, ok := types.VoteOption_value[str] - if !ok { - return types.OptionEmpty, fmt.Errorf("'%s' is not a valid vote option", str) - } - return types.VoteOption(option), nil -} - -// ValidVoteOption returns true if the vote option is valid and false otherwise. -func ValidVoteOption(option types.VoteOption) bool { - if option == types.OptionYes || - option == types.OptionAbstain || - option == types.OptionNo || - option == types.OptionNoWithVeto { - return true - } - return false -} diff --git a/x/gov/legacy/v043/json.go b/x/gov/legacy/v043/json.go index db6e477577..16de6cdf47 100644 --- a/x/gov/legacy/v043/json.go +++ b/x/gov/legacy/v043/json.go @@ -1,12 +1,11 @@ package v043 import ( - v040gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v040" "github.com/cosmos/cosmos-sdk/x/gov/types" ) // migrateWeightedVotes migrates the ADR-037 weighted votes. -func migrateJSONWeightedVotes(oldVotes v040gov.Votes) types.Votes { +func migrateJSONWeightedVotes(oldVotes types.Votes) types.Votes { newVotes := make(types.Votes, len(oldVotes)) for i, oldVote := range oldVotes { newVotes[i] = migrateVote(oldVote) @@ -19,7 +18,7 @@ func migrateJSONWeightedVotes(oldVotes v040gov.Votes) types.Votes { // v0.43 x/gov genesis state. The migration includes: // // - Gov weighted votes. -func MigrateJSON(oldState *v040gov.GenesisState) *types.GenesisState { +func MigrateJSON(oldState *types.GenesisState) *types.GenesisState { return &types.GenesisState{ StartingProposalId: oldState.StartingProposalId, Deposits: oldState.Deposits, diff --git a/x/gov/legacy/v043/json_test.go b/x/gov/legacy/v043/json_test.go index 1f8bb2a69f..d9f0457746 100644 --- a/x/gov/legacy/v043/json_test.go +++ b/x/gov/legacy/v043/json_test.go @@ -10,7 +10,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" - v040gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v040" v043gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v043" "github.com/cosmos/cosmos-sdk/x/gov/types" ) @@ -24,13 +23,13 @@ func TestMigrateJSON(t *testing.T) { voter, err := sdk.AccAddressFromBech32("cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh") require.NoError(t, err) - govGenState := &v040gov.GenesisState{ - Votes: v040gov.Votes{ - v040gov.NewVote(1, voter, types.OptionAbstain), - v040gov.NewVote(2, voter, types.OptionEmpty), - v040gov.NewVote(3, voter, types.OptionNo), - v040gov.NewVote(4, voter, types.OptionNoWithVeto), - v040gov.NewVote(5, voter, types.OptionYes), + govGenState := &types.GenesisState{ + Votes: types.Votes{ + types.Vote{ProposalId: 1, Voter: voter.String(), Option: types.OptionAbstain}, + types.Vote{ProposalId: 2, Voter: voter.String(), Option: types.OptionEmpty}, + types.Vote{ProposalId: 3, Voter: voter.String(), Option: types.OptionNo}, + types.Vote{ProposalId: 4, Voter: voter.String(), Option: types.OptionNoWithVeto}, + types.Vote{ProposalId: 5, Voter: voter.String(), Option: types.OptionYes}, }, } @@ -63,6 +62,7 @@ func TestMigrateJSON(t *testing.T) { }, "votes": [ { + "option": "VOTE_OPTION_UNSPECIFIED", "options": [ { "option": "VOTE_OPTION_ABSTAIN", @@ -73,6 +73,7 @@ func TestMigrateJSON(t *testing.T) { "voter": "cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh" }, { + "option": "VOTE_OPTION_UNSPECIFIED", "options": [ { "option": "VOTE_OPTION_UNSPECIFIED", @@ -83,6 +84,7 @@ func TestMigrateJSON(t *testing.T) { "voter": "cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh" }, { + "option": "VOTE_OPTION_UNSPECIFIED", "options": [ { "option": "VOTE_OPTION_NO", @@ -93,6 +95,7 @@ func TestMigrateJSON(t *testing.T) { "voter": "cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh" }, { + "option": "VOTE_OPTION_UNSPECIFIED", "options": [ { "option": "VOTE_OPTION_NO_WITH_VETO", @@ -103,6 +106,7 @@ func TestMigrateJSON(t *testing.T) { "voter": "cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh" }, { + "option": "VOTE_OPTION_UNSPECIFIED", "options": [ { "option": "VOTE_OPTION_YES", diff --git a/x/gov/legacy/v043/store.go b/x/gov/legacy/v043/store.go index c5da33d951..2de980dbab 100644 --- a/x/gov/legacy/v043/store.go +++ b/x/gov/legacy/v043/store.go @@ -1,11 +1,12 @@ package v043 import ( + "fmt" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" - v040gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v040" "github.com/cosmos/cosmos-sdk/x/gov/types" ) @@ -33,27 +34,30 @@ func migratePrefixProposalAddress(store sdk.KVStore, prefixBz []byte) { } // migrateStoreWeightedVotes migrates a legacy vote to an ADR-037 weighted vote. -func migrateVote(oldVote v040gov.Vote) types.Vote { +// Important: the `oldVote` has its `Option` field set, whereas the new weighted +// vote has its `Options` field set. +func migrateVote(oldVote types.Vote) types.Vote { return types.Vote{ ProposalId: oldVote.ProposalId, Voter: oldVote.Voter, - Options: []types.WeightedVoteOption{{Option: oldVote.Option, Weight: sdk.NewDec(1)}}, + Options: types.NewNonSplitVoteOption(oldVote.Option), } } // migrateStoreWeightedVotes migrates in-place all legacy votes to ADR-037 weighted votes. func migrateStoreWeightedVotes(store sdk.KVStore, cdc codec.BinaryCodec) error { - iterator := sdk.KVStorePrefixIterator(store, v040gov.VotesKeyPrefix) + iterator := sdk.KVStorePrefixIterator(store, types.VotesKeyPrefix) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - var oldVote v040gov.Vote + var oldVote types.Vote err := cdc.Unmarshal(iterator.Value(), &oldVote) if err != nil { return err } newVote := migrateVote(oldVote) + fmt.Println("migrateStoreWeightedVotes newVote=", newVote) bz, err := cdc.Marshal(&newVote) if err != nil { return err @@ -71,7 +75,7 @@ func migrateStoreWeightedVotes(store sdk.KVStore, cdc codec.BinaryCodec) error { // - Change addresses to be length-prefixed. func MigrateStore(ctx sdk.Context, storeKey sdk.StoreKey, cdc codec.BinaryCodec) error { store := ctx.KVStore(storeKey) - migratePrefixProposalAddress(store, v040gov.DepositsKeyPrefix) - migratePrefixProposalAddress(store, v040gov.VotesKeyPrefix) + migratePrefixProposalAddress(store, types.DepositsKeyPrefix) + migratePrefixProposalAddress(store, types.VotesKeyPrefix) return migrateStoreWeightedVotes(store, cdc) } diff --git a/x/gov/legacy/v043/store_test.go b/x/gov/legacy/v043/store_test.go index db2ffa8737..b65b126b03 100644 --- a/x/gov/legacy/v043/store_test.go +++ b/x/gov/legacy/v043/store_test.go @@ -28,7 +28,7 @@ func TestMigrateStore(t *testing.T) { // Use dummy value for keys where we don't test values. dummyValue := []byte("foo") // Use real values for votes, as we're testing weighted votes. - oldVote := v040gov.Vote{ProposalId: 1, Voter: "foobar", Option: types.OptionNoWithVeto} + oldVote := types.Vote{ProposalId: 1, Voter: "foobar", Option: types.OptionNoWithVeto} oldVoteValue := cdc.MustMarshal(&oldVote) newVote := types.Vote{ProposalId: 1, Voter: "foobar", Options: types.WeightedVoteOptions{{Option: types.OptionNoWithVeto, Weight: sdk.NewDec(1)}}} newVoteValue := cdc.MustMarshal(&newVote) diff --git a/x/gov/types/gov.pb.go b/x/gov/types/gov.pb.go index 5f49a4ae41..013c0fa730 100644 --- a/x/gov/types/gov.pb.go +++ b/x/gov/types/gov.pb.go @@ -326,9 +326,13 @@ var xxx_messageInfo_TallyResult proto.InternalMessageInfo // Vote defines a vote on a governance proposal. // A Vote consists of a proposal ID, the voter, and the vote option. type Vote struct { - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty" yaml:"proposal_id"` - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - Options []WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options"` + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty" yaml:"proposal_id"` + Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` + // Deprecated: Prefer to use `options` instead. This field is set in queries + // if an only if `len(options) == 1` and that option has weight 1. In all + // other cases, this field will default to OptionEmpty. + Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"` // Deprecated: Do not use. + Options []WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options"` } func (m *Vote) Reset() { *m = Vote{} } @@ -503,98 +507,98 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1beta1/gov.proto", fileDescriptor_6e82113c1a9a4b7c) } var fileDescriptor_6e82113c1a9a4b7c = []byte{ - // 1450 bytes of a gzipped FileDescriptorProto + // 1454 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x51, 0x68, 0xdb, 0x56, 0x17, 0xb6, 0x6c, 0xc7, 0x89, 0xaf, 0x9d, 0x44, 0xbd, 0x49, 0x13, 0xc7, 0x7f, 0x7f, 0xc9, 0xbf, - 0xfe, 0x51, 0x42, 0x69, 0x9d, 0x36, 0x1b, 0x1b, 0x4b, 0x61, 0x9b, 0x15, 0x2b, 0xab, 0x4b, 0xb1, - 0x8d, 0xac, 0x3a, 0xb4, 0x7b, 0x10, 0x8a, 0x7d, 0xeb, 0x68, 0xb3, 0x74, 0x3d, 0xeb, 0x3a, 0x4d, - 0xd8, 0xcb, 0x1e, 0x8b, 0x07, 0xa3, 0x8f, 0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6, + 0xc0, 0x2c, 0xc1, 0xc4, 0x68, 0xea, 0xec, 0x20, 0x35, 0x7d, 0x51, 0x23, 0xde, 0x61, 0x71, 0x16, + 0x69, 0x9c, 0x21, 0xb4, 0x34, 0x51, 0x83, 0x26, 0x3d, 0xac, 0x3f, 0x62, 0x4d, 0x70, 0x69, 0x0f, + 0x13, 0xd3, 0x6e, 0xb8, 0x3f, 0x6f, 0x9b, 0x09, 0x3b, 0x73, 0x61, 0xd9, 0xff, 0x63, 0xe9, 0xa4, + 0x68, 0x3a, 0x63, 0x14, 0xb4, 0xee, 0x79, 0x6a, 0xaf, 0xb8, 0x66, 0xaf, 0xf0, 0x87, 0x80, 0x99, + 0x06, 0x12, 0xc7, 0x2f, 0x8c, 0x25, 0xb1, 0x58, 0x4b, 0x43, 0xb1, 0x86, 0x15, 0x9e, 0xa5, 0x56, + 0x26, 0xf0, 0x46, 0xd4, 0xdd, 0x2a, 0xd2, 0x61, 0x18, 0x24, 0x82, 0xed, 0xf3, 0x01, 0x88, 0x1c, + 0x20, 0x87, 0x6e, 0x28, 0x39, 0x3b, 0xc1, 0x26, 0x2c, 0xd8, 0x44, 0x75, 0xa1, 0xf0, 0x0e, 0x98, + 0x36, 0x76, 0x1c, 0x62, 0x98, 0x6c, 0x97, 0x4d, 0xcc, 0xe2, 0xc3, 0xe1, 0x7b, 0x20, 0x6c, 0x63, + 0x6f, 0x20, 0x27, 0x27, 0x09, 0xdb, 0x18, 0x36, 0x40, 0xd2, 0xc6, 0xfa, 0x23, 0x93, 0xec, 0xea, + 0x7b, 0x88, 0x60, 0x6f, 0xec, 0xe2, 0xb2, 0x32, 0x19, 0xd3, 0x69, 0x5f, 0x5c, 0xa0, 0xa2, 0x06, + 0xb9, 0x24, 0x15, 0xd8, 0x78, 0xdb, 0x24, 0xbb, 0x55, 0x44, 0x30, 0x93, 0xf2, 0x98, 0x03, 0x51, + 0xf7, 0x7a, 0xf9, 0xe7, 0x2b, 0x79, 0x11, 0x4c, 0xed,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bf, 0xf9, + 0xf3, 0xcf, 0x92, 0x79, 0x00, 0x62, 0x9f, 0x75, 0x70, 0xbb, 0x63, 0x79, 0x59, 0x24, 0x65, 0x79, + 0xb2, 0x8f, 0xa1, 0x93, 0xbe, 0xc8, 0x53, 0xfc, 0x20, 0x1b, 0x95, 0x31, 0xc2, 0x1a, 0x88, 0x93, + 0xdd, 0x36, 0x72, 0x76, 0x71, 0x93, 0xfe, 0x00, 0xc9, 0x89, 0x86, 0x91, 0xd2, 0x2f, 0x9c, 0x51, + 0x04, 0x22, 0x0c, 0x78, 0x61, 0x97, 0x03, 0x73, 0xee, 0x84, 0xea, 0x83, 0x50, 0x11, 0x2f, 0x54, + 0x6d, 0xe2, 0x50, 0xa9, 0x61, 0x9e, 0x21, 0x7d, 0x2f, 0x33, 0x7d, 0x87, 0x3c, 0x24, 0x75, 0xd6, + 0x35, 0x68, 0xfe, 0xfb, 0xb5, 0x3f, 0x38, 0x00, 0x02, 0x5f, 0xa8, 0xd7, 0xc1, 0x72, 0xb5, 0xa4, + 0x29, 0x7a, 0xa9, 0xac, 0x15, 0x4a, 0x45, 0xfd, 0x5e, 0xb1, 0x52, 0x56, 0x36, 0x0b, 0x5b, 0x05, + 0x25, 0xcf, 0x87, 0xd2, 0xf3, 0xdd, 0x5e, 0x26, 0x41, 0x1d, 0x15, 0x37, 0x08, 0x94, 0xc0, 0x7c, + 0xd0, 0xfb, 0xbe, 0x52, 0xe1, 0xb9, 0xf4, 0x6c, 0xb7, 0x97, 0x89, 0x53, 0xaf, 0xfb, 0xc8, 0x81, + 0xd7, 0xc0, 0x42, 0xd0, 0x27, 0x27, 0x57, 0xb4, 0x5c, 0xa1, 0xc8, 0x87, 0xd3, 0x97, 0xba, 0xbd, + 0xcc, 0x2c, 0xf5, 0xcb, 0xb1, 0x75, 0x9a, 0x01, 0x73, 0x41, 0xdf, 0x62, 0x89, 0x8f, 0xa4, 0x93, + 0xdd, 0x5e, 0x66, 0x86, 0xba, 0x15, 0x31, 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x1e, 0xbe, + 0x12, 0x42, 0x2f, 0x5e, 0x09, 0xa1, 0x2f, 0x8e, 0x84, 0xd0, 0xe1, 0x91, 0xc0, 0x3d, 0x3f, 0x12, + 0xb8, 0xdf, 0x8f, 0x04, 0xee, 0xc9, 0xb1, 0x10, 0x7a, 0x7e, 0x2c, 0x84, 0x5e, 0x1c, 0x0b, 0xa1, + 0x07, 0x7f, 0xbf, 0x10, 0xf7, 0xbd, 0x7f, 0xff, 0xbc, 0x7e, 0xde, 0x89, 0x79, 0x3b, 0xe4, 0xff, + 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0x14, 0xb4, 0xf2, 0xfe, 0x19, 0x0e, 0x00, 0x00, } func (this *TextProposal) Equal(that interface{}) bool { @@ -1032,6 +1036,11 @@ func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x22 } } + if m.Option != 0 { + i = encodeVarintGov(dAtA, i, uint64(m.Option)) + i-- + dAtA[i] = 0x18 + } if len(m.Voter) > 0 { i -= len(m.Voter) copy(dAtA[i:], m.Voter) @@ -1305,6 +1314,9 @@ func (m *Vote) Size() (n int) { if l > 0 { n += 1 + l + sovGov(uint64(l)) } + if m.Option != 0 { + n += 1 + sovGov(uint64(m.Option)) + } if len(m.Options) > 0 { for _, e := range m.Options { l = e.Size() @@ -2304,6 +2316,25 @@ func (m *Vote) Unmarshal(dAtA []byte) error { } m.Voter = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType) + } + m.Option = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Option |= VoteOption(b&0x7F) << shift + if b < 0x80 { + break + } + } case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) diff --git a/x/gov/types/vote.go b/x/gov/types/vote.go index 97174fa660..03d1e5a44f 100644 --- a/x/gov/types/vote.go +++ b/x/gov/types/vote.go @@ -13,7 +13,7 @@ import ( // NewVote creates a new Vote instance //nolint:interfacer func NewVote(proposalID uint64, voter sdk.AccAddress, options WeightedVoteOptions) Vote { - return Vote{proposalID, voter.String(), options} + return Vote{ProposalId: proposalID, Voter: voter.String(), Options: options} } func (v Vote) String() string { diff --git a/x/upgrade/types/plan.go b/x/upgrade/types/plan.go index cdafbed889..9e4bc85ab8 100644 --- a/x/upgrade/types/plan.go +++ b/x/upgrade/types/plan.go @@ -17,6 +17,12 @@ func (p Plan) String() string { // ValidateBasic does basic validation of a Plan func (p Plan) ValidateBasic() error { + if !p.Time.IsZero() { + return sdkerrors.ErrInvalidRequest.Wrap("time-based upgrades have been deprecated in the SDK") + } + if p.UpgradedClientState != nil { + return sdkerrors.ErrInvalidRequest.Wrap("upgrade logic for IBC has been moved to the IBC module") + } if len(p.Name) == 0 { return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "name cannot be empty") } diff --git a/x/upgrade/types/plan_test.go b/x/upgrade/types/plan_test.go index 338b737875..bbd969eae0 100644 --- a/x/upgrade/types/plan_test.go +++ b/x/upgrade/types/plan_test.go @@ -9,9 +9,9 @@ import ( "github.com/tendermint/tendermint/libs/log" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/x/upgrade/types" - + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) func mustParseTime(s string) time.Time { @@ -69,6 +69,17 @@ func TestPlanValid(t *testing.T) { Height: 123450000, }, }, + "time-base upgrade": { + p: types.Plan{ + Time: time.Now(), + }, + }, + "IBC upgrade": { + p: types.Plan{ + Height: 123450000, + UpgradedClientState: &codectypes.Any{}, + }, + }, "no due at": { p: types.Plan{ Name: "missing", diff --git a/x/upgrade/types/upgrade.pb.go b/x/upgrade/types/upgrade.pb.go index 50a2cad906..f3b0b2d5ac 100644 --- a/x/upgrade/types/upgrade.pb.go +++ b/x/upgrade/types/upgrade.pb.go @@ -5,19 +5,22 @@ package types import ( fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/codec/types" + types "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -35,12 +38,20 @@ type Plan struct { // assumed that the software is out-of-date when the upgrade Time or Height is // reached and the software will exit. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Deprecated: Time based upgrades have been deprecated. Time based upgrade logic + // has been removed from the SDK. + // If this field is not empty, an error will be thrown. + Time time.Time `protobuf:"bytes,2,opt,name=time,proto3,stdtime" json:"time"` // Deprecated: Do not use. // The height at which the upgrade must be performed. // Only used if Time is not set. Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` // Any application specific upgrade info to be included on-chain // such as a git commit that validators could automatically upgrade to Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` + // Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been + // moved to the IBC module in the sub module 02-client. + // If this field is not empty, an error will be thrown. + UpgradedClientState *types.Any `protobuf:"bytes,5,opt,name=upgraded_client_state,json=upgradedClientState,proto3" json:"upgraded_client_state,omitempty" yaml:"upgraded_client_state"` // Deprecated: Do not use. } func (m *Plan) Reset() { *m = Plan{} } @@ -207,32 +218,36 @@ func init() { } var fileDescriptor_ccf2a7d4d7b48dca = []byte{ - // 398 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x52, 0xc1, 0xaa, 0xd3, 0x40, - 0x14, 0xcd, 0xb4, 0xd3, 0x58, 0xa7, 0x08, 0x25, 0x94, 0x1a, 0x8b, 0x26, 0xa5, 0xb8, 0xe8, 0x42, - 0x13, 0xaa, 0xe0, 0xc2, 0x65, 0x5d, 0x08, 0x05, 0xa1, 0x44, 0x74, 0xe1, 0x6e, 0x92, 0x4c, 0xd3, - 0x68, 0x92, 0x1b, 0x32, 0x93, 0x6a, 0xff, 0x42, 0x70, 0xe3, 0xb2, 0x9f, 0xd3, 0x65, 0x97, 0xae, - 0x44, 0xdb, 0xcd, 0xfb, 0x8c, 0x47, 0x66, 0x92, 0xf7, 0xca, 0xa3, 0xcb, 0xb7, 0x9a, 0x73, 0xee, - 0x9c, 0x39, 0x73, 0xee, 0xe5, 0x92, 0xe7, 0x01, 0xf0, 0x14, 0xb8, 0x5b, 0xe6, 0x51, 0x41, 0x43, - 0xe6, 0x6e, 0x66, 0x3e, 0x13, 0x74, 0xd6, 0x70, 0x27, 0x2f, 0x40, 0x80, 0x31, 0x54, 0x2a, 0xa7, - 0xa9, 0xd6, 0xaa, 0xd1, 0x93, 0x08, 0x20, 0x4a, 0x98, 0x2b, 0x55, 0x7e, 0xb9, 0x72, 0x69, 0xb6, - 0x55, 0x4f, 0x46, 0x83, 0x08, 0x22, 0x90, 0xd0, 0xad, 0x50, 0x5d, 0xb5, 0xef, 0x3e, 0x10, 0x71, - 0xca, 0xb8, 0xa0, 0x69, 0xae, 0x04, 0x93, 0xaf, 0x04, 0x2f, 0x13, 0x9a, 0x19, 0x06, 0xc1, 0x19, - 0x4d, 0x99, 0x89, 0xc6, 0x68, 0xfa, 0xd0, 0x93, 0xd8, 0x18, 0x12, 0x7d, 0xcd, 0xe2, 0x68, 0x2d, - 0xcc, 0xf6, 0x18, 0x4d, 0xdb, 0x5e, 0xcd, 0x2a, 0x6d, 0x9c, 0xad, 0xc0, 0xc4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 0xb9, 0x3f, 0x6e, 0x76, 0x4e, 0x6c, 0x73, 0xc6, 0x7d, 0x5d, 0x2e, 0xc0, 0xeb, - 0xeb, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdd, 0xcd, 0xee, 0x69, 0x92, 0x02, 0x00, 0x00, + // 462 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0x3d, 0x6f, 0xd3, 0x40, + 0x18, 0xf6, 0x51, 0xb7, 0xd0, 0x8b, 0x58, 0x8e, 0x50, 0x4c, 0x54, 0xec, 0xc8, 0x62, 0xc8, 0x00, + 0x67, 0xb5, 0x48, 0x0c, 0xd9, 0x48, 0x07, 0x24, 0x24, 0xa4, 0xca, 0x05, 0x06, 0x96, 0xea, 0x62, + 0x5f, 0x9c, 0x13, 0xe7, 0x3b, 0xcb, 0x77, 0x29, 0xe4, 0x5f, 0x54, 0x62, 0x61, 0xec, 0xcf, 0xc9, + 0xd8, 0x91, 0x29, 0x40, 0xb2, 0x30, 0x33, 0x32, 0xa1, 0xbb, 0xb3, 0x51, 0x04, 0x19, 0x3b, 0xf9, + 0xfd, 0x78, 0xde, 0xe7, 0x79, 0x3f, 0x7c, 0xf0, 0x71, 0x26, 0x55, 0x29, 0x55, 0x32, 0xab, 0x8a, + 0x9a, 0xe4, 0x34, 0xb9, 0x38, 0x1a, 0x53, 0x4d, 0x8e, 0x5a, 0x1f, 0x57, 0xb5, 0xd4, 0x12, 0x1d, + 0x38, 0x14, 0x6e, 0xa3, 0x0d, 0xaa, 0xf7, 0xb0, 0x90, 0xb2, 0xe0, 0x34, 0xb1, 0xa8, 0xf1, 0x6c, + 0x92, 0x10, 0x31, 0x77, 0x25, 0xbd, 0x6e, 0x21, 0x0b, 0x69, 0xcd, 0xc4, 0x58, 0x4d, 0x34, 0xfa, + 0xb7, 0x40, 0xb3, 0x92, 0x2a, 0x4d, 0xca, 0xca, 0x01, 0x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, 0x39, + 0x3e, 0xc4, 0xdb, 0x2f, 0x89, 0xcd, 0xce, 0x47, 0xbe, 0xd9, 0x5a, 0x6a, 0xf1, 0x1b, 0x5d, 0x11, + 0xf8, 0xe8, 0x84, 0x88, 0x8c, 0xf2, 0x1b, 0x6e, 0x6d, 0x43, 0xe2, 0x25, 0xbc, 0xfb, 0x5a, 0xe6, + 0x33, 0x4e, 0xdf, 0xd1, 0x5a, 0x99, 0xae, 0xb7, 0x5d, 0x3f, 0x80, 0xb7, 0x2f, 0x5c, 0xda, 0x92, + 0xf9, 0x69, 0xeb, 0x5a, 0x22, 0x60, 0x88, 0x46, 0xaf, 0x16, 0x3f, 0x42, 0x6f, 0xb1, 0x0a, 0xc1, + 0xf5, 0x2a, 0x04, 0xdf, 0x57, 0x21, 0xb8, 0x5c, 0x87, 0xde, 0xf5, 0x3a, 0xf4, 0xbe, 0xae, 0x43, + 0xef, 0xfd, 0x93, 0x82, 0xe9, 0xe9, 0x6c, 0x8c, 0x33, 0x59, 0x26, 0xcd, 0x7f, 0xef, 0x3e, 0x4f, + 0x55, 0xfe, 0x21, 0xf9, 0xf4, 0xf7, 0x11, 0xe8, 0x79, 0x45, 0xd5, 0x78, 0xcf, 0x9e, 0xf7, 0xd9, + 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x67, 0xe1, 0x07, 0x23, 0x03, 0x00, 0x00, } func (this *Plan) Equal(that interface{}) bool { @@ -257,12 +272,18 @@ func (this *Plan) Equal(that interface{}) bool { if this.Name != that1.Name { return false } + if !this.Time.Equal(that1.Time) { + return false + } if this.Height != that1.Height { return false } if this.Info != that1.Info { return false } + if !this.UpgradedClientState.Equal(that1.UpgradedClientState) { + return false + } return true } func (this *SoftwareUpgradeProposal) Equal(that interface{}) bool { @@ -369,6 +390,18 @@ func (m *Plan) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.UpgradedClientState != nil { + { + size, err := m.UpgradedClientState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUpgrade(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } if len(m.Info) > 0 { i -= len(m.Info) copy(dAtA[i:], m.Info) @@ -381,6 +414,14 @@ func (m *Plan) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x18 } + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintUpgrade(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x12 if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) @@ -531,6 +572,8 @@ func (m *Plan) Size() (n int) { if l > 0 { n += 1 + l + sovUpgrade(uint64(l)) } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time) + n += 1 + l + sovUpgrade(uint64(l)) if m.Height != 0 { n += 1 + sovUpgrade(uint64(m.Height)) } @@ -538,6 +581,10 @@ func (m *Plan) Size() (n int) { if l > 0 { n += 1 + l + sovUpgrade(uint64(l)) } + if m.UpgradedClientState != nil { + l = m.UpgradedClientState.Size() + n += 1 + l + sovUpgrade(uint64(l)) + } return n } @@ -660,6 +707,39 @@ func (m *Plan) Unmarshal(dAtA []byte) error { } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUpgrade + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUpgrade + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUpgrade + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) @@ -711,6 +791,42 @@ func (m *Plan) Unmarshal(dAtA []byte) error { } m.Info = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UpgradedClientState", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUpgrade + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUpgrade + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUpgrade + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.UpgradedClientState == nil { + m.UpgradedClientState = &types.Any{} + } + if err := m.UpgradedClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipUpgrade(dAtA[iNdEx:]) From 8f21e26a6506c9ee81686bad6cf9be3f0e8e11d7 Mon Sep 17 00:00:00 2001 From: likhita-809 <78951027+likhita-809@users.noreply.github.com> Date: Wed, 23 Jun 2021 21:51:59 +0530 Subject: [PATCH 28/50] feat: multisig should accept name, not just address (#9553) ref: #9407 `--multisig` should accept name, not just an address --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [x] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- CHANGELOG.md | 1 + x/auth/client/cli/tx_sign.go | 40 ++++++++++++++++++++------------- x/auth/client/testutil/suite.go | 24 ++++++++++++++++---- 3 files changed, 45 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f07cdbb3b..704fac31a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -129,6 +129,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* (x/auth) [\#9553] (https://github.com/cosmos/cosmos-sdk/pull/9553) The `--multisig` flag now accepts both a name and address. * (gRPC-Web) [\#9493](https://github.com/cosmos/cosmos-sdk/pull/9493) Add `EnableUnsafeCORS` flag to grpc-web config. * (x/params) [\#9481](https://github.com/cosmos/cosmos-sdk/issues/9481) Speedup simulator for parameter change proposals. * (x/staking) [\#9423](https://github.com/cosmos/cosmos-sdk/pull/9423) Staking delegations now returns empty list instead of rpc error when no records found. diff --git a/x/auth/client/cli/tx_sign.go b/x/auth/client/cli/tx_sign.go index 3e8c0599fa..833c034758 100644 --- a/x/auth/client/cli/tx_sign.go +++ b/x/auth/client/cli/tx_sign.go @@ -9,7 +9,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - sdk "github.com/cosmos/cosmos-sdk/types" authclient "github.com/cosmos/cosmos-sdk/x/auth/client" "github.com/cosmos/cosmos-sdk/x/auth/client/rest" ) @@ -48,7 +47,7 @@ account key. It implies --signature-only. Args: cobra.ExactArgs(1), } - cmd.Flags().String(flagMultisig, "", "Address of the multisig account on behalf of which the transaction shall be signed") + cmd.Flags().String(flagMultisig, "", "Address or key name of the multisig account on behalf of which the transaction shall be signed") cmd.Flags().String(flags.FlagOutputDocument, "", "The document will be written to the given file instead of STDOUT") cmd.Flags().Bool(flagSigOnly, true, "Print only the generated signature, then exit") cmd.Flags().String(flags.FlagChainID, "", "network chain ID") @@ -68,14 +67,10 @@ func makeSignBatchCmd() func(cmd *cobra.Command, args []string) error { txCfg := clientCtx.TxConfig printSignatureOnly, _ := cmd.Flags().GetBool(flagSigOnly) infile := os.Stdin - var multisigAddr sdk.AccAddress - // validate multisig address if there's any - if ms, _ := cmd.Flags().GetString(flagMultisig); ms != "" { - multisigAddr, err = sdk.AccAddressFromBech32(ms) - if err != nil { - return err - } + ms, err := cmd.Flags().GetString(flagMultisig) + if err != nil { + return err } // prepare output document @@ -102,7 +97,7 @@ func makeSignBatchCmd() func(cmd *cobra.Command, args []string) error { if err != nil { return err } - if multisigAddr.Empty() { + if ms == "" { from, _ := cmd.Flags().GetString(flags.FlagFrom) _, fromName, _, err := client.GetFromFields(txFactory.Keybase(), from, clientCtx.GenerateOnly) if err != nil { @@ -113,8 +108,15 @@ func makeSignBatchCmd() func(cmd *cobra.Command, args []string) error { return err } } else { + multisigAddr, _, _, err := client.GetFromFields(txFactory.Keybase(), ms, clientCtx.GenerateOnly) + if err != nil { + return fmt.Errorf("error getting account from keybase: %w", err) + } err = authclient.SignTxWithSignerAddress( txFactory, clientCtx, multisigAddr, clientCtx.GetFromName(), txBuilder, clientCtx.Offline, true) + if err != nil { + return err + } } if err != nil { @@ -177,7 +179,7 @@ be generated via the 'multisign' command. Args: cobra.ExactArgs(1), } - cmd.Flags().String(flagMultisig, "", "Address of the multisig account on behalf of which the transaction shall be signed") + cmd.Flags().String(flagMultisig, "", "Address or key name of the multisig account on behalf of which the transaction shall be signed") cmd.Flags().Bool(flagOverwrite, false, "Overwrite existing signatures with a new one. If disabled, new signature will be appended") cmd.Flags().Bool(flagSigOnly, false, "Print only the signatures") cmd.Flags().String(flags.FlagOutputDocument, "", "The document will be written to the given file instead of STDOUT") @@ -213,6 +215,7 @@ func makeSignCmd() func(cmd *cobra.Command, args []string) error { return err } + txFactory := tx.NewFactoryCLI(clientCtx, cmd.Flags()) txCfg := clientCtx.TxConfig txBuilder, err := txCfg.WrapTxBuilder(newTx) if err != nil { @@ -220,7 +223,10 @@ func makeSignCmd() func(cmd *cobra.Command, args []string) error { } printSignatureOnly, _ := cmd.Flags().GetBool(flagSigOnly) - multisigAddrStr, _ := cmd.Flags().GetString(flagMultisig) + multisig, _ := cmd.Flags().GetString(flagMultisig) + if err != nil { + return err + } from, _ := cmd.Flags().GetString(flags.FlagFrom) _, fromName, _, err := client.GetFromFields(txF.Keybase(), from, clientCtx.GenerateOnly) if err != nil { @@ -228,14 +234,16 @@ func makeSignCmd() func(cmd *cobra.Command, args []string) error { } overwrite, _ := f.GetBool(flagOverwrite) - if multisigAddrStr != "" { - var multisigAddr sdk.AccAddress - multisigAddr, err = sdk.AccAddressFromBech32(multisigAddrStr) + if multisig != "" { + multisigAddr, _, _, err := client.GetFromFields(txFactory.Keybase(), multisig, clientCtx.GenerateOnly) if err != nil { - return err + return fmt.Errorf("error getting account from keybase: %w", err) } err = authclient.SignTxWithSignerAddress( txF, clientCtx, multisigAddr, fromName, txBuilder, clientCtx.Offline, overwrite) + if err != nil { + return err + } printSignatureOnly = true } else { err = authclient.SignTx(txF, clientCtx, clientCtx.GetFromName(), txBuilder, clientCtx.Offline, overwrite) diff --git a/x/auth/client/testutil/suite.go b/x/auth/client/testutil/suite.go index 9456260c89..773f8dba1a 100644 --- a/x/auth/client/testutil/suite.go +++ b/x/auth/client/testutil/suite.go @@ -129,7 +129,7 @@ func (s *IntegrationTestSuite) TestCLISignBatch() { s.Require().NoError(err) s.Require().Equal(3, len(strings.Split(strings.Trim(res.String(), "\n"), "\n"))) - // sign-batch file + // sign-batch file signature only res, err = TxSignBatchExec(val.ClientCtx, val.Address, outputFile.Name(), fmt.Sprintf("--%s=%s", flags.FlagChainID, val.ClientCtx.ChainID), "--signature-only") s.Require().NoError(err) s.Require().Equal(3, len(strings.Split(strings.Trim(res.String(), "\n"), "\n"))) @@ -756,11 +756,19 @@ func (s *IntegrationTestSuite) TestSignBatchMultisig() { res, err = TxSignBatchExec(val.ClientCtx, account2.GetAddress(), filename.Name(), fmt.Sprintf("--%s=%s", flags.FlagChainID, val.ClientCtx.ChainID), "--multisig", multisigInfo.GetAddress().String()) s.Require().NoError(err) s.Require().Equal(1, len(strings.Split(strings.Trim(res.String(), "\n"), "\n"))) - // write sigs to file2 file2 := testutil.WriteToNewTempFile(s.T(), res.String()) - _, err = TxMultiSignExec(val.ClientCtx, multisigInfo.GetName(), filename.Name(), file1.Name(), file2.Name()) + + // sign-batch file with multisig key name + res, err = TxSignBatchExec(val.ClientCtx, account1.GetAddress(), filename.Name(), fmt.Sprintf("--%s=%s", flags.FlagChainID, val.ClientCtx.ChainID), "--multisig", multisigInfo.GetName()) s.Require().NoError(err) + s.Require().Equal(1, len(strings.Split(strings.Trim(res.String(), "\n"), "\n"))) + // write sigs to file3 + file3 := testutil.WriteToNewTempFile(s.T(), res.String()) + + _, err = TxMultiSignExec(val.ClientCtx, multisigInfo.GetName(), filename.Name(), file1.Name(), file2.Name(), file3.Name()) + s.Require().NoError(err) + } func (s *IntegrationTestSuite) TestMultisignBatch() { @@ -821,7 +829,15 @@ func (s *IntegrationTestSuite) TestMultisignBatch() { // multisign the file file2 := testutil.WriteToNewTempFile(s.T(), res.String()) - res, err = TxMultiSignBatchExec(val.ClientCtx, filename.Name(), multisigInfo.GetName(), file1.Name(), file2.Name()) + + // sign-batch file with multisig key name + res, err = TxSignBatchExec(val.ClientCtx, account1.GetAddress(), filename.Name(), fmt.Sprintf("--%s=%s", flags.FlagChainID, val.ClientCtx.ChainID), "--multisig", multisigInfo.GetName(), fmt.Sprintf("--%s", flags.FlagOffline), fmt.Sprintf("--%s=%s", flags.FlagAccountNumber, fmt.Sprint(account.GetAccountNumber())), fmt.Sprintf("--%s=%s", flags.FlagSequence, fmt.Sprint(account.GetSequence()))) + s.Require().NoError(err) + s.Require().Equal(3, len(strings.Split(strings.Trim(res.String(), "\n"), "\n"))) + // write sigs to file + file3 := testutil.WriteToNewTempFile(s.T(), res.String()) + + res, err = TxMultiSignBatchExec(val.ClientCtx, filename.Name(), multisigInfo.GetName(), file1.Name(), file2.Name(), file3.Name()) s.Require().NoError(err) signedTxs := strings.Split(strings.Trim(res.String(), "\n"), "\n") From e845a500880f5980d57cbd8b833d41e852e33ba6 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Thu, 24 Jun 2021 12:07:16 +0200 Subject: [PATCH 29/50] fix(keyring): update keyring for kwallet fix (#9563) ## Description Closes: #9562 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [x] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- CHANGELOG.md | 2 ++ go.mod | 2 ++ go.sum | 5 ++--- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 704fac31a8..7012acede5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -152,6 +152,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/slashing) [\#8427](https://github.com/cosmos/cosmos-sdk/pull/8427) Fix query signing infos command * (x/bank) [\#9229](https://github.com/cosmos/cosmos-sdk/pull/9229) Now zero coin balances cannot be added to balances & supply stores. If any denom becomes zero corresponding key gets deleted from store. * (types) [\#9511](https://github.com/cosmos/cosmos-sdk/pull/9511) Change `maxBitLen` of `sdk.Int` and `sdk.Dec` to handle max ERC20 value. +* (keyring) [\#9562](https://github.com/cosmos/cosmos-sdk/pull/9563) fix keyring kwallet backend when using with empty wallet. + ### Deprecated diff --git a/go.mod b/go.mod index 9afe37fcbd..16ff3d0392 100644 --- a/go.mod +++ b/go.mod @@ -57,3 +57,5 @@ require ( replace google.golang.org/grpc => google.golang.org/grpc v1.33.2 replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 + +replace github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 diff --git a/go.sum b/go.sum index aaa9d8d323..9d5eba51d9 100644 --- a/go.sum +++ b/go.sum @@ -38,8 +38,6 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-beta.2 h1:/BZRNzm8N4K4eWfK28dL4yescorxtO7YG1yun8fy+pI= filippo.io/edwards25519 v1.0.0-beta.2/go.mod h1:X+pm78QAUPtFLi1z9PYIlS/bdDnvbCOGKtZ+ACWEf7o= -github.com/99designs/keyring v1.1.6 h1:kVDC2uCgVwecxCk+9zoCt2uEL6dt+dfVzMvGgnVcIuM= -github.com/99designs/keyring v1.1.6/go.mod h1:16e0ds7LGQQcT59QqkTg72Hh5ShM51Byv5PEmW6uoRU= github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= @@ -168,6 +166,8 @@ github.com/cosmos/iavl v0.15.0-rc5/go.mod h1:WqoPL9yPTQ85QBMT45OOUzPxG/U/JcJoN7u github.com/cosmos/iavl v0.15.3/go.mod h1:OLjQiAQ4fGD2KDZooyJG9yz+p2ao2IAYSbke8mVvSA4= github.com/cosmos/iavl v0.16.0 h1:ICIOB8xysirTX27GmVAaoeSpeozzgSu9d49w36xkVJA= github.com/cosmos/iavl v0.16.0/go.mod h1:2A8O/Jz9YwtjqXMO0CjnnbTYEEaovE8jWcwrakH3PoE= +github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 h1:DdzS1m6o/pCqeZ8VOAit/gyATedRgjvkVI+UCrLpyuU= +github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76/go.mod h1:0mkLWIoZuQ7uBoospo5Q9zIpqq6rYCPJDSUdeCJvPM8= github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4= github.com/cosmos/ledger-cosmos-go v0.11.1/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= github.com/cosmos/ledger-go v0.9.2 h1:Nnao/dLwaVTk1Q5U9THldpUMMXU94BOTWPddSmVB6pI= @@ -517,7 +517,6 @@ github.com/minio/highwayhash v1.0.1 h1:dZ6IIu8Z14VlC0VpfKofAhCy74wu/Qb5gcn52yWoz github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= From bb61e2890f81c6061f5aba4d9c68fa99383ede2c Mon Sep 17 00:00:00 2001 From: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Date: Thu, 24 Jun 2021 06:51:30 -0400 Subject: [PATCH 30/50] feat: return trace value from baseapp (#9578) ## Description Closes: #XXXX --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed all author checklist items have been addressed - [ ] confirmed that this PR does not change production code --- CHANGELOG.md | 1 + baseapp/baseapp.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7012acede5..7c5074bbfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -129,6 +129,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* (baseapp) [\#9578](https://github.com/cosmos/cosmos-sdk/pull/9578) Return `Baseapp`'s `trace` value for logging error stack traces. * (x/auth) [\#9553] (https://github.com/cosmos/cosmos-sdk/pull/9553) The `--multisig` flag now accepts both a name and address. * (gRPC-Web) [\#9493](https://github.com/cosmos/cosmos-sdk/pull/9493) Add `EnableUnsafeCORS` flag to grpc-web config. * (x/params) [\#9481](https://github.com/cosmos/cosmos-sdk/issues/9481) Speedup simulator for parameter change proposals. diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 6c66e6e008..ba5ec2696e 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -190,6 +190,11 @@ func (app *BaseApp) Logger() log.Logger { return app.logger } +// Trace returns the boolean value for logging error stack traces. +func (app *BaseApp) Trace() bool { + return app.trace +} + // MsgServiceRouter returns the MsgServiceRouter of a BaseApp. func (app *BaseApp) MsgServiceRouter() *MsgServiceRouter { return app.msgServiceRouter } From 3fd376bd5659f076a4dc79b644573299fd1ec1bf Mon Sep 17 00:00:00 2001 From: Andrei Ivasko Date: Fri, 25 Jun 2021 06:41:32 -0400 Subject: [PATCH 31/50] feat: Non-zero Default Fees (#9371) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description closes: #9106 --- Before we can merge this PR, please make sure that all the following items have been checked off. If any of the checklist items are not applicable, please leave them but write a little note why. - [x] Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. - [ ] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules/structure.md). - [ ] Wrote unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] Updated relevant documentation (`docs/`) or specification (`x//spec/`) - [ ] Added relevant `godoc` [comments](https://blog.golang.org/godoc-documenting-go-code). - [ ] Added a relevant changelog entry to the `Unreleased` section in `CHANGELOG.md` - [ ] Re-reviewed `Files changed` in the Github PR explorer - [ ] Review `Codecov Report` in the comment section below once CI passes --- CHANGELOG.md | 7 ++ contrib/rosetta/node/data.tar.gz | Bin 40794 -> 38887 bytes docs/core/cli.md | 6 +- docs/run-node/run-node.md | 24 +++++-- server/config/config.go | 10 +++ server/start.go | 7 +- server/util_test.go | 118 ++++++++++++++++++++----------- simapp/simd/cmd/root.go | 21 +++++- testutil/network/util.go | 4 ++ types/errors/errors.go | 3 + 10 files changed, 149 insertions(+), 51 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c5074bbfc..8f77082115 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [\#9205](https://github.com/cosmos/cosmos-sdk/pull/9205) Improve readability in `abci` handleQueryP2P * [\#9314](https://github.com/cosmos/cosmos-sdk/pull/9314) Update Rosetta SDK to upstream's latest release. + ### Features * [\#8077](https://github.com/cosmos/cosmos-sdk/pull/8077) Added support for grpc-web, enabling browsers to communicate with a chain's gRPC server @@ -127,6 +128,12 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (store) [\#8790](https://github.com/cosmos/cosmos-sdk/pull/8790) Reduce gas costs by 10x for transient store operations. * (x/bank) [\#9051](https://github.com/cosmos/cosmos-sdk/pull/9051) Supply value is stored as `sdk.Int` rather than `string`. + +### CLI Breaking Changes + +* [\#9371](https://github.com/cosmos/cosmos-sdk/pull/9371) Non-zero default fees/Server will error if there's an empty value for min-gas-price in app.toml + + ### Improvements * (baseapp) [\#9578](https://github.com/cosmos/cosmos-sdk/pull/9578) Return `Baseapp`'s `trace` value for logging error stack traces. diff --git a/contrib/rosetta/node/data.tar.gz b/contrib/rosetta/node/data.tar.gz index 3c37adcc162f05b37a08fd082a7c2c0ecb1919c4..81ad29831d2ba70a0d4e5a11a8ac615cb2e2fc2e 100644 GIT binary patch literal 38887 zcmV)3K+C@$iwFP!000001MEEgQ`<U}D5ctLMDC0S!RAlj=V`(- z==JDdc*_6M&#i8=-|MvdgKq1mW~<$5^?zc$@3f!76Gw`NjQtb>A=bfNHU1ZU!aV5tvXjf=sz@xKlH?{xazJO1CsQ^kMoIN?ajv&P3r`Zur!GPvLEuI4{5yU7236Tn&X z2G+jv`G3y;FSY-%&cwpnVOG1-+3JkieB^Z7E#7aoyKP~&dEeRq7?g7^tU)TitoO;kEztUs|L^rWclv)T&pmcJbt4A<=j`<8@CDN{ zz{aj88nt`uu?*QvhJv~NScWsMTKi5?i)U2Z%%3>KbrnFy816Ye-MQe4*wtJY)8hyFPpNs7623U57nnmSupz z?1rvC`8i@EZl4L?*;n{&?->TAHG=&KTu`Z^Q9 zpv8ll!B;ofa48w#V*4+iF&V2MR!sAd-B;p5eMR^Fpk_t@8eby(Kc+HL|J?aUAVc*} zrX)KBbRwL&K;7e4`ydKRgkx?CL4!Iw3 zn>aHHC3kEdDcCcJ7|gsMEqwbcr~i&%_Su743RIsN+&F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k!`Hhsa(&0WhC%%sTj`F(yoP5@crK;8}e|L&;zxraA?&pK$QpJa5gD=TPtaYeYI0 z4j$Jhe$tcJsaBm1!DMht@i;u_kR87pj70|>vLkIMS{vrrAH4-FlwjZot^oMaf-1pbR7o%< z18;@Nh|29J9+%6Pq(!?CtJ|Gqv-+$_=*D3$vdW{0)>fF5o@q?$qz!qi!m})PW7iUT zZN8^i8Gc9dB+FqW#WO685oDK?5Rfu7sCfvYxgsLzLBD@T1@!-q^%>(W=Ior2HyqUg z0sYVOA^z8)op;p#-67k^91B{#sRlZva>-#U)EX*%Qia_s8C|9FG~{!6)L0Ky47Psx zp14>{rB?M&$H2)(m1d8}dPbJU9_q0e`kM z3mG7C0{$F(sbqFo-CoHSlp|Ir&;nsAOmVp-Cn0~J4Mp(pBFi&Gx#aPp=AD9E@00U9 zC11`iX^^i)@?+2&oJfkIoMMU9X-A`>tWOiENIgi2r$m}7-9JTBhosGX*>SIhz!Z;+7tg_M2-_#ApV1tc#&)s|Dm-a$x*j-_$N&NcYEyR1?5(U z-6jwI1#%rp+7hqJ*dkT{A+ksznPOGoXBgyKbBiEZ=IJqo~t;i^zVJ1siuEZ*M9J4FT zY`P)iCxv2Gsi{Ig$u)`d8XmU%RLV?$*kd9YpVeNH^vHNRSIVx`nviZsKT zDAquk11_N(mOq7`?&7y@inK^;u^*qT?j81Q%P(sK8g|4K|Vj&s9!lQ4DCNpC} zY4emp&x@46QF=}kI5R64d6UVarwxLEGOz|SM~f^kh( Date: Fri, 25 Jun 2021 04:55:58 -0700 Subject: [PATCH 32/50] fix: added key when dry-run is true (#9480) ## Description Closes: #9475 This pull request ensures a key is not added after running `keys add` with `--dry-run`. This pull request also adds consistent output information for each key (previously multisig and pubkey did not print info). --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] added `!` to the type prefix if API or client breaking change - **n/a** - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - **n/a** - [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [x] included comments for [documenting Go code](https://blog.golang.org/godoc) - **n/a** - [x] updated the relevant documentation or specification - **n/a** - [x] reviewed "Files changed" and left comments if necessary - [x] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- CHANGELOG.md | 1 + client/keys/add.go | 30 +++++---- client/keys/add_ledger_test.go | 65 +++++++++++++++++++ client/keys/add_test.go | 113 +++++++++++++++++++++++++++++++++ crypto/keyring/keyring.go | 2 +- 5 files changed, 199 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f77082115..0a08488f9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +* [\#9480](https://github.com/cosmos/cosmos-sdk/pull/9480) Fix added keys when using `--dry-run`. * [\#9540](https://github.com/cosmos/cosmos-sdk/pull/9540) Add output flag for query txs command. * [\#9460](https://github.com/cosmos/cosmos-sdk/pull/9460) Fix lint error in `MigratePrefixAddress`. * [\#9231](https://github.com/cosmos/cosmos-sdk/pull/9231) Remove redundant staking errors. diff --git a/client/keys/add.go b/client/keys/add.go index d043632051..2e915925d8 100644 --- a/client/keys/add.go +++ b/client/keys/add.go @@ -88,7 +88,7 @@ func runAddCmdPrepare(cmd *cobra.Command, args []string) error { return err } - return RunAddCmd(clientCtx, cmd, args, buf) + return runAddCmd(clientCtx, cmd, args, buf) } /* @@ -100,7 +100,7 @@ input output - armor encrypted private key (saved to file) */ -func RunAddCmd(ctx client.Context, cmd *cobra.Command, args []string, inBuf *bufio.Reader) error { +func runAddCmd(ctx client.Context, cmd *cobra.Command, args []string, inBuf *bufio.Reader) error { var err error name := args[0] @@ -117,7 +117,10 @@ func RunAddCmd(ctx client.Context, cmd *cobra.Command, args []string, inBuf *buf return err } - if dryRun, _ := cmd.Flags().GetBool(flags.FlagDryRun); !dryRun { + if dryRun, _ := cmd.Flags().GetBool(flags.FlagDryRun); dryRun { + // use in memory keybase + kb = keyring.NewInMemory() + } else { _, err = kb.Key(name) if err == nil { // account exists, ask for user confirmation @@ -138,19 +141,19 @@ func RunAddCmd(ctx client.Context, cmd *cobra.Command, args []string, inBuf *buf multisigKeys, _ := cmd.Flags().GetStringSlice(flagMultisig) if len(multisigKeys) != 0 { - var pks []cryptotypes.PubKey + pks := make([]cryptotypes.PubKey, len(multisigKeys)) multisigThreshold, _ := cmd.Flags().GetInt(flagMultiSigThreshold) if err := validateMultisigThreshold(multisigThreshold, len(multisigKeys)); err != nil { return err } - for _, keyname := range multisigKeys { + for i, keyname := range multisigKeys { k, err := kb.Key(keyname) if err != nil { return err } - pks = append(pks, k.GetPubKey()) + pks[i] = k.GetPubKey() } if noSort, _ := cmd.Flags().GetBool(flagNoSort); !noSort { @@ -160,12 +163,12 @@ func RunAddCmd(ctx client.Context, cmd *cobra.Command, args []string, inBuf *buf } pk := multisig.NewLegacyAminoPubKey(multisigThreshold, pks) - if _, err := kb.SaveMultisig(name, pk); err != nil { + info, err := kb.SaveMultisig(name, pk) + if err != nil { return err } - cmd.PrintErrf("Key %q saved to disk.\n", name) - return nil + return printCreate(cmd, info, false, "", outputFormat) } } @@ -176,8 +179,13 @@ func RunAddCmd(ctx client.Context, cmd *cobra.Command, args []string, inBuf *buf if err != nil { return err } - _, err := kb.SavePubKey(name, pk, algo.Name()) - return err + + info, err := kb.SavePubKey(name, pk, algo.Name()) + if err != nil { + return err + } + + return printCreate(cmd, info, false, "", outputFormat) } coinType, _ := cmd.Flags().GetUint32(flagCoinType) diff --git a/client/keys/add_ledger_test.go b/client/keys/add_ledger_test.go index a5fcc304dd..69ccb32a42 100644 --- a/client/keys/add_ledger_test.go +++ b/client/keys/add_ledger_test.go @@ -3,8 +3,10 @@ package keys import ( + "bytes" "context" "fmt" + "io/ioutil" "testing" "github.com/stretchr/testify/require" @@ -124,3 +126,66 @@ func Test_runAddCmdLedger(t *testing.T) { "PubKeySecp256k1{034FEF9CD7C4C63588D3B03FEB5281B9D232CBA34D6F3D71AEE59211FFBFE1FE87}", key1.GetPubKey().String()) } + +func Test_runAddCmdLedgerDryRun(t *testing.T) { + testData := []struct { + name string + args []string + added bool + }{ + { + name: "ledger account is added", + args: []string{ + "testkey", + fmt.Sprintf("--%s=%s", flags.FlagDryRun, "false"), + fmt.Sprintf("--%s=%s", flags.FlagUseLedger, "true"), + }, + added: true, + }, + { + name: "ledger account is not added with dry run", + args: []string{ + "testkey", + fmt.Sprintf("--%s=%s", flags.FlagDryRun, "true"), + fmt.Sprintf("--%s=%s", flags.FlagUseLedger, "true"), + }, + added: false, + }, + } + for _, tt := range testData { + tt := tt + t.Run(tt.name, func(t *testing.T) { + cmd := AddKeyCommand() + cmd.Flags().AddFlagSet(Commands("home").PersistentFlags()) + + kbHome := t.TempDir() + mockIn := testutil.ApplyMockIODiscardOutErr(cmd) + kb, err := keyring.New(sdk.KeyringServiceName(), keyring.BackendTest, kbHome, mockIn) + require.NoError(t, err) + + clientCtx := client.Context{}. + WithKeyringDir(kbHome). + WithKeyring(kb) + ctx := context.WithValue(context.Background(), client.ClientContextKey, &clientCtx) + + b := bytes.NewBufferString("") + cmd.SetOut(b) + + cmd.SetArgs(tt.args) + require.NoError(t, cmd.ExecuteContext(ctx)) + + if tt.added { + _, err = kb.Key("testkey") + require.NoError(t, err) + + out, err := ioutil.ReadAll(b) + require.NoError(t, err) + require.Contains(t, string(out), "name: testkey") + } else { + _, err = kb.Key("testkey") + require.Error(t, err) + require.Equal(t, "testkey.info: key not found", err.Error()) + } + }) + } +} diff --git a/client/keys/add_test.go b/client/keys/add_test.go index aa6f68876a..06375257a4 100644 --- a/client/keys/add_test.go +++ b/client/keys/add_test.go @@ -1,8 +1,10 @@ package keys import ( + "bytes" "context" "fmt" + "io/ioutil" "testing" "github.com/stretchr/testify/require" @@ -13,6 +15,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" + "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -114,3 +117,113 @@ func Test_runAddCmdBasic(t *testing.T) { mockIn.Reset("\n" + password + "\n" + "fail" + "\n") require.Error(t, cmd.ExecuteContext(ctx)) } + +func Test_runAddCmdDryRun(t *testing.T) { + pubkey1 := `{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AtObiFVE4s+9+RX5SP8TN9r2mxpoaT4eGj9CJfK7VRzN"}` + pubkey2 := `{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A/se1vkqgdQ7VJQCM4mxN+L+ciGhnnJ4XYsQCRBMrdRi"}` + + testData := []struct { + name string + args []string + added bool + }{ + { + name: "account is added", + args: []string{ + "testkey", + fmt.Sprintf("--%s=%s", flags.FlagDryRun, "false"), + }, + added: true, + }, + { + name: "account is not added with dry run", + args: []string{ + "testkey", + fmt.Sprintf("--%s=%s", flags.FlagDryRun, "true"), + }, + added: false, + }, + { + name: "multisig account is added", + args: []string{ + "testkey", + fmt.Sprintf("--%s=%s", flags.FlagDryRun, "false"), + fmt.Sprintf("--%s=%s", flagMultisig, "subkey"), + }, + added: true, + }, + { + name: "multisig account is not added with dry run", + args: []string{ + "testkey", + fmt.Sprintf("--%s=%s", flags.FlagDryRun, "true"), + fmt.Sprintf("--%s=%s", flagMultisig, "subkey"), + }, + added: false, + }, + { + name: "pubkey account is added", + args: []string{ + "testkey", + fmt.Sprintf("--%s=%s", flags.FlagDryRun, "false"), + fmt.Sprintf("--%s=%s", FlagPublicKey, pubkey1), + }, + added: true, + }, + { + name: "pubkey account is not added with dry run", + args: []string{ + "testkey", + fmt.Sprintf("--%s=%s", flags.FlagDryRun, "true"), + fmt.Sprintf("--%s=%s", FlagPublicKey, pubkey2), + }, + added: false, + }, + } + for _, tt := range testData { + tt := tt + t.Run(tt.name, func(t *testing.T) { + cmd := AddKeyCommand() + cmd.Flags().AddFlagSet(Commands("home").PersistentFlags()) + + kbHome := t.TempDir() + mockIn := testutil.ApplyMockIODiscardOutErr(cmd) + kb, err := keyring.New(sdk.KeyringServiceName(), keyring.BackendTest, kbHome, mockIn) + require.NoError(t, err) + + appCodec := simapp.MakeTestEncodingConfig().Marshaler + clientCtx := client.Context{}. + WithJSONCodec(appCodec). + WithKeyringDir(kbHome). + WithKeyring(kb) + ctx := context.WithValue(context.Background(), client.ClientContextKey, &clientCtx) + + path := sdk.GetConfig().GetFullBIP44Path() + _, err = kb.NewAccount("subkey", testutil.TestMnemonic, "", path, hd.Secp256k1) + require.NoError(t, err) + + t.Cleanup(func() { + _ = kb.Delete("subkey") + }) + + b := bytes.NewBufferString("") + cmd.SetOut(b) + + cmd.SetArgs(tt.args) + require.NoError(t, cmd.ExecuteContext(ctx)) + + if tt.added { + _, err = kb.Key("testkey") + require.NoError(t, err) + + out, err := ioutil.ReadAll(b) + require.NoError(t, err) + require.Contains(t, string(out), "name: testkey") + } else { + _, err = kb.Key("testkey") + require.Error(t, err) + require.Equal(t, "testkey.info: key not found", err.Error()) + } + }) + } +} diff --git a/crypto/keyring/keyring.go b/crypto/keyring/keyring.go index 7ec770ae86..eb57624976 100644 --- a/crypto/keyring/keyring.go +++ b/crypto/keyring/keyring.go @@ -760,7 +760,7 @@ func (ks keystore) writeInfo(info Info) error { return err } if exists { - return errors.New("public key already exist in keybase") + return errors.New("public key already exists in keybase") } err = ks.db.Set(keyring.Item{ From 7c0e6939c13593db8243346c73b3c0c09a31699c Mon Sep 17 00:00:00 2001 From: Amaury <1293565+amaurym@users.noreply.github.com> Date: Fri, 25 Jun 2021 15:52:44 +0200 Subject: [PATCH 33/50] fix: Correctly populate legacy Vote.Option field (#9583) --- CHANGELOG.md | 1 + docs/core/proto-docs.md | 2 +- proto/cosmos/gov/v1beta1/gov.proto | 2 +- x/gov/keeper/grpc_query.go | 1 + x/gov/keeper/grpc_query_test.go | 4 ++-- x/gov/types/gov.pb.go | 4 ++-- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a08488f9c..19db5a5049 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -162,6 +162,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/bank) [\#9229](https://github.com/cosmos/cosmos-sdk/pull/9229) Now zero coin balances cannot be added to balances & supply stores. If any denom becomes zero corresponding key gets deleted from store. * (types) [\#9511](https://github.com/cosmos/cosmos-sdk/pull/9511) Change `maxBitLen` of `sdk.Int` and `sdk.Dec` to handle max ERC20 value. * (keyring) [\#9562](https://github.com/cosmos/cosmos-sdk/pull/9563) fix keyring kwallet backend when using with empty wallet. +* (keyring) [\#9583](https://github.com/cosmos/cosmos-sdk/pull/9583) Fix correct population of legacy `Vote.Option` field for votes with 1 VoteOption of weight 1. ### Deprecated diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index c4e33fd6d3..6b2ddbe1e4 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -4987,7 +4987,7 @@ A Vote consists of a proposal ID, the voter, and the vote option. | ----- | ---- | ----- | ----------- | | `proposal_id` | [uint64](#uint64) | | | | `voter` | [string](#string) | | | -| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | **Deprecated.** Deprecated: Prefer to use `options` instead. This field is set in queries if an only if `len(options) == 1` and that option has weight 1. In all other cases, this field will default to OptionEmpty. | +| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | **Deprecated.** Deprecated: Prefer to use `options` instead. This field is set in queries if and only if `len(options) == 1` and that option has weight 1. In all other cases, this field will default to VOTE_OPTION_UNSPECIFIED. | | `options` | [WeightedVoteOption](#cosmos.gov.v1beta1.WeightedVoteOption) | repeated | | diff --git a/proto/cosmos/gov/v1beta1/gov.proto b/proto/cosmos/gov/v1beta1/gov.proto index b38c14d06c..f040772e8e 100644 --- a/proto/cosmos/gov/v1beta1/gov.proto +++ b/proto/cosmos/gov/v1beta1/gov.proto @@ -133,7 +133,7 @@ message Vote { string voter = 2; // Deprecated: Prefer to use `options` instead. This field is set in queries // if and only if `len(options) == 1` and that option has weight 1. In all - // other cases, this field will default to OptionEmpty. + // other cases, this field will default to VOTE_OPTION_UNSPECIFIED. VoteOption option = 3 [deprecated = true]; repeated WeightedVoteOption options = 4 [(gogoproto.nullable) = false]; } diff --git a/x/gov/keeper/grpc_query.go b/x/gov/keeper/grpc_query.go index ceb563b0cb..5caf220f77 100644 --- a/x/gov/keeper/grpc_query.go +++ b/x/gov/keeper/grpc_query.go @@ -142,6 +142,7 @@ func (q Keeper) Votes(c context.Context, req *types.QueryVotesRequest) (*types.Q if err := q.cdc.Unmarshal(value, &vote); err != nil { return err } + populateLegacyOption(&vote) votes = append(votes, vote) return nil diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index 49505d1f6b..0e7d6f2510 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -395,8 +395,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { app.GovKeeper.SetProposal(ctx, proposal) votes = []types.Vote{ - {ProposalId: proposal.ProposalId, Voter: addrs[0].String(), Options: types.NewNonSplitVoteOption(types.OptionAbstain)}, - {ProposalId: proposal.ProposalId, Voter: addrs[1].String(), Options: types.NewNonSplitVoteOption(types.OptionYes)}, + {ProposalId: proposal.ProposalId, Voter: addrs[0].String(), Option: types.OptionAbstain, Options: types.NewNonSplitVoteOption(types.OptionAbstain)}, + {ProposalId: proposal.ProposalId, Voter: addrs[1].String(), Option: types.OptionYes, Options: types.NewNonSplitVoteOption(types.OptionYes)}, } accAddr1, err1 := sdk.AccAddressFromBech32(votes[0].Voter) accAddr2, err2 := sdk.AccAddressFromBech32(votes[1].Voter) diff --git a/x/gov/types/gov.pb.go b/x/gov/types/gov.pb.go index 013c0fa730..b13f514699 100644 --- a/x/gov/types/gov.pb.go +++ b/x/gov/types/gov.pb.go @@ -329,8 +329,8 @@ type Vote struct { ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty" yaml:"proposal_id"` Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` // Deprecated: Prefer to use `options` instead. This field is set in queries - // if an only if `len(options) == 1` and that option has weight 1. In all - // other cases, this field will default to OptionEmpty. + // if and only if `len(options) == 1` and that option has weight 1. In all + // other cases, this field will default to VOTE_OPTION_UNSPECIFIED. Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"` // Deprecated: Do not use. Options []WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options"` } From 53262802fc174297da26c6b4fa85b4a6c73ea6b8 Mon Sep 17 00:00:00 2001 From: Amaury <1293565+amaurym@users.noreply.github.com> Date: Fri, 25 Jun 2021 15:58:12 +0200 Subject: [PATCH 34/50] chore: Create v0.43.0-rc0 section in CHANGELOG (#9572) * chore: Create v0.43.0-rc0 section in CHANGELOG * re-org items * order items * Reorder items * Reorder again * Update CHANGELOG.md --- CHANGELOG.md | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19db5a5049..6e5a759a82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,8 @@ Types of changes (Stanzas): "Improvements" for changes in existing functionality. "Deprecated" for soon-to-be removed features. "Bug Fixes" for any bug fixes. -"Client Breaking" for breaking CLI commands and REST routes used by end-users. +"Client Breaking" for breaking Protobuf, gRPC and REST routes used by end-users. +"CLI Breaking" for breaking CLI commands. "API Breaking" for breaking exported APIs used by developers building on SDK. "State Machine Breaking" for any changes that result in a different AppState given same genesisState and txList. Ref: https://keepachangelog.com/en/1.0.0/ @@ -36,13 +37,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] -* [\#9480](https://github.com/cosmos/cosmos-sdk/pull/9480) Fix added keys when using `--dry-run`. -* [\#9540](https://github.com/cosmos/cosmos-sdk/pull/9540) Add output flag for query txs command. -* [\#9460](https://github.com/cosmos/cosmos-sdk/pull/9460) Fix lint error in `MigratePrefixAddress`. -* [\#9231](https://github.com/cosmos/cosmos-sdk/pull/9231) Remove redundant staking errors. -* [\#9205](https://github.com/cosmos/cosmos-sdk/pull/9205) Improve readability in `abci` handleQueryP2P -* [\#9314](https://github.com/cosmos/cosmos-sdk/pull/9314) Update Rosetta SDK to upstream's latest release. - +## [v0.43.0-rc0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.43.0-rc0) - 2021-06-25 ### Features @@ -52,31 +47,29 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [\#8786](https://github.com/cosmos/cosmos-sdk/pull/8786) Enabled secp256r1 in x/auth. * (rosetta) [\#8729](https://github.com/cosmos/cosmos-sdk/pull/8729) Data API fully supports balance tracking. Construction API can now construct any message supported by the application. * [\#8754](https://github.com/cosmos/cosmos-sdk/pull/8875) Added support for reverse iteration to pagination. +* (types) [\#9079](https://github.com/cosmos/cosmos-sdk/issues/9079) Add `AddAmount`/`SubAmount` methods to `sdk.Coin`. * [#9088](https://github.com/cosmos/cosmos-sdk/pull/9088) Added implementation to ADR-28 Derived Addresses. * [\#9133](https://github.com/cosmos/cosmos-sdk/pull/9133) Added hooks for governance actions. * (x/staking) [\#9214](https://github.com/cosmos/cosmos-sdk/pull/9214) Added `new_shares` attribute inside `EventTypeDelegate` event. * [\#9382](https://github.com/cosmos/cosmos-sdk/pull/9382) feat: add Dec.Float64() function. * [\#9457](https://github.com/cosmos/cosmos-sdk/pull/9457) Add amino support for x/authz and x/feegrant Msgs. * [\#9498](https://github.com/cosmos/cosmos-sdk/pull/9498) Added `Codec: codec.Codec` attribute to `client/Context` structure. +* [\#9540](https://github.com/cosmos/cosmos-sdk/pull/9540) Add output flag for query txs command. ### Client Breaking Changes * [\#8363](https://github.com/cosmos/cosmos-sdk/pull/8363) Addresses no longer have a fixed 20-byte length. From the SDK modules' point of view, any 1-255 bytes-long byte array is a valid address. * (crypto/ed25519) [\#8690] Adopt zip1215 ed2559 verification rules. * [\#8849](https://github.com/cosmos/cosmos-sdk/pull/8849) Upgrade module no longer supports time based upgrades. -* [\#8880](https://github.com/cosmos/cosmos-sdk/pull/8880) The CLI `simd migrate v0.40 ...` command has been renamed to `simd migrate v0.42`. * [\#7477](https://github.com/cosmos/cosmos-sdk/pull/7477) Changed Bech32 Public Key serialization in the client facing functionality (CLI, MsgServer, QueryServer): * updated the keyring display structure (it uses protobuf JSON serialization) - the output is more verbose. * Renamed `MarshalAny` and `UnmarshalAny` to `MarshalInterface` and `UnmarshalInterface` respectively. These functions must take an interface as parameter (not a concrete type nor `Any` object). Underneath they use `Any` wrapping for correct protobuf serialization. * CLI: removed `--text` flag from `show-node-id` command; the text format for public keys is not used any more - instead we use ProtoJSON. -* (types) [\#9079](https://github.com/cosmos/cosmos-sdk/issues/9079) Add `AddAmount`/`SubAmount` methods to `sdk.Coin`. -* [\#8628](https://github.com/cosmos/cosmos-sdk/issues/8628) Commands no longer print outputs using `stderr` by default -* [\#9134](https://github.com/cosmos/cosmos-sdk/pull/9134) Renamed the CLI flag `--memo` to `--note`. +* (store) [\#8790](https://github.com/cosmos/cosmos-sdk/pull/8790) Reduce gas costs by 10x for transient store operations. * [\#9139](https://github.com/cosmos/cosmos-sdk/pull/9139) Querying events: * via `ServiceMsg` TypeURLs (e.g. `message.action='/cosmos.bank.v1beta1.Msg/Send'`) does not work anymore, * via legacy `msg.Type()` (e.g. `message.action='send'`) is being deprecated, new `Msg`s won't emit these events. * Please use concrete `Msg` TypeURLs instead (e.g. `message.action='/cosmos.bank.v1beta1.MsgSend'`). -* [\#9291](https://github.com/cosmos/cosmos-sdk/pull/9291) Migration scripts prior to v0.38 have been removed from the CLI `migrate` command. The oldest supported migration is v0.39->v0.42. ### API Breaking Changes @@ -126,22 +119,20 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/gov) [\#7733](https://github.com/cosmos/cosmos-sdk/pull/7733) ADR 037 Implementation: Governance Split Votes, use `MsgWeightedVote` to send a split vote. Sending a regular `MsgVote` will convert the underlying vote option into a weighted vote with weight 1. * (x/bank) [\#8656](https://github.com/cosmos/cosmos-sdk/pull/8656) balance and supply are now correctly tracked via `coin_spent`, `coin_received`, `coinbase` and `burn` events. * (x/bank) [\#8517](https://github.com/cosmos/cosmos-sdk/pull/8517) Supply is now stored and tracked as `sdk.Coins` -* (store) [\#8790](https://github.com/cosmos/cosmos-sdk/pull/8790) Reduce gas costs by 10x for transient store operations. * (x/bank) [\#9051](https://github.com/cosmos/cosmos-sdk/pull/9051) Supply value is stored as `sdk.Int` rather than `string`. ### CLI Breaking Changes +* [\#8880](https://github.com/cosmos/cosmos-sdk/pull/8880) The CLI `simd migrate v0.40 ...` command has been renamed to `simd migrate v0.42`. +* [\#8628](https://github.com/cosmos/cosmos-sdk/issues/8628) Commands no longer print outputs using `stderr` by default +* [\#9134](https://github.com/cosmos/cosmos-sdk/pull/9134) Renamed the CLI flag `--memo` to `--note`. +* [\#9291](https://github.com/cosmos/cosmos-sdk/pull/9291) Migration scripts prior to v0.38 have been removed from the CLI `migrate` command. The oldest supported migration is v0.39->v0.42. * [\#9371](https://github.com/cosmos/cosmos-sdk/pull/9371) Non-zero default fees/Server will error if there's an empty value for min-gas-price in app.toml ### Improvements -* (baseapp) [\#9578](https://github.com/cosmos/cosmos-sdk/pull/9578) Return `Baseapp`'s `trace` value for logging error stack traces. -* (x/auth) [\#9553] (https://github.com/cosmos/cosmos-sdk/pull/9553) The `--multisig` flag now accepts both a name and address. -* (gRPC-Web) [\#9493](https://github.com/cosmos/cosmos-sdk/pull/9493) Add `EnableUnsafeCORS` flag to grpc-web config. -* (x/params) [\#9481](https://github.com/cosmos/cosmos-sdk/issues/9481) Speedup simulator for parameter change proposals. -* (x/staking) [\#9423](https://github.com/cosmos/cosmos-sdk/pull/9423) Staking delegations now returns empty list instead of rpc error when no records found. * (x/bank) [\#8614](https://github.com/cosmos/cosmos-sdk/issues/8614) Add `Name` and `Symbol` fields to denom metadata * (x/auth) [\#8522](https://github.com/cosmos/cosmos-sdk/pull/8522) Allow to query all stored accounts * (crypto/types) [\#8600](https://github.com/cosmos/cosmos-sdk/pull/8600) `CompactBitArray`: optimize the `NumTrueBitsBefore` method and add an `Equal` method. @@ -150,6 +141,14 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/bank) [\#8950](https://github.com/cosmos/cosmos-sdk/pull/8950) Improve efficiency on supply updates. * (store) [\#8012](https://github.com/cosmos/cosmos-sdk/pull/8012) Implementation of ADR-038 WriteListener and listen.KVStore * (makefile) [\#7933](https://github.com/cosmos/cosmos-sdk/issues/7933) Use Docker to generate swagger files. +* [\#9205](https://github.com/cosmos/cosmos-sdk/pull/9205) Improve readability in `abci` handleQueryP2P +* [\#9231](https://github.com/cosmos/cosmos-sdk/pull/9231) Remove redundant staking errors. +* [\#9314](https://github.com/cosmos/cosmos-sdk/pull/9314) Update Rosetta SDK to upstream's latest release. +* (gRPC-Web) [\#9493](https://github.com/cosmos/cosmos-sdk/pull/9493) Add `EnableUnsafeCORS` flag to grpc-web config. +* (x/params) [\#9481](https://github.com/cosmos/cosmos-sdk/issues/9481) Speedup simulator for parameter change proposals. +* (x/staking) [\#9423](https://github.com/cosmos/cosmos-sdk/pull/9423) Staking delegations now returns empty list instead of rpc error when no records found. +* (x/auth) [\#9553](https://github.com/cosmos/cosmos-sdk/pull/9553) The `--multisig` flag now accepts both a name and address. +* (baseapp) [\#9578](https://github.com/cosmos/cosmos-sdk/pull/9578) Return `Baseapp`'s `trace` value for logging error stack traces. ### Bug Fixes @@ -160,11 +159,12 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/bank) [\#8434](https://github.com/cosmos/cosmos-sdk/pull/8434) Fix legacy REST API `GET /bank/total` and `GET /bank/total/{denom}` in swagger * (x/slashing) [\#8427](https://github.com/cosmos/cosmos-sdk/pull/8427) Fix query signing infos command * (x/bank) [\#9229](https://github.com/cosmos/cosmos-sdk/pull/9229) Now zero coin balances cannot be added to balances & supply stores. If any denom becomes zero corresponding key gets deleted from store. +* [\#9460](https://github.com/cosmos/cosmos-sdk/pull/9460) Fix lint error in `MigratePrefixAddress`. +* [\#9480](https://github.com/cosmos/cosmos-sdk/pull/9480) Fix added keys when using `--dry-run`. * (types) [\#9511](https://github.com/cosmos/cosmos-sdk/pull/9511) Change `maxBitLen` of `sdk.Int` and `sdk.Dec` to handle max ERC20 value. * (keyring) [\#9562](https://github.com/cosmos/cosmos-sdk/pull/9563) fix keyring kwallet backend when using with empty wallet. * (keyring) [\#9583](https://github.com/cosmos/cosmos-sdk/pull/9583) Fix correct population of legacy `Vote.Option` field for votes with 1 VoteOption of weight 1. - ### Deprecated * (grpc) [\#8926](https://github.com/cosmos/cosmos-sdk/pull/8926) The `tx` field in `SimulateRequest` has been deprecated, prefer to pass `tx_bytes` instead. From 8ba33a48f57cbaad282ba6928a1853aaad73e481 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 26 Jun 2021 09:46:59 +0000 Subject: [PATCH 35/50] build(deps): bump github.com/spf13/viper from 1.8.0 to 1.8.1 (#9586) Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.8.0 to 1.8.1. - [Release notes](https://github.com/spf13/viper/releases) - [Commits](https://github.com/spf13/viper/compare/v1.8.0...v1.8.1) --- updated-dependencies: - dependency-name: github.com/spf13/viper dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 16ff3d0392..0f40c6da15 100644 --- a/go.mod +++ b/go.mod @@ -39,7 +39,7 @@ require ( github.com/spf13/cast v1.3.1 github.com/spf13/cobra v1.1.3 github.com/spf13/pflag v1.0.5 - github.com/spf13/viper v1.8.0 + github.com/spf13/viper v1.8.1 github.com/stretchr/testify v1.7.0 github.com/tendermint/btcd v0.1.1 github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 diff --git a/go.sum b/go.sum index 9d5eba51d9..1e41847aa1 100644 --- a/go.sum +++ b/go.sum @@ -715,8 +715,8 @@ github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DM github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.8.0 h1:QRwDgoG8xX+kp69di68D+YYTCWfYEckbZRfUlEIAal0= -github.com/spf13/viper v1.8.0/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= +github.com/spf13/viper v1.8.1 h1:Kq1fyeebqsBfbjZj4EL7gj2IO0mMaiyjYUWcUsl2O44= +github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8OR4w3TdeIHIh1g6EMY5p0gVNOovcWC+1vpc7naMuAw= github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU= From bc24f2618459a4ac4d20826c6f2ee3f1638f2f64 Mon Sep 17 00:00:00 2001 From: Amaury <1293565+amaurym@users.noreply.github.com> Date: Mon, 28 Jun 2021 12:23:20 +0200 Subject: [PATCH 36/50] chore: Add mergify v0.43 backport (#9591) --- .mergify.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.mergify.yml b/.mergify.yml index 28ec751ea1..bcc4c6da1b 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -9,6 +9,14 @@ pull_request_rules: method: squash strict: true commit_message: title+body + - name: backport patches to v0.43.x branch + conditions: + - base=master + - label=backport/0.43.x + actions: + backport: + branches: + - release/v0.43.x - name: backport patches to v0.42.x branch conditions: - base=master From e17be874bb0e3a246b74752e9b8894855cab9b03 Mon Sep 17 00:00:00 2001 From: Jonathan Gimeno Date: Mon, 28 Jun 2021 07:42:08 -0400 Subject: [PATCH 37/50] refactor: Move some methods inside TX Factory (#9421) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Putting some things inside the factory (which was very anemic struct) has helped me to understand the flow. Feel free to merge if you see some benefit. closes: #XXXX --- Before we can merge this PR, please make sure that all the following items have been checked off. If any of the checklist items are not applicable, please leave them but write a little note why. - [ ] Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. - [ ] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules/structure.md). - [ ] Wrote unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] Updated relevant documentation (`docs/`) or specification (`x//spec/`) - [ ] Added relevant `godoc` [comments](https://blog.golang.org/godoc-documenting-go-code). - [ ] Added a relevant changelog entry to the `Unreleased` section in `CHANGELOG.md` - [ ] Re-reviewed `Files changed` in the Github PR explorer - [ ] Review `Codecov Report` in the comment section below once CI passes --- CHANGELOG.md | 5 +- client/tx/factory.go | 134 ++++++++++++++++++++++++++++++++ client/tx/tx.go | 139 ++-------------------------------- client/tx/tx_test.go | 10 +-- x/auth/client/tx.go | 6 -- x/genutil/client/cli/gentx.go | 4 +- 6 files changed, 150 insertions(+), 148 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e5a759a82..bef52a021c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### API Breaking Changes +* (client/tx) [\#9421](https://github.com/cosmos/cosmos-sdk/pull/9421/) `BuildUnsignedTx`, `BuildSimTx`, `PrintUnsignedStdTx` functions are moved to + the Tx Factory as methods. + ## [v0.43.0-rc0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.43.0-rc0) - 2021-06-25 ### Features @@ -111,7 +115,6 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (codec) [\#9251](https://github.com/cosmos/cosmos-sdk/pull/9251) Rename `clientCtx.JSONMarshaler` to `clientCtx.JSONCodec` as per #9226. * (x/bank) [\#9271](https://github.com/cosmos/cosmos-sdk/pull/9271) SendEnabledCoin(s) renamed to IsSendEnabledCoin(s) to better reflect its functionality. - ### State Machine Breaking * (x/{bank,distrib,gov,slashing,staking}) [\#8363](https://github.com/cosmos/cosmos-sdk/issues/8363) Store keys have been modified to allow for variable-length addresses. diff --git a/client/tx/factory.go b/client/tx/factory.go index 2cb951922d..3dc994b391 100644 --- a/client/tx/factory.go +++ b/client/tx/factory.go @@ -1,11 +1,16 @@ package tx import ( + "errors" + "fmt" + "os" + "github.com/spf13/pflag" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/crypto/keyring" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/tx/signing" ) @@ -189,3 +194,132 @@ func (f Factory) WithTimeoutHeight(height uint64) Factory { f.timeoutHeight = height return f } + +// BuildUnsignedTx builds a transaction to be signed given a set of messages. +// Once created, the fee, memo, and messages are set. +func (f Factory) BuildUnsignedTx(msgs ...sdk.Msg) (client.TxBuilder, error) { + if f.chainID == "" { + return nil, fmt.Errorf("chain ID required but not specified") + } + + fees := f.fees + + if !f.gasPrices.IsZero() { + if !fees.IsZero() { + return nil, errors.New("cannot provide both fees and gas prices") + } + + glDec := sdk.NewDec(int64(f.gas)) + + // Derive the fees based on the provided gas prices, where + // fee = ceil(gasPrice * gasLimit). + fees = make(sdk.Coins, len(f.gasPrices)) + + for i, gp := range f.gasPrices { + fee := gp.Amount.Mul(glDec) + fees[i] = sdk.NewCoin(gp.Denom, fee.Ceil().RoundInt()) + } + } + + tx := f.txConfig.NewTxBuilder() + + if err := tx.SetMsgs(msgs...); err != nil { + return nil, err + } + + tx.SetMemo(f.memo) + tx.SetFeeAmount(fees) + tx.SetGasLimit(f.gas) + tx.SetTimeoutHeight(f.TimeoutHeight()) + + return tx, nil +} + +// PrintUnsignedTx will generate an unsigned transaction and print it to the writer +// specified by ctx.Output. If simulation was requested, the gas will be +// simulated and also printed to the same writer before the transaction is +// printed. +func (f Factory) PrintUnsignedTx(clientCtx client.Context, msgs ...sdk.Msg) error { + if f.SimulateAndExecute() { + if clientCtx.Offline { + return errors.New("cannot estimate gas in offline mode") + } + + _, adjusted, err := CalculateGas(clientCtx, f, msgs...) + if err != nil { + return err + } + + f = f.WithGas(adjusted) + _, _ = fmt.Fprintf(os.Stderr, "%s\n", GasEstimateResponse{GasEstimate: f.Gas()}) + } + + tx, err := f.BuildUnsignedTx(msgs...) + if err != nil { + return err + } + + json, err := clientCtx.TxConfig.TxJSONEncoder()(tx.GetTx()) + if err != nil { + return err + } + + return clientCtx.PrintString(fmt.Sprintf("%s\n", json)) +} + +// BuildSimTx creates an unsigned tx with an empty single signature and returns +// the encoded transaction or an error if the unsigned transaction cannot be +// built. +func (f Factory) BuildSimTx(msgs ...sdk.Msg) ([]byte, error) { + txb, err := f.BuildUnsignedTx(msgs...) + if err != nil { + return nil, err + } + + // Create an empty signature literal as the ante handler will populate with a + // sentinel pubkey. + sig := signing.SignatureV2{ + PubKey: &secp256k1.PubKey{}, + Data: &signing.SingleSignatureData{ + SignMode: f.signMode, + }, + Sequence: f.Sequence(), + } + if err := txb.SetSignatures(sig); err != nil { + return nil, err + } + + return f.txConfig.TxEncoder()(txb.GetTx()) +} + +// Prepare ensures the account defined by ctx.GetFromAddress() exists and +// if the account number and/or the account sequence number are zero (not set), +// they will be queried for and set on the provided Factory. A new Factory with +// the updated fields will be returned. +func (f Factory) Prepare(clientCtx client.Context) (Factory, error) { + fc := f + + from := clientCtx.GetFromAddress() + + if err := fc.accountRetriever.EnsureExists(clientCtx, from); err != nil { + return fc, err + } + + initNum, initSeq := fc.accountNumber, fc.sequence + if initNum == 0 || initSeq == 0 { + num, seq, err := fc.accountRetriever.GetAccountNumberSequence(clientCtx, from) + if err != nil { + return fc, err + } + + if initNum == 0 { + fc = fc.WithAccountNumber(num) + } + + if initSeq == 0 { + fc = fc.WithSequence(seq) + } + } + + return fc, nil +} diff --git a/client/tx/tx.go b/client/tx/tx.go index 8e20be369b..ee0c7553de 100644 --- a/client/tx/tx.go +++ b/client/tx/tx.go @@ -14,7 +14,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/input" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -45,49 +44,17 @@ func GenerateOrBroadcastTxWithFactory(clientCtx client.Context, txf Factory, msg } if clientCtx.GenerateOnly { - return GenerateTx(clientCtx, txf, msgs...) + return txf.PrintUnsignedTx(clientCtx, msgs...) } return BroadcastTx(clientCtx, txf, msgs...) } -// GenerateTx will generate an unsigned transaction and print it to the writer -// specified by ctx.Output. If simulation was requested, the gas will be -// simulated and also printed to the same writer before the transaction is -// printed. -func GenerateTx(clientCtx client.Context, txf Factory, msgs ...sdk.Msg) error { - if txf.SimulateAndExecute() { - if clientCtx.Offline { - return errors.New("cannot estimate gas in offline mode") - } - - _, adjusted, err := CalculateGas(clientCtx, txf, msgs...) - if err != nil { - return err - } - - txf = txf.WithGas(adjusted) - _, _ = fmt.Fprintf(os.Stderr, "%s\n", GasEstimateResponse{GasEstimate: txf.Gas()}) - } - - tx, err := BuildUnsignedTx(txf, msgs...) - if err != nil { - return err - } - - json, err := clientCtx.TxConfig.TxJSONEncoder()(tx.GetTx()) - if err != nil { - return err - } - - return clientCtx.PrintString(fmt.Sprintf("%s\n", json)) -} - // BroadcastTx attempts to generate, sign and broadcast a transaction with the // given set of messages. It will also simulate gas requirements if necessary. // It will return an error upon failure. func BroadcastTx(clientCtx client.Context, txf Factory, msgs ...sdk.Msg) error { - txf, err := prepareFactory(clientCtx, txf) + txf, err := txf.Prepare(clientCtx) if err != nil { return err } @@ -106,7 +73,7 @@ func BroadcastTx(clientCtx client.Context, txf Factory, msgs ...sdk.Msg) error { return nil } - tx, err := BuildUnsignedTx(txf, msgs...) + tx, err := txf.BuildUnsignedTx(msgs...) if err != nil { return err } @@ -197,7 +164,7 @@ func WriteGeneratedTxResponse( } } - tx, err := BuildUnsignedTx(txf, msgs...) + tx, err := txf.BuildUnsignedTx(msgs...) if rest.CheckBadRequestError(w, err) { return } @@ -217,78 +184,12 @@ func WriteGeneratedTxResponse( _, _ = w.Write(output) } -// BuildUnsignedTx builds a transaction to be signed given a set of messages. The -// transaction is initially created via the provided factory's generator. Once -// created, the fee, memo, and messages are set. -func BuildUnsignedTx(txf Factory, msgs ...sdk.Msg) (client.TxBuilder, error) { - if txf.chainID == "" { - return nil, fmt.Errorf("chain ID required but not specified") - } - - fees := txf.fees - - if !txf.gasPrices.IsZero() { - if !fees.IsZero() { - return nil, errors.New("cannot provide both fees and gas prices") - } - - glDec := sdk.NewDec(int64(txf.gas)) - - // Derive the fees based on the provided gas prices, where - // fee = ceil(gasPrice * gasLimit). - fees = make(sdk.Coins, len(txf.gasPrices)) - - for i, gp := range txf.gasPrices { - fee := gp.Amount.Mul(glDec) - fees[i] = sdk.NewCoin(gp.Denom, fee.Ceil().RoundInt()) - } - } - - tx := txf.txConfig.NewTxBuilder() - - if err := tx.SetMsgs(msgs...); err != nil { - return nil, err - } - - tx.SetMemo(txf.memo) - tx.SetFeeAmount(fees) - tx.SetGasLimit(txf.gas) - tx.SetTimeoutHeight(txf.TimeoutHeight()) - - return tx, nil -} - -// BuildSimTx creates an unsigned tx with an empty single signature and returns -// the encoded transaction or an error if the unsigned transaction cannot be -// built. -func BuildSimTx(txf Factory, msgs ...sdk.Msg) ([]byte, error) { - txb, err := BuildUnsignedTx(txf, msgs...) - if err != nil { - return nil, err - } - - // Create an empty signature literal as the ante handler will populate with a - // sentinel pubkey. - sig := signing.SignatureV2{ - PubKey: &secp256k1.PubKey{}, - Data: &signing.SingleSignatureData{ - SignMode: txf.signMode, - }, - Sequence: txf.Sequence(), - } - if err := txb.SetSignatures(sig); err != nil { - return nil, err - } - - return txf.txConfig.TxEncoder()(txb.GetTx()) -} - // CalculateGas simulates the execution of a transaction and returns the // simulation response obtained by the query and the adjusted gas amount. func CalculateGas( clientCtx gogogrpc.ClientConn, txf Factory, msgs ...sdk.Msg, ) (*tx.SimulateResponse, uint64, error) { - txBytes, err := BuildSimTx(txf, msgs...) + txBytes, err := txf.BuildSimTx(msgs...) if err != nil { return nil, 0, err } @@ -304,36 +205,6 @@ func CalculateGas( return simRes, uint64(txf.GasAdjustment() * float64(simRes.GasInfo.GasUsed)), nil } -// prepareFactory ensures the account defined by ctx.GetFromAddress() exists and -// if the account number and/or the account sequence number are zero (not set), -// they will be queried for and set on the provided Factory. A new Factory with -// the updated fields will be returned. -func prepareFactory(clientCtx client.Context, txf Factory) (Factory, error) { - from := clientCtx.GetFromAddress() - - if err := txf.accountRetriever.EnsureExists(clientCtx, from); err != nil { - return txf, err - } - - initNum, initSeq := txf.accountNumber, txf.sequence - if initNum == 0 || initSeq == 0 { - num, seq, err := txf.accountRetriever.GetAccountNumberSequence(clientCtx, from) - if err != nil { - return txf, err - } - - if initNum == 0 { - txf = txf.WithAccountNumber(num) - } - - if initSeq == 0 { - txf = txf.WithSequence(seq) - } - } - - return txf, nil -} - // SignWithPrivKey signs a given tx with the given private key, and returns the // corresponding SignatureV2 if the signing is successful. func SignWithPrivKey( diff --git a/client/tx/tx_test.go b/client/tx/tx_test.go index b095d05b9e..54bcc7ade6 100644 --- a/client/tx/tx_test.go +++ b/client/tx/tx_test.go @@ -107,7 +107,7 @@ func TestBuildSimTx(t *testing.T) { WithSignMode(txCfg.SignModeHandler().DefaultMode()) msg := banktypes.NewMsgSend(sdk.AccAddress("from"), sdk.AccAddress("to"), nil) - bz, err := tx.BuildSimTx(txf, msg) + bz, err := txf.BuildSimTx(msg) require.NoError(t, err) require.NotNil(t, bz) } @@ -122,7 +122,7 @@ func TestBuildUnsignedTx(t *testing.T) { WithChainID("test-chain") msg := banktypes.NewMsgSend(sdk.AccAddress("from"), sdk.AccAddress("to"), nil) - tx, err := tx.BuildUnsignedTx(txf, msg) + tx, err := txf.BuildUnsignedTx(msg) require.NoError(t, err) require.NotNil(t, tx) @@ -169,11 +169,11 @@ func TestSign(t *testing.T) { WithSignMode(signingtypes.SignMode_SIGN_MODE_LEGACY_AMINO_JSON) msg1 := banktypes.NewMsgSend(info1.GetAddress(), sdk.AccAddress("to"), nil) msg2 := banktypes.NewMsgSend(info2.GetAddress(), sdk.AccAddress("to"), nil) - txb, err := tx.BuildUnsignedTx(txfNoKeybase, msg1, msg2) + txb, err := txfNoKeybase.BuildUnsignedTx(msg1, msg2) requireT.NoError(err) - txb2, err := tx.BuildUnsignedTx(txfNoKeybase, msg1, msg2) + txb2, err := txfNoKeybase.BuildUnsignedTx(msg1, msg2) requireT.NoError(err) - txbSimple, err := tx.BuildUnsignedTx(txfNoKeybase, msg2) + txbSimple, err := txfNoKeybase.BuildUnsignedTx(msg2) requireT.NoError(err) testCases := []struct { diff --git a/x/auth/client/tx.go b/x/auth/client/tx.go index 80debcc1de..47268e6439 100644 --- a/x/auth/client/tx.go +++ b/x/auth/client/tx.go @@ -30,12 +30,6 @@ func (gr GasEstimateResponse) String() string { return fmt.Sprintf("gas estimate: %d", gr.GasEstimate) } -// PrintUnsignedStdTx builds an unsigned StdTx and prints it to os.Stdout. -func PrintUnsignedStdTx(txBldr tx.Factory, clientCtx client.Context, msgs []sdk.Msg) error { - err := tx.GenerateTx(clientCtx, txBldr, msgs...) - return err -} - // SignTx signs a transaction managed by the TxBuilder using a `name` key stored in Keybase. // The new signature is appended to the TxBuilder when overwrite=false or overwritten otherwise. // Don't perform online validation or lookups if offline is true. diff --git a/x/genutil/client/cli/gentx.go b/x/genutil/client/cli/gentx.go index e6433b2f46..3b1aaceb02 100644 --- a/x/genutil/client/cli/gentx.go +++ b/x/genutil/client/cli/gentx.go @@ -156,14 +156,14 @@ $ %s gentx my-key-name 1000000stake --home=/path/to/home/dir --keyring-backend=o if key.GetType() == keyring.TypeOffline || key.GetType() == keyring.TypeMulti { cmd.PrintErrln("Offline key passed in. Use `tx sign` command to sign.") - return authclient.PrintUnsignedStdTx(txBldr, clientCtx, []sdk.Msg{msg}) + return txBldr.PrintUnsignedTx(clientCtx, msg) } // write the unsigned transaction to the buffer w := bytes.NewBuffer([]byte{}) clientCtx = clientCtx.WithOutput(w) - if err = authclient.PrintUnsignedStdTx(txBldr, clientCtx, []sdk.Msg{msg}); err != nil { + if err = txBldr.PrintUnsignedTx(clientCtx, msg); err != nil { return errors.Wrap(err, "failed to print unsigned std tx") } From d8059ffcac9e5db559dfae37800efaa00024f739 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Mon, 28 Jun 2021 10:40:44 -0400 Subject: [PATCH 38/50] feat: add DenomOwners gRPC method for x/bank (#9533) # Description Adds a new gRPC method, `DenomOwners`, to the `x/bank` module. This method queries for all account addresses that own a particular token denomination (paginated). _Naming subject to change based on reviews._ closes: #9393 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [x] added a changelog entry to `CHANGELOG.md` - [x] included comments for [documenting Go code](https://blog.golang.org/godoc) - [x] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [x] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [x] confirmed all author checklist items have been addressed - [x] reviewed state machine logic - [x] reviewed API design and naming - [x] reviewed documentation is accurate - [x] reviewed tests and test coverage - [ ] manually tested (if applicable) --- CHANGELOG.md | 5 + docs/core/proto-docs.md | 52 +- proto/cosmos/bank/v1beta1/query.proto | 39 +- x/bank/keeper/grpc_query.go | 58 ++ x/bank/keeper/grpc_query_test.go | 94 ++- x/bank/types/query.pb.go | 864 ++++++++++++++++++++++++-- x/bank/types/query.pb.gw.go | 116 ++++ 7 files changed, 1168 insertions(+), 60 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bef52a021c..fbd1030d48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,7 +37,12 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### Features + +* [\#9533](https://github.com/cosmos/cosmos-sdk/pull/9533) Added a new gRPC method, `DenomOwners`, in `x/bank` to query for all account holders of a specific denomination. + ### API Breaking Changes + * (client/tx) [\#9421](https://github.com/cosmos/cosmos-sdk/pull/9421/) `BuildUnsignedTx`, `BuildSimTx`, `PrintUnsignedStdTx` functions are moved to the Tx Factory as methods. diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 6b2ddbe1e4..87e6a2e623 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -89,12 +89,15 @@ - [GenesisState](#cosmos.bank.v1beta1.GenesisState) - [cosmos/bank/v1beta1/query.proto](#cosmos/bank/v1beta1/query.proto) + - [DenomOwner](#cosmos.bank.v1beta1.DenomOwner) - [QueryAllBalancesRequest](#cosmos.bank.v1beta1.QueryAllBalancesRequest) - [QueryAllBalancesResponse](#cosmos.bank.v1beta1.QueryAllBalancesResponse) - [QueryBalanceRequest](#cosmos.bank.v1beta1.QueryBalanceRequest) - [QueryBalanceResponse](#cosmos.bank.v1beta1.QueryBalanceResponse) - [QueryDenomMetadataRequest](#cosmos.bank.v1beta1.QueryDenomMetadataRequest) - [QueryDenomMetadataResponse](#cosmos.bank.v1beta1.QueryDenomMetadataResponse) + - [QueryDenomOwnersRequest](#cosmos.bank.v1beta1.QueryDenomOwnersRequest) + - [QueryDenomOwnersResponse](#cosmos.bank.v1beta1.QueryDenomOwnersResponse) - [QueryDenomsMetadataRequest](#cosmos.bank.v1beta1.QueryDenomsMetadataRequest) - [QueryDenomsMetadataResponse](#cosmos.bank.v1beta1.QueryDenomsMetadataResponse) - [QueryParamsRequest](#cosmos.bank.v1beta1.QueryParamsRequest) @@ -1703,6 +1706,19 @@ GenesisState defines the bank module's genesis state. + + +### DenomOwner + +DenomOwner defines structure representing an account that owns or holds a +particular denominated token. It contains the account address and account +balance of the denominated token. + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `address` | [string](#string) | | address defines the address that owns a particular denomination. | +| `balance` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | balance is the balance of the denominated coin for an account. | + ### QueryAllBalancesRequest @@ -1798,6 +1814,40 @@ method. + + +### QueryDenomOwnersRequest +QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, +which queries for a paginated set of all account holders of a particular +denomination. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `denom` | [string](#string) | | denom defines the coin denomination to query all account holders for. | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | + + + + + + + + +### QueryDenomOwnersResponse +QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `denom_owners` | [DenomOwner](#cosmos.bank.v1beta1.DenomOwner) | repeated | | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | + + + + + + ### QueryDenomsMetadataRequest @@ -1938,6 +1988,7 @@ Query defines the gRPC querier service. | `Params` | [QueryParamsRequest](#cosmos.bank.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#cosmos.bank.v1beta1.QueryParamsResponse) | Params queries the parameters of x/bank module. | GET|/cosmos/bank/v1beta1/params| | `DenomMetadata` | [QueryDenomMetadataRequest](#cosmos.bank.v1beta1.QueryDenomMetadataRequest) | [QueryDenomMetadataResponse](#cosmos.bank.v1beta1.QueryDenomMetadataResponse) | DenomsMetadata queries the client metadata of a given coin denomination. | GET|/cosmos/bank/v1beta1/denoms_metadata/{denom}| | `DenomsMetadata` | [QueryDenomsMetadataRequest](#cosmos.bank.v1beta1.QueryDenomsMetadataRequest) | [QueryDenomsMetadataResponse](#cosmos.bank.v1beta1.QueryDenomsMetadataResponse) | DenomsMetadata queries the client metadata for all registered coin denominations. | GET|/cosmos/bank/v1beta1/denoms_metadata| +| `DenomOwners` | [QueryDenomOwnersRequest](#cosmos.bank.v1beta1.QueryDenomOwnersRequest) | [QueryDenomOwnersResponse](#cosmos.bank.v1beta1.QueryDenomOwnersResponse) | DenomOwners queries for all account addresses that own a particular token denomination. | GET|/cosmos/bank/v1beta1/denom_owners/{denom}| @@ -8259,4 +8310,3 @@ still be used for delegating and for governance votes even while locked. | bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | | string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | | bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | - diff --git a/proto/cosmos/bank/v1beta1/query.proto b/proto/cosmos/bank/v1beta1/query.proto index e3a464f8ba..9ffa9d86fd 100644 --- a/proto/cosmos/bank/v1beta1/query.proto +++ b/proto/cosmos/bank/v1beta1/query.proto @@ -41,10 +41,17 @@ service Query { option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata/{denom}"; } - // DenomsMetadata queries the client metadata for all registered coin denominations. + // DenomsMetadata queries the client metadata for all registered coin + // denominations. rpc DenomsMetadata(QueryDenomsMetadataRequest) returns (QueryDenomsMetadataResponse) { option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata"; } + + // DenomOwners queries for all account addresses that own a particular token + // denomination. + rpc DenomOwners(QueryDenomOwnersRequest) returns (QueryDenomOwnersResponse) { + option (google.api.http).get = "/cosmos/bank/v1beta1/denom_owners/{denom}"; + } } // QueryBalanceRequest is the request type for the Query/Balance RPC method. @@ -157,3 +164,33 @@ message QueryDenomMetadataResponse { // metadata describes and provides all the client information for the requested token. Metadata metadata = 1 [(gogoproto.nullable) = false]; } + +// QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, +// which queries for a paginated set of all account holders of a particular +// denomination. +message QueryDenomOwnersRequest { + // denom defines the coin denomination to query all account holders for. + string denom = 1; + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// DenomOwner defines structure representing an account that owns or holds a +// particular denominated token. It contains the account address and account +// balance of the denominated token. +message DenomOwner { + // address defines the address that owns a particular denomination. + string address = 1; + + // balance is the balance of the denominated coin for an account. + cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false]; +} + +// QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. +message QueryDenomOwnersResponse { + repeated DenomOwner denom_owners = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/x/bank/keeper/grpc_query.go b/x/bank/keeper/grpc_query.go index 02655aa2f5..53c192954f 100644 --- a/x/bank/keeper/grpc_query.go +++ b/x/bank/keeper/grpc_query.go @@ -164,3 +164,61 @@ func (k BaseKeeper) DenomMetadata(c context.Context, req *types.QueryDenomMetada Metadata: metadata, }, nil } + +func (k BaseKeeper) DenomOwners( + goCtx context.Context, + req *types.QueryDenomOwnersRequest, +) (*types.QueryDenomOwnersResponse, error) { + + if req == nil { + return nil, status.Errorf(codes.InvalidArgument, "empty request") + } + + if req.Denom == "" { + return nil, status.Error(codes.InvalidArgument, "empty denom") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + store := ctx.KVStore(k.storeKey) + balancesStore := prefix.NewStore(store, types.BalancesPrefix) + + var denomOwners []*types.DenomOwner + pageRes, err := query.FilteredPaginate( + balancesStore, + req.Pagination, + func(key []byte, value []byte, accumulate bool) (bool, error) { + var balance sdk.Coin + if err := k.cdc.Unmarshal(value, &balance); err != nil { + return false, err + } + + if req.Denom != balance.Denom { + return false, nil + } + + if accumulate { + address, err := types.AddressFromBalancesStore(key) + if err != nil { + return false, err + } + + denomOwners = append( + denomOwners, + &types.DenomOwner{ + Address: address.String(), + Balance: balance, + }, + ) + } + + return true, nil + }, + ) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryDenomOwnersResponse{DenomOwners: denomOwners, Pagination: pageRes}, nil +} diff --git a/x/bank/keeper/grpc_query_test.go b/x/bank/keeper/grpc_query_test.go index 181506a6d7..4593d8585b 100644 --- a/x/bank/keeper/grpc_query_test.go +++ b/x/bank/keeper/grpc_query_test.go @@ -5,13 +5,12 @@ import ( "fmt" "github.com/cosmos/cosmos-sdk/simapp" - - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/bank/types" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) func (suite *IntegrationTestSuite) TestQueryBalance() { @@ -305,3 +304,92 @@ func (suite *IntegrationTestSuite) QueryDenomMetadataRequest() { }) } } + +func (suite *IntegrationTestSuite) TestGRPCDenomOwners() { + ctx := suite.ctx + + authKeeper, keeper := suite.initKeepersWithmAccPerms(make(map[string]bool)) + suite.Require().NoError(keeper.MintCoins(ctx, minttypes.ModuleName, initCoins)) + + for i := 0; i < 10; i++ { + acc := authKeeper.NewAccountWithAddress(ctx, authtypes.NewModuleAddress(fmt.Sprintf("account-%d", i))) + authKeeper.SetAccount(ctx, acc) + + bal := sdk.NewCoins(sdk.NewCoin( + sdk.DefaultBondDenom, + sdk.TokensFromConsensusPower(initialPower/10, sdk.DefaultPowerReduction), + )) + suite.Require().NoError(keeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, acc.GetAddress(), bal)) + } + + testCases := map[string]struct { + req *types.QueryDenomOwnersRequest + expPass bool + numAddrs int + hasNext bool + total uint64 + }{ + "empty request": { + req: &types.QueryDenomOwnersRequest{}, + expPass: false, + }, + "invalid denom": { + req: &types.QueryDenomOwnersRequest{ + Denom: "foo", + }, + expPass: true, + numAddrs: 0, + hasNext: false, + total: 0, + }, + "valid request - page 1": { + req: &types.QueryDenomOwnersRequest{ + Denom: sdk.DefaultBondDenom, + Pagination: &query.PageRequest{ + Limit: 6, + CountTotal: true, + }, + }, + expPass: true, + numAddrs: 6, + hasNext: true, + total: 10, + }, + "valid request - page 2": { + req: &types.QueryDenomOwnersRequest{ + Denom: sdk.DefaultBondDenom, + Pagination: &query.PageRequest{ + Offset: 6, + Limit: 10, + CountTotal: true, + }, + }, + expPass: true, + numAddrs: 4, + hasNext: false, + total: 10, + }, + } + + for name, tc := range testCases { + suite.Run(name, func() { + resp, err := suite.queryClient.DenomOwners(gocontext.Background(), tc.req) + if tc.expPass { + suite.NoError(err) + suite.NotNil(resp) + suite.Len(resp.DenomOwners, tc.numAddrs) + suite.Equal(tc.total, resp.Pagination.Total) + + if tc.hasNext { + suite.NotNil(resp.Pagination.NextKey) + } else { + suite.Nil(resp.Pagination.NextKey) + } + } else { + suite.Require().Error(err) + } + }) + } + + suite.Require().True(true) +} diff --git a/x/bank/types/query.pb.go b/x/bank/types/query.pb.go index 5ad95812ba..3b4fd46547 100644 --- a/x/bank/types/query.pb.go +++ b/x/bank/types/query.pb.go @@ -681,6 +681,174 @@ func (m *QueryDenomMetadataResponse) GetMetadata() Metadata { return Metadata{} } +// QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, +// which queries for a paginated set of all account holders of a particular +// denomination. +type QueryDenomOwnersRequest struct { + // denom defines the coin denomination to query all account holders for. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryDenomOwnersRequest) Reset() { *m = QueryDenomOwnersRequest{} } +func (m *QueryDenomOwnersRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDenomOwnersRequest) ProtoMessage() {} +func (*QueryDenomOwnersRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{14} +} +func (m *QueryDenomOwnersRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDenomOwnersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDenomOwnersRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDenomOwnersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDenomOwnersRequest.Merge(m, src) +} +func (m *QueryDenomOwnersRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDenomOwnersRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDenomOwnersRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDenomOwnersRequest proto.InternalMessageInfo + +func (m *QueryDenomOwnersRequest) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *QueryDenomOwnersRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// DenomOwner defines structure representing an account that owns or holds a +// particular denominated token. It contains the account address and account +// balance of the denominated token. +type DenomOwner struct { + // address defines the address that owns a particular denomination. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // balance is the balance of the denominated coin for an account. + Balance types.Coin `protobuf:"bytes,2,opt,name=balance,proto3" json:"balance"` +} + +func (m *DenomOwner) Reset() { *m = DenomOwner{} } +func (m *DenomOwner) String() string { return proto.CompactTextString(m) } +func (*DenomOwner) ProtoMessage() {} +func (*DenomOwner) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{15} +} +func (m *DenomOwner) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DenomOwner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DenomOwner.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DenomOwner) XXX_Merge(src proto.Message) { + xxx_messageInfo_DenomOwner.Merge(m, src) +} +func (m *DenomOwner) XXX_Size() int { + return m.Size() +} +func (m *DenomOwner) XXX_DiscardUnknown() { + xxx_messageInfo_DenomOwner.DiscardUnknown(m) +} + +var xxx_messageInfo_DenomOwner proto.InternalMessageInfo + +func (m *DenomOwner) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *DenomOwner) GetBalance() types.Coin { + if m != nil { + return m.Balance + } + return types.Coin{} +} + +// QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. +type QueryDenomOwnersResponse struct { + DenomOwners []*DenomOwner `protobuf:"bytes,1,rep,name=denom_owners,json=denomOwners,proto3" json:"denom_owners,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryDenomOwnersResponse) Reset() { *m = QueryDenomOwnersResponse{} } +func (m *QueryDenomOwnersResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDenomOwnersResponse) ProtoMessage() {} +func (*QueryDenomOwnersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{16} +} +func (m *QueryDenomOwnersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDenomOwnersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDenomOwnersResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryDenomOwnersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDenomOwnersResponse.Merge(m, src) +} +func (m *QueryDenomOwnersResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDenomOwnersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDenomOwnersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDenomOwnersResponse proto.InternalMessageInfo + +func (m *QueryDenomOwnersResponse) GetDenomOwners() []*DenomOwner { + if m != nil { + return m.DenomOwners + } + return nil +} + +func (m *QueryDenomOwnersResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { proto.RegisterType((*QueryBalanceRequest)(nil), "cosmos.bank.v1beta1.QueryBalanceRequest") proto.RegisterType((*QueryBalanceResponse)(nil), "cosmos.bank.v1beta1.QueryBalanceResponse") @@ -696,64 +864,73 @@ func init() { proto.RegisterType((*QueryDenomsMetadataResponse)(nil), "cosmos.bank.v1beta1.QueryDenomsMetadataResponse") proto.RegisterType((*QueryDenomMetadataRequest)(nil), "cosmos.bank.v1beta1.QueryDenomMetadataRequest") proto.RegisterType((*QueryDenomMetadataResponse)(nil), "cosmos.bank.v1beta1.QueryDenomMetadataResponse") + proto.RegisterType((*QueryDenomOwnersRequest)(nil), "cosmos.bank.v1beta1.QueryDenomOwnersRequest") + proto.RegisterType((*DenomOwner)(nil), "cosmos.bank.v1beta1.DenomOwner") + proto.RegisterType((*QueryDenomOwnersResponse)(nil), "cosmos.bank.v1beta1.QueryDenomOwnersResponse") } func init() { proto.RegisterFile("cosmos/bank/v1beta1/query.proto", fileDescriptor_9c6fc1939682df13) } var fileDescriptor_9c6fc1939682df13 = []byte{ - // 825 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4d, 0x6f, 0xd3, 0x58, - 0x14, 0xcd, 0xeb, 0x4c, 0xd3, 0xf4, 0x46, 0x33, 0x8b, 0xd7, 0x8c, 0x26, 0x75, 0xa7, 0xc9, 0xc8, - 0x9d, 0x69, 0xd3, 0x92, 0xda, 0x4d, 0x8b, 0x54, 0xc1, 0x06, 0x35, 0x45, 0xb0, 0x40, 0xa8, 0x21, - 0xb0, 0x42, 0x42, 0xe8, 0x25, 0x31, 0x26, 0x6a, 0xe2, 0xe7, 0xe6, 0x39, 0x88, 0xaa, 0xaa, 0x84, - 0x90, 0x90, 0x58, 0x01, 0x12, 0x0b, 0x16, 0x6c, 0xca, 0x06, 0x09, 0x96, 0xfc, 0x8a, 0x2e, 0x58, - 0x54, 0x62, 0xc3, 0x0a, 0x50, 0xcb, 0x82, 0x9f, 0x81, 0xf2, 0x3e, 0x5c, 0x27, 0x71, 0x13, 0x2f, - 0xc2, 0x2a, 0xf6, 0xf5, 0xfd, 0x38, 0xe7, 0x3c, 0xdf, 0xe3, 0x40, 0xb6, 0x4a, 0x59, 0x93, 0x32, - 0xb3, 0x42, 0x9c, 0x6d, 0xf3, 0x41, 0xa1, 0x62, 0x79, 0xa4, 0x60, 0xee, 0xb4, 0xad, 0xd6, 0xae, - 0xe1, 0xb6, 0xa8, 0x47, 0xf1, 0x94, 0x48, 0x30, 0x3a, 0x09, 0x86, 0x4c, 0xd0, 0x96, 0xfc, 0x2a, - 0x66, 0x89, 0x6c, 0xbf, 0xd6, 0x25, 0x76, 0xdd, 0x21, 0x5e, 0x9d, 0x3a, 0xa2, 0x81, 0x96, 0xb2, - 0xa9, 0x4d, 0xf9, 0xa5, 0xd9, 0xb9, 0x92, 0xd1, 0x7f, 0x6c, 0x4a, 0xed, 0x86, 0x65, 0x12, 0xb7, - 0x6e, 0x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x4e, 0xbe, 0x00, 0xd3, - 0xa7, 0x50, 0x7b, 0x05, 0x09, 0x3f, 0xfe, 0x3b, 0x41, 0x11, 0xfb, 0xc8, 0x5d, 0x82, 0x84, 0x82, - 0x29, 0x25, 0x8c, 0xc4, 0xcd, 0x2f, 0x5a, 0xfd, 0x90, 0x80, 0x71, 0xde, 0x1f, 0xbf, 0x42, 0x30, - 0x21, 0x4d, 0x09, 0xe7, 0x42, 0x9b, 0x84, 0x38, 0xbc, 0xb6, 0x18, 0x21, 0x53, 0x60, 0xd5, 0xd7, - 0x1f, 0x7f, 0xfa, 0xfe, 0x72, 0xac, 0x80, 0x4d, 0x33, 0xfc, 0x63, 0x22, 0xec, 0xc9, 0xdc, 0x93, - 0xfe, 0xbb, 0x6f, 0xee, 0x71, 0x05, 0xf6, 0xf1, 0x6b, 0x04, 0xc9, 0x80, 0x63, 0xe2, 0xfc, 0xd9, - 0x33, 0xfb, 0x0d, 0x5e, 0x5b, 0x8e, 0x98, 0x2d, 0x51, 0x9a, 0x1c, 0xe5, 0x22, 0x5e, 0x88, 0x88, - 0x12, 0x3f, 0x47, 0x90, 0x0c, 0x78, 0xd2, 0x20, 0x74, 0xfd, 0x46, 0x39, 0x08, 0x5d, 0x88, 0xd1, - 0xe9, 0x73, 0x1c, 0xdd, 0x2c, 0x9e, 0x09, 0x45, 0x27, 0x8d, 0xea, 0x19, 0x82, 0x84, 0x72, 0x0b, - 0x3c, 0xe0, 0x80, 0x7a, 0xfc, 0x47, 0x5b, 0x8a, 0x92, 0x2a, 0x81, 0x9c, 0xe3, 0x40, 0xfe, 0xc7, - 0x73, 0x03, 0x80, 0xf8, 0x07, 0xf8, 0x08, 0x41, 0x5c, 0x38, 0x04, 0x5e, 0x38, 0x7b, 0x46, 0x97, - 0x1d, 0x69, 0xb9, 0xe1, 0x89, 0x91, 0x34, 0x11, 0x5e, 0x84, 0xdf, 0x22, 0xf8, 0xa3, 0x6b, 0x85, - 0xb0, 0x71, 0xf6, 0x80, 0xb0, 0xf5, 0xd4, 0xcc, 0xc8, 0xf9, 0x12, 0xd7, 0x79, 0x8e, 0xcb, 0xc0, - 0xf9, 0x50, 0x5c, 0x5c, 0x1a, 0x76, 0x57, 0x2d, 0xa2, 0xaf, 0xd5, 0x1b, 0x04, 0x7f, 0x76, 0x3b, - 0x19, 0x1e, 0x36, 0xb9, 0xd7, 0x5a, 0xb5, 0x95, 0xe8, 0x05, 0x12, 0x6b, 0x9e, 0x63, 0x9d, 0xc7, - 0xff, 0x45, 0xc1, 0x5a, 0xdc, 0x3c, 0x3c, 0xce, 0xa0, 0xa3, 0xe3, 0x0c, 0xfa, 0x76, 0x9c, 0x41, - 0x2f, 0x4e, 0x32, 0xb1, 0xa3, 0x93, 0x4c, 0xec, 0xf3, 0x49, 0x26, 0x76, 0x7b, 0x71, 0xe0, 0x57, - 0xf5, 0xa1, 0x68, 0xcb, 0x3f, 0xae, 0x95, 0x38, 0xff, 0xe7, 0xb8, 0xf6, 0x33, 0x00, 0x00, 0xff, - 0xff, 0xa0, 0xfe, 0xe2, 0x92, 0x11, 0x0b, 0x00, 0x00, + // 917 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x4f, 0x4f, 0x3b, 0x45, + 0x18, 0xee, 0xa0, 0x94, 0xf2, 0x56, 0x3d, 0x0c, 0x35, 0x96, 0x45, 0x5a, 0xb3, 0x28, 0xb4, 0x50, + 0x76, 0x29, 0x98, 0x10, 0xbc, 0x18, 0x8a, 0xd1, 0x83, 0x31, 0xd4, 0xea, 0xc9, 0xc4, 0x90, 0x69, + 0xbb, 0xae, 0x0d, 0xed, 0xce, 0xd2, 0xd9, 0x8a, 0x84, 0x90, 0x18, 0x13, 0x13, 0x4f, 0x6a, 0xe2, + 0xc1, 0x83, 0x31, 0xc1, 0x8b, 0x46, 0x3f, 0x09, 0x07, 0x0f, 0x44, 0x2f, 0x9e, 0xd4,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x71, 0xe8, 0x6b, 0xf5, 0x23, 0x82, 0xe7, 0xc2, 0x7e, 0x82, 0x67, + 0x75, 0x1e, 0x37, 0x38, 0x6d, 0x2f, 0x79, 0x82, 0xc4, 0x5a, 0xe1, 0x58, 0x37, 0xf1, 0xcb, 0x49, + 0xb0, 0xe2, 0x1f, 0x10, 0x64, 0x03, 0x93, 0x2d, 0xee, 0xc8, 0x4f, 0x4e, 0xf7, 0xb8, 0x23, 0x1f, + 0x31, 0x2e, 0xf5, 0x2a, 0x87, 0xb6, 0x83, 0xcb, 0xd3, 0xa1, 0xc9, 0x49, 0xaa, 0x34, 0xac, 0x9d, + 0xdc, 0x3d, 0x14, 0xd0, 0xfd, 0x43, 0x01, 0xfd, 0xf3, 0x50, 0x40, 0xdf, 0x3c, 0x16, 0x52, 0xf7, + 0x8f, 0x85, 0xd4, 0x9f, 0x8f, 0x85, 0xd4, 0x07, 0xe5, 0xd8, 0x6f, 0xaf, 0x4f, 0x45, 0x6d, 0xfe, + 0x09, 0xd6, 0x4c, 0xf3, 0xff, 0x2f, 0x0e, 0xfe, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x75, 0x2d, 0x5e, + 0xd9, 0x37, 0x0d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -780,8 +957,12 @@ type QueryClient interface { Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // DenomsMetadata queries the client metadata of a given coin denomination. DenomMetadata(ctx context.Context, in *QueryDenomMetadataRequest, opts ...grpc.CallOption) (*QueryDenomMetadataResponse, error) - // DenomsMetadata queries the client metadata for all registered coin denominations. + // DenomsMetadata queries the client metadata for all registered coin + // denominations. DenomsMetadata(ctx context.Context, in *QueryDenomsMetadataRequest, opts ...grpc.CallOption) (*QueryDenomsMetadataResponse, error) + // DenomOwners queries for all account addresses that own a particular token + // denomination. + DenomOwners(ctx context.Context, in *QueryDenomOwnersRequest, opts ...grpc.CallOption) (*QueryDenomOwnersResponse, error) } type queryClient struct { @@ -855,6 +1036,15 @@ func (c *queryClient) DenomsMetadata(ctx context.Context, in *QueryDenomsMetadat return out, nil } +func (c *queryClient) DenomOwners(ctx context.Context, in *QueryDenomOwnersRequest, opts ...grpc.CallOption) (*QueryDenomOwnersResponse, error) { + out := new(QueryDenomOwnersResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/DenomOwners", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Balance queries the balance of a single coin for a single account. @@ -869,8 +1059,12 @@ type QueryServer interface { Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // DenomsMetadata queries the client metadata of a given coin denomination. DenomMetadata(context.Context, *QueryDenomMetadataRequest) (*QueryDenomMetadataResponse, error) - // DenomsMetadata queries the client metadata for all registered coin denominations. + // DenomsMetadata queries the client metadata for all registered coin + // denominations. DenomsMetadata(context.Context, *QueryDenomsMetadataRequest) (*QueryDenomsMetadataResponse, error) + // DenomOwners queries for all account addresses that own a particular token + // denomination. + DenomOwners(context.Context, *QueryDenomOwnersRequest) (*QueryDenomOwnersResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -898,6 +1092,9 @@ func (*UnimplementedQueryServer) DenomMetadata(ctx context.Context, req *QueryDe func (*UnimplementedQueryServer) DenomsMetadata(ctx context.Context, req *QueryDenomsMetadataRequest) (*QueryDenomsMetadataResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DenomsMetadata not implemented") } +func (*UnimplementedQueryServer) DenomOwners(ctx context.Context, req *QueryDenomOwnersRequest) (*QueryDenomOwnersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DenomOwners not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1029,6 +1226,24 @@ func _Query_DenomsMetadata_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _Query_DenomOwners_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDenomOwnersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).DenomOwners(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Query/DenomOwners", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DenomOwners(ctx, req.(*QueryDenomOwnersRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.bank.v1beta1.Query", HandlerType: (*QueryServer)(nil), @@ -1061,6 +1276,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "DenomsMetadata", Handler: _Query_DenomsMetadata_Handler, }, + { + MethodName: "DenomOwners", + Handler: _Query_DenomOwners_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/bank/v1beta1/query.proto", @@ -1579,6 +1798,137 @@ func (m *QueryDenomMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } +func (m *QueryDenomOwnersRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDenomOwnersRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDenomOwnersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DenomOwner) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DenomOwner) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DenomOwner) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Balance.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDenomOwnersResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryDenomOwnersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDenomOwnersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.DenomOwners) > 0 { + for iNdEx := len(m.DenomOwners) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DenomOwners[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -1788,6 +2138,57 @@ func (m *QueryDenomMetadataResponse) Size() (n int) { return n } +func (m *QueryDenomOwnersRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *DenomOwner) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = m.Balance.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryDenomOwnersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.DenomOwners) > 0 { + for _, e := range m.DenomOwners { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -3107,6 +3508,359 @@ func (m *QueryDenomMetadataResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryDenomOwnersRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDenomOwnersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDenomOwnersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DenomOwner) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DenomOwner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DenomOwner: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Balance", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Balance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDenomOwnersResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryDenomOwnersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDenomOwnersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DenomOwners", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DenomOwners = append(m.DenomOwners, &DenomOwner{}) + if err := m.DenomOwners[len(m.DenomOwners)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/bank/types/query.pb.gw.go b/x/bank/types/query.pb.gw.go index 8b8ed9a526..60ebdb9756 100644 --- a/x/bank/types/query.pb.gw.go +++ b/x/bank/types/query.pb.gw.go @@ -377,6 +377,78 @@ func local_request_Query_DenomsMetadata_0(ctx context.Context, marshaler runtime } +var ( + filter_Query_DenomOwners_0 = &utilities.DoubleArray{Encoding: map[string]int{"denom": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_DenomOwners_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomOwnersRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DenomOwners_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DenomOwners(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_DenomOwners_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomOwnersRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["denom"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + } + + protoReq.Denom, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DenomOwners_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DenomOwners(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -523,6 +595,26 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_DenomOwners_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_DenomOwners_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DenomOwners_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -704,6 +796,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_DenomOwners_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_DenomOwners_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DenomOwners_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -721,6 +833,8 @@ var ( pattern_Query_DenomMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "bank", "v1beta1", "denoms_metadata", "denom"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_DenomsMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "denoms_metadata"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_DenomOwners_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "bank", "v1beta1", "denom_owners", "denom"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -737,4 +851,6 @@ var ( forward_Query_DenomMetadata_0 = runtime.ForwardResponseMessage forward_Query_DenomsMetadata_0 = runtime.ForwardResponseMessage + + forward_Query_DenomOwners_0 = runtime.ForwardResponseMessage ) From 325dabd83c66c23a1f2320783de552a14090a086 Mon Sep 17 00:00:00 2001 From: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com> Date: Mon, 28 Jun 2021 14:34:48 -0700 Subject: [PATCH 39/50] docs: add v0.43 version option (#9506) Co-authored-by: ryanchrypto <12519942+ryanchrypto@users.noreply.github.com> --- docs/.vuepress/config.js | 4 ++++ docs/versions | 1 + 2 files changed, 5 insertions(+) diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 01ae958a80..7721100094 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -46,6 +46,10 @@ module.exports = { "label": "v0.42", "key": "v0.42" }, + { + "label": "v0.43", + "key": "v0.43" + }, { "label": "master", "key": "master" diff --git a/docs/versions b/docs/versions index 0fc449e86f..d012300808 100644 --- a/docs/versions +++ b/docs/versions @@ -1,3 +1,4 @@ master master launchpad/backports v0.39 release/v0.42.x v0.42 +release/v0.43.x v0.43 From f65b6c9363fc452db3ea3881a44e3b040bf766bf Mon Sep 17 00:00:00 2001 From: Zaki Manian Date: Tue, 29 Jun 2021 01:10:04 -0700 Subject: [PATCH 40/50] feat: Error on blank chain-id in multisign command (#9593) Error on `tx multisign` command if chain-id is blank. This is a common cause of signature verification failures when combining signatures and the error message doesn't provide any clues to this common cause. I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- CHANGELOG.md | 3 +++ x/auth/client/cli/tx_multisign.go | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fbd1030d48..3ab7e5be6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,9 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (client/tx) [\#9421](https://github.com/cosmos/cosmos-sdk/pull/9421/) `BuildUnsignedTx`, `BuildSimTx`, `PrintUnsignedStdTx` functions are moved to the Tx Factory as methods. +### Improvements +* (cli) [\#9593](https://github.com/cosmos/cosmos-sdk/pull/9593) Check if chain-id is blank before verifying signatures in multisign and error. + ## [v0.43.0-rc0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.43.0-rc0) - 2021-06-25 ### Features diff --git a/x/auth/client/cli/tx_multisign.go b/x/auth/client/cli/tx_multisign.go index 7fdcace968..5beeba3a12 100644 --- a/x/auth/client/cli/tx_multisign.go +++ b/x/auth/client/cli/tx_multisign.go @@ -109,6 +109,10 @@ func makeMultiSignCmd() func(cmd *cobra.Command, args []string) (err error) { return err } + if txFactory.ChainID() == "" { + return fmt.Errorf("set the chain id with either the --chain-id flag or config file") + } + signingData := signing.SignerData{ ChainID: txFactory.ChainID(), AccountNumber: txFactory.AccountNumber(), From 7a8b273d934fbd85aee6e2e5798ca75b52988995 Mon Sep 17 00:00:00 2001 From: likhita-809 <78951027+likhita-809@users.noreply.github.com> Date: Tue, 29 Jun 2021 15:53:13 +0530 Subject: [PATCH 41/50] refactor: Move simapp FundAccount and FundModuleAccount to testutil (#9427) ref: #9346 --- CHANGELOG.md | 1 + simapp/test_helpers.go | 29 --------- types/query/filtered_pagination_test.go | 8 +-- types/query/pagination_test.go | 7 ++- x/auth/ante/ante_test.go | 10 ++-- x/auth/ante/fee_test.go | 6 +- x/auth/ante/feegrant_test.go | 7 +-- x/auth/signing/verify_test.go | 5 +- x/auth/vesting/handler_test.go | 3 +- x/authz/keeper/keeper_test.go | 5 +- x/authz/simulation/operations_test.go | 4 +- x/bank/app_test.go | 17 +++--- x/bank/bench_test.go | 5 +- x/bank/keeper/grpc_query_test.go | 6 +- x/bank/keeper/keeper_test.go | 63 ++++++++++---------- x/bank/keeper/querier_test.go | 6 +- x/bank/simulation/operations_test.go | 3 +- x/bank/testutil/test_helpers.go | 35 +++++++++++ x/distribution/keeper/allocation_test.go | 5 +- x/distribution/keeper/delegation_test.go | 5 +- x/distribution/keeper/grpc_query_test.go | 3 +- x/distribution/keeper/keeper_test.go | 5 +- x/distribution/proposal_handler_test.go | 3 +- x/distribution/simulation/operations_test.go | 5 +- x/feegrant/simulation/operations_test.go | 4 +- x/genutil/gentx_test.go | 3 +- x/gov/simulation/operations_test.go | 3 +- x/slashing/simulation/operations_test.go | 3 +- x/staking/genesis_test.go | 5 +- x/staking/handler_test.go | 6 +- x/staking/keeper/delegation_test.go | 37 ++++++------ x/staking/keeper/slash_test.go | 13 ++-- x/staking/keeper/validator_test.go | 27 +++++---- x/staking/simulation/operations_test.go | 3 +- 34 files changed, 187 insertions(+), 163 deletions(-) create mode 100644 x/bank/testutil/test_helpers.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ab7e5be6a..72a86acc41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking Changes +* [\#9427](https://github.com/cosmos/cosmos-sdk/pull/9427) Move simapp `FundAccount` and `FundModuleAccount` to `x/bank/testutil` * (client/tx) [\#9421](https://github.com/cosmos/cosmos-sdk/pull/9421/) `BuildUnsignedTx`, `BuildSimTx`, `PrintUnsignedStdTx` functions are moved to the Tx Factory as methods. diff --git a/simapp/test_helpers.go b/simapp/test_helpers.go index 4f45b23eac..9b50236e9d 100644 --- a/simapp/test_helpers.go +++ b/simapp/test_helpers.go @@ -26,7 +26,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/errors" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -437,31 +436,3 @@ type EmptyAppOptions struct{} func (ao EmptyAppOptions) Get(o string) interface{} { return nil } - -// FundAccount is a utility function that funds an account by minting and -// sending the coins to the address. This should be used for testing purposes -// only! -// -// TODO: Instead of using the mint module account, which has the -// permission of minting, create a "faucet" account. (@fdymylja) -func FundAccount(bankKeeper bankkeeper.Keeper, ctx sdk.Context, addr sdk.AccAddress, amounts sdk.Coins) error { - if err := bankKeeper.MintCoins(ctx, minttypes.ModuleName, amounts); err != nil { - return err - } - - return bankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, addr, amounts) -} - -// FundModuleAccount is a utility function that funds a module account by -// minting and sending the coins to the address. This should be used for testing -// purposes only! -// -// TODO: Instead of using the mint module account, which has the -// permission of minting, create a "faucet" account. (@fdymylja) -func FundModuleAccount(bankKeeper bankkeeper.Keeper, ctx sdk.Context, recipientMod string, amounts sdk.Coins) error { - if err := bankKeeper.MintCoins(ctx, minttypes.ModuleName, amounts); err != nil { - return err - } - - return bankKeeper.SendCoinsFromModuleToModule(ctx, minttypes.ModuleName, recipientMod, amounts) -} diff --git a/types/query/filtered_pagination_test.go b/types/query/filtered_pagination_test.go index 913211b284..7f462a6039 100644 --- a/types/query/filtered_pagination_test.go +++ b/types/query/filtered_pagination_test.go @@ -4,11 +4,11 @@ import ( "fmt" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" "github.com/cosmos/cosmos-sdk/types/query" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/bank/types" ) @@ -32,7 +32,7 @@ func (s *paginationTestSuite) TestFilteredPaginations() { addr1 := sdk.AccAddress([]byte("addr1")) acc1 := app.AccountKeeper.NewAccountWithAddress(ctx, addr1) app.AccountKeeper.SetAccount(ctx, acc1) - s.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr1, balances)) + s.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr1, balances)) store := ctx.KVStore(app.GetKey(types.StoreKey)) // verify pagination with limit > total values @@ -107,7 +107,7 @@ func (s *paginationTestSuite) TestReverseFilteredPaginations() { addr1 := sdk.AccAddress([]byte("addr1")) acc1 := app.AccountKeeper.NewAccountWithAddress(ctx, addr1) app.AccountKeeper.SetAccount(ctx, acc1) - s.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr1, balances)) + s.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr1, balances)) store := ctx.KVStore(app.GetKey(types.StoreKey)) // verify pagination with limit > total values @@ -188,7 +188,7 @@ func ExampleFilteredPaginate() { addr1 := sdk.AccAddress([]byte("addr1")) acc1 := app.AccountKeeper.NewAccountWithAddress(ctx, addr1) app.AccountKeeper.SetAccount(ctx, acc1) - err := simapp.FundAccount(app.BankKeeper, ctx, addr1, balances) + err := testutil.FundAccount(app.BankKeeper, ctx, addr1, balances) if err != nil { // should return no error fmt.Println(err) } diff --git a/types/query/pagination_test.go b/types/query/pagination_test.go index da07a5e1b0..98097642a1 100644 --- a/types/query/pagination_test.go +++ b/types/query/pagination_test.go @@ -18,6 +18,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" "github.com/cosmos/cosmos-sdk/types/query" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/bank/types" ) @@ -76,7 +77,7 @@ func (s *paginationTestSuite) TestPagination() { addr1 := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) acc1 := app.AccountKeeper.NewAccountWithAddress(ctx, addr1) app.AccountKeeper.SetAccount(ctx, acc1) - s.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr1, balances)) + s.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr1, balances)) s.T().Log("verify empty page request results a max of defaultLimit records and counts total records") pageReq := &query.PageRequest{} @@ -185,7 +186,7 @@ func (s *paginationTestSuite) TestReversePagination() { addr1 := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) acc1 := app.AccountKeeper.NewAccountWithAddress(ctx, addr1) app.AccountKeeper.SetAccount(ctx, acc1) - s.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr1, balances)) + s.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr1, balances)) s.T().Log("verify paginate with custom limit and countTotal, Reverse false") pageReq := &query.PageRequest{Limit: 2, CountTotal: true, Reverse: true, Key: nil} @@ -306,7 +307,7 @@ func ExamplePaginate() { addr1 := sdk.AccAddress([]byte("addr1")) acc1 := app.AccountKeeper.NewAccountWithAddress(ctx, addr1) app.AccountKeeper.SetAccount(ctx, acc1) - err := simapp.FundAccount(app.BankKeeper, ctx, addr1, balances) + err := testutil.FundAccount(app.BankKeeper, ctx, addr1, balances) if err != nil { // should return no error fmt.Println(err) } diff --git a/x/auth/ante/ante_test.go b/x/auth/ante/ante_test.go index d2af809044..3ce43a5a17 100644 --- a/x/auth/ante/ante_test.go +++ b/x/auth/ante/ante_test.go @@ -7,10 +7,6 @@ import ( "strings" "testing" - "github.com/cosmos/cosmos-sdk/simapp" - - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" @@ -23,6 +19,8 @@ import ( "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/ante" "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) // Test that simulate transaction accurately estimates gas cost @@ -472,7 +470,7 @@ func (suite *AnteTestSuite) TestAnteHandlerFees() { { "signer does not have enough funds to pay the fee", func() { - err := simapp.FundAccount(suite.app.BankKeeper, suite.ctx, addr0, sdk.NewCoins(sdk.NewInt64Coin("atom", 149))) + err := testutil.FundAccount(suite.app.BankKeeper, suite.ctx, addr0, sdk.NewCoins(sdk.NewInt64Coin("atom", 149))) suite.Require().NoError(err) }, false, @@ -489,7 +487,7 @@ func (suite *AnteTestSuite) TestAnteHandlerFees() { suite.Require().True(suite.app.BankKeeper.GetAllBalances(suite.ctx, modAcc.GetAddress()).Empty()) require.True(sdk.IntEq(suite.T(), suite.app.BankKeeper.GetAllBalances(suite.ctx, addr0).AmountOf("atom"), sdk.NewInt(149))) - err := simapp.FundAccount(suite.app.BankKeeper, suite.ctx, addr0, sdk.NewCoins(sdk.NewInt64Coin("atom", 1))) + err := testutil.FundAccount(suite.app.BankKeeper, suite.ctx, addr0, sdk.NewCoins(sdk.NewInt64Coin("atom", 1))) suite.Require().NoError(err) }, false, diff --git a/x/auth/ante/fee_test.go b/x/auth/ante/fee_test.go index 7edd8fad92..06ccb4d394 100644 --- a/x/auth/ante/fee_test.go +++ b/x/auth/ante/fee_test.go @@ -2,10 +2,10 @@ package ante_test import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/ante" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" ) func (suite *AnteTestSuite) TestEnsureMempoolFees() { @@ -83,7 +83,7 @@ func (suite *AnteTestSuite) TestDeductFees() { acc := suite.app.AccountKeeper.NewAccountWithAddress(suite.ctx, addr1) suite.app.AccountKeeper.SetAccount(suite.ctx, acc) coins := sdk.NewCoins(sdk.NewCoin("atom", sdk.NewInt(10))) - err = simapp.FundAccount(suite.app.BankKeeper, suite.ctx, addr1, coins) + err = testutil.FundAccount(suite.app.BankKeeper, suite.ctx, addr1, coins) suite.Require().NoError(err) dfd := ante.NewDeductFeeDecorator(suite.app.AccountKeeper, suite.app.BankKeeper, nil) @@ -95,7 +95,7 @@ func (suite *AnteTestSuite) TestDeductFees() { // Set account with sufficient funds suite.app.AccountKeeper.SetAccount(suite.ctx, acc) - err = simapp.FundAccount(suite.app.BankKeeper, suite.ctx, addr1, sdk.NewCoins(sdk.NewCoin("atom", sdk.NewInt(200)))) + err = testutil.FundAccount(suite.app.BankKeeper, suite.ctx, addr1, sdk.NewCoins(sdk.NewCoin("atom", sdk.NewInt(200)))) suite.Require().NoError(err) _, err = antehandler(suite.ctx, tx, false) diff --git a/x/auth/ante/feegrant_test.go b/x/auth/ante/feegrant_test.go index b23c2cec61..7c03e3dbef 100644 --- a/x/auth/ante/feegrant_test.go +++ b/x/auth/ante/feegrant_test.go @@ -10,8 +10,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - - "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/simapp/helpers" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" @@ -21,6 +19,7 @@ import ( authsign "github.com/cosmos/cosmos-sdk/x/auth/signing" "github.com/cosmos/cosmos-sdk/x/auth/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/feegrant" ) @@ -46,11 +45,11 @@ func (suite *AnteTestSuite) TestDeductFeesNoDelegation() { priv5, _, addr5 := testdata.KeyTestPubAddr() // Set addr1 with insufficient funds - err := simapp.FundAccount(suite.app.BankKeeper, suite.ctx, addr1, []sdk.Coin{sdk.NewCoin("atom", sdk.NewInt(10))}) + err := testutil.FundAccount(suite.app.BankKeeper, suite.ctx, addr1, []sdk.Coin{sdk.NewCoin("atom", sdk.NewInt(10))}) suite.Require().NoError(err) // Set addr2 with more funds - err = simapp.FundAccount(suite.app.BankKeeper, suite.ctx, addr2, []sdk.Coin{sdk.NewCoin("atom", sdk.NewInt(99999))}) + err = testutil.FundAccount(suite.app.BankKeeper, suite.ctx, addr2, []sdk.Coin{sdk.NewCoin("atom", sdk.NewInt(99999))}) suite.Require().NoError(err) // grant fee allowance from `addr2` to `addr3` (plenty to pay) diff --git a/x/auth/signing/verify_test.go b/x/auth/signing/verify_test.go index 56df1811c2..d3f2194c14 100644 --- a/x/auth/signing/verify_test.go +++ b/x/auth/signing/verify_test.go @@ -17,6 +17,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx" "github.com/cosmos/cosmos-sdk/x/auth/signing" "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" ) func TestVerifySignature(t *testing.T) { @@ -40,9 +41,9 @@ func TestVerifySignature(t *testing.T) { _ = app.AccountKeeper.NewAccountWithAddress(ctx, addr1) app.AccountKeeper.SetAccount(ctx, acc1) balances := sdk.NewCoins(sdk.NewInt64Coin("atom", 200)) - require.NoError(t, simapp.FundAccount(app.BankKeeper, ctx, addr, balances)) + require.NoError(t, testutil.FundAccount(app.BankKeeper, ctx, addr, balances)) acc, err := ante.GetSignerAcc(ctx, app.AccountKeeper, addr) - require.NoError(t, simapp.FundAccount(app.BankKeeper, ctx, addr, balances)) + require.NoError(t, testutil.FundAccount(app.BankKeeper, ctx, addr, balances)) msgs := []sdk.Msg{testdata.NewTestMsg(addr)} fee := legacytx.NewStdFee(50000, sdk.Coins{sdk.NewInt64Coin("atom", 150)}) diff --git a/x/auth/vesting/handler_test.go b/x/auth/vesting/handler_test.go index f78a337044..8af58073e9 100644 --- a/x/auth/vesting/handler_test.go +++ b/x/auth/vesting/handler_test.go @@ -10,6 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting" "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" ) type HandlerTestSuite struct { @@ -37,7 +38,7 @@ func (suite *HandlerTestSuite) TestMsgCreateVestingAccount() { acc1 := suite.app.AccountKeeper.NewAccountWithAddress(ctx, addr1) suite.app.AccountKeeper.SetAccount(ctx, acc1) - suite.Require().NoError(simapp.FundAccount(suite.app.BankKeeper, ctx, addr1, balances)) + suite.Require().NoError(testutil.FundAccount(suite.app.BankKeeper, ctx, addr1, balances)) testCases := []struct { name string diff --git a/x/authz/keeper/keeper_test.go b/x/authz/keeper/keeper_test.go index 8dfebac95a..2500f7a87d 100644 --- a/x/authz/keeper/keeper_test.go +++ b/x/authz/keeper/keeper_test.go @@ -12,6 +12,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/authz" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ) @@ -129,7 +130,7 @@ func (s *TestSuite) TestKeeperFees() { granterAddr := addrs[0] granteeAddr := addrs[1] recipientAddr := addrs[2] - s.Require().NoError(simapp.FundAccount(app.BankKeeper, s.ctx, granterAddr, sdk.NewCoins(sdk.NewInt64Coin("steak", 10000)))) + s.Require().NoError(testutil.FundAccount(app.BankKeeper, s.ctx, granterAddr, sdk.NewCoins(sdk.NewInt64Coin("steak", 10000)))) now := s.ctx.BlockHeader().Time s.Require().NotNil(now) @@ -204,7 +205,7 @@ func (s *TestSuite) TestDispatchedEvents() { granterAddr := addrs[0] granteeAddr := addrs[1] recipientAddr := addrs[2] - require.NoError(simapp.FundAccount(app.BankKeeper, s.ctx, granterAddr, sdk.NewCoins(sdk.NewInt64Coin("steak", 10000)))) + require.NoError(testutil.FundAccount(app.BankKeeper, s.ctx, granterAddr, sdk.NewCoins(sdk.NewInt64Coin("steak", 10000)))) now := s.ctx.BlockHeader().Time require.NotNil(now) diff --git a/x/authz/simulation/operations_test.go b/x/authz/simulation/operations_test.go index bdb7f98f82..4202eed730 100644 --- a/x/authz/simulation/operations_test.go +++ b/x/authz/simulation/operations_test.go @@ -6,7 +6,6 @@ import ( "time" "github.com/stretchr/testify/suite" - abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" @@ -15,6 +14,7 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/authz" "github.com/cosmos/cosmos-sdk/x/authz/simulation" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ) @@ -76,7 +76,7 @@ func (suite *SimTestSuite) getTestingAccounts(r *rand.Rand, n int) []simtypes.Ac for _, account := range accounts { acc := suite.app.AccountKeeper.NewAccountWithAddress(suite.ctx, account.Address) suite.app.AccountKeeper.SetAccount(suite.ctx, acc) - suite.Require().NoError(simapp.FundAccount(suite.app.BankKeeper, suite.ctx, account.Address, initCoins)) + suite.Require().NoError(testutil.FundAccount(suite.app.BankKeeper, suite.ctx, account.Address, initCoins)) } return accounts diff --git a/x/bank/app_test.go b/x/bank/app_test.go index ba8085026a..5e134010e4 100644 --- a/x/bank/app_test.go +++ b/x/bank/app_test.go @@ -11,6 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/bank/types" ) @@ -94,7 +95,7 @@ func TestSendNotEnoughBalance(t *testing.T) { app := simapp.SetupWithGenesisAccounts(genAccs) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - require.NoError(t, simapp.FundAccount(app.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 67)))) + require.NoError(t, testutil.FundAccount(app.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 67)))) app.Commit() @@ -129,7 +130,7 @@ func TestMsgMultiSendWithAccounts(t *testing.T) { app := simapp.SetupWithGenesisAccounts(genAccs) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - require.NoError(t, simapp.FundAccount(app.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 67)))) + require.NoError(t, testutil.FundAccount(app.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 67)))) app.Commit() @@ -199,9 +200,9 @@ func TestMsgMultiSendMultipleOut(t *testing.T) { app := simapp.SetupWithGenesisAccounts(genAccs) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - require.NoError(t, simapp.FundAccount(app.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 42)))) + require.NoError(t, testutil.FundAccount(app.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 42)))) - require.NoError(t, simapp.FundAccount(app.BankKeeper, ctx, addr2, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 42)))) + require.NoError(t, testutil.FundAccount(app.BankKeeper, ctx, addr2, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 42)))) app.Commit() @@ -248,11 +249,11 @@ func TestMsgMultiSendMultipleInOut(t *testing.T) { app := simapp.SetupWithGenesisAccounts(genAccs) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - require.NoError(t, simapp.FundAccount(app.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 42)))) + require.NoError(t, testutil.FundAccount(app.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 42)))) - require.NoError(t, simapp.FundAccount(app.BankKeeper, ctx, addr2, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 42)))) + require.NoError(t, testutil.FundAccount(app.BankKeeper, ctx, addr2, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 42)))) - require.NoError(t, simapp.FundAccount(app.BankKeeper, ctx, addr4, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 42)))) + require.NoError(t, testutil.FundAccount(app.BankKeeper, ctx, addr4, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 42)))) app.Commit() @@ -295,7 +296,7 @@ func TestMsgMultiSendDependent(t *testing.T) { app := simapp.SetupWithGenesisAccounts(genAccs) ctx := app.BaseApp.NewContext(false, tmproto.Header{}) - require.NoError(t, simapp.FundAccount(app.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 42)))) + require.NoError(t, testutil.FundAccount(app.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 42)))) app.Commit() diff --git a/x/bank/bench_test.go b/x/bank/bench_test.go index 4ba2624b76..3550f44f7b 100644 --- a/x/bank/bench_test.go +++ b/x/bank/bench_test.go @@ -12,6 +12,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -30,7 +31,7 @@ func BenchmarkOneBankSendTxPerBlock(b *testing.B) { ctx := benchmarkApp.BaseApp.NewContext(false, tmproto.Header{}) // some value conceivably higher than the benchmarks would ever go - require.NoError(b, simapp.FundAccount(benchmarkApp.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 100000000000)))) + require.NoError(b, testutil.FundAccount(benchmarkApp.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 100000000000)))) benchmarkApp.Commit() txGen := simappparams.MakeTestEncodingConfig().TxConfig @@ -72,7 +73,7 @@ func BenchmarkOneBankMultiSendTxPerBlock(b *testing.B) { ctx := benchmarkApp.BaseApp.NewContext(false, tmproto.Header{}) // some value conceivably higher than the benchmarks would ever go - require.NoError(b, simapp.FundAccount(benchmarkApp.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 100000000000)))) + require.NoError(b, testutil.FundAccount(benchmarkApp.BankKeeper, ctx, addr1, sdk.NewCoins(sdk.NewInt64Coin("foocoin", 100000000000)))) benchmarkApp.Commit() txGen := simappparams.MakeTestEncodingConfig().TxConfig diff --git a/x/bank/keeper/grpc_query_test.go b/x/bank/keeper/grpc_query_test.go index 4593d8585b..50be8cea94 100644 --- a/x/bank/keeper/grpc_query_test.go +++ b/x/bank/keeper/grpc_query_test.go @@ -4,11 +4,11 @@ import ( gocontext "context" "fmt" - "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/bank/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) @@ -33,7 +33,7 @@ func (suite *IntegrationTestSuite) TestQueryBalance() { acc := app.AccountKeeper.NewAccountWithAddress(ctx, addr) app.AccountKeeper.SetAccount(ctx, acc) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, acc.GetAddress(), origCoins)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, acc.GetAddress(), origCoins)) res, err = queryClient.Balance(gocontext.Background(), req) suite.Require().NoError(err) @@ -65,7 +65,7 @@ func (suite *IntegrationTestSuite) TestQueryAllBalances() { acc := app.AccountKeeper.NewAccountWithAddress(ctx, addr) app.AccountKeeper.SetAccount(ctx, acc) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, acc.GetAddress(), origCoins)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, acc.GetAddress(), origCoins)) res, err = queryClient.AllBalances(gocontext.Background(), req) suite.Require().NoError(err) diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index f9074f423e..5e67204d34 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -4,11 +4,6 @@ import ( "testing" "time" - "github.com/cosmos/cosmos-sdk/types/query" - - "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/stretchr/testify/suite" abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" @@ -17,11 +12,15 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" "github.com/cosmos/cosmos-sdk/x/bank/keeper" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/bank/types" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) const ( @@ -310,7 +309,7 @@ func (suite *IntegrationTestSuite) TestSendCoinsNewAccount() { addr1 := sdk.AccAddress([]byte("addr1_______________")) acc1 := app.AccountKeeper.NewAccountWithAddress(ctx, addr1) app.AccountKeeper.SetAccount(ctx, acc1) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr1, balances)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr1, balances)) acc1Balances := app.BankKeeper.GetAllBalances(ctx, addr1) suite.Require().Equal(balances, acc1Balances) @@ -340,7 +339,7 @@ func (suite *IntegrationTestSuite) TestInputOutputNewAccount() { addr1 := sdk.AccAddress([]byte("addr1_______________")) acc1 := app.AccountKeeper.NewAccountWithAddress(ctx, addr1) app.AccountKeeper.SetAccount(ctx, acc1) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr1, balances)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr1, balances)) acc1Balances := app.BankKeeper.GetAllBalances(ctx, addr1) suite.Require().Equal(balances, acc1Balances) @@ -393,7 +392,7 @@ func (suite *IntegrationTestSuite) TestInputOutputCoins() { suite.Require().Error(app.BankKeeper.InputOutputCoins(ctx, inputs, []types.Output{})) suite.Require().Error(app.BankKeeper.InputOutputCoins(ctx, inputs, outputs)) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr1, balances)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr1, balances)) insufficientInputs := []types.Input{ {Address: addr1.String(), Coins: sdk.NewCoins(newFooCoin(300), newBarCoin(100))}, @@ -428,12 +427,12 @@ func (suite *IntegrationTestSuite) TestSendCoins() { addr2 := sdk.AccAddress("addr2_______________") acc2 := app.AccountKeeper.NewAccountWithAddress(ctx, addr2) app.AccountKeeper.SetAccount(ctx, acc2) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr2, balances)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr2, balances)) sendAmt := sdk.NewCoins(newFooCoin(50), newBarCoin(25)) suite.Require().Error(app.BankKeeper.SendCoins(ctx, addr1, addr2, sendAmt)) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr1, balances)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr1, balances)) suite.Require().NoError(app.BankKeeper.SendCoins(ctx, addr1, addr2, sendAmt)) acc1Balances := app.BankKeeper.GetAllBalances(ctx, addr1) @@ -469,14 +468,14 @@ func (suite *IntegrationTestSuite) TestValidateBalance() { app.AccountKeeper.SetAccount(ctx, acc) balances := sdk.NewCoins(newFooCoin(100)) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr1, balances)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr1, balances)) suite.Require().NoError(app.BankKeeper.ValidateBalance(ctx, addr1)) bacc := authtypes.NewBaseAccountWithAddress(addr2) vacc := vesting.NewContinuousVestingAccount(bacc, balances.Add(balances...), now.Unix(), endTime.Unix()) app.AccountKeeper.SetAccount(ctx, vacc) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr2, balances)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr2, balances)) suite.Require().Error(app.BankKeeper.ValidateBalance(ctx, addr2)) } @@ -533,7 +532,7 @@ func (suite *IntegrationTestSuite) TestHasBalance() { balances := sdk.NewCoins(newFooCoin(100)) suite.Require().False(app.BankKeeper.HasBalance(ctx, addr, newFooCoin(99))) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr, balances)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr, balances)) suite.Require().False(app.BankKeeper.HasBalance(ctx, addr, newFooCoin(101))) suite.Require().True(app.BankKeeper.HasBalance(ctx, addr, newFooCoin(100))) suite.Require().True(app.BankKeeper.HasBalance(ctx, addr, newFooCoin(1))) @@ -547,7 +546,7 @@ func (suite *IntegrationTestSuite) TestMsgSendEvents() { app.AccountKeeper.SetAccount(ctx, acc) newCoins := sdk.NewCoins(sdk.NewInt64Coin(fooDenom, 50)) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr, newCoins)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr, newCoins)) suite.Require().NoError(app.BankKeeper.SendCoins(ctx, addr, addr2, newCoins)) event1 := sdk.Event{ @@ -615,7 +614,7 @@ func (suite *IntegrationTestSuite) TestMsgMultiSendEvents() { suite.Require().Equal(0, len(events)) // Set addr's coins but not addr2's coins - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr, sdk.NewCoins(sdk.NewInt64Coin(fooDenom, 50)))) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr, sdk.NewCoins(sdk.NewInt64Coin(fooDenom, 50)))) suite.Require().Error(app.BankKeeper.InputOutputCoins(ctx, inputs, outputs)) events = ctx.EventManager().ABCIEvents() @@ -632,10 +631,10 @@ func (suite *IntegrationTestSuite) TestMsgMultiSendEvents() { suite.Require().Equal(abci.Event(event1), events[7]) // Set addr's coins and addr2's coins - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr, sdk.NewCoins(sdk.NewInt64Coin(fooDenom, 50)))) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr, sdk.NewCoins(sdk.NewInt64Coin(fooDenom, 50)))) newCoins = sdk.NewCoins(sdk.NewInt64Coin(fooDenom, 50)) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr2, sdk.NewCoins(sdk.NewInt64Coin(barDenom, 100)))) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr2, sdk.NewCoins(sdk.NewInt64Coin(barDenom, 100)))) newCoins2 = sdk.NewCoins(sdk.NewInt64Coin(barDenom, 100)) suite.Require().NoError(app.BankKeeper.InputOutputCoins(ctx, inputs, outputs)) @@ -702,8 +701,8 @@ func (suite *IntegrationTestSuite) TestSpendableCoins() { app.AccountKeeper.SetAccount(ctx, macc) app.AccountKeeper.SetAccount(ctx, vacc) app.AccountKeeper.SetAccount(ctx, acc) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr1, origCoins)) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr2, origCoins)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr1, origCoins)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr2, origCoins)) suite.Require().Equal(origCoins, app.BankKeeper.SpendableCoins(ctx, addr2)) @@ -728,13 +727,13 @@ func (suite *IntegrationTestSuite) TestVestingAccountSend() { vacc := vesting.NewContinuousVestingAccount(bacc, origCoins, now.Unix(), endTime.Unix()) app.AccountKeeper.SetAccount(ctx, vacc) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr1, origCoins)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr1, origCoins)) // require that no coins be sendable at the beginning of the vesting schedule suite.Require().Error(app.BankKeeper.SendCoins(ctx, addr1, addr2, sendCoins)) // receive some coins - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr1, sendCoins)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr1, sendCoins)) // require that all vested coins are spendable plus any received ctx = ctx.WithBlockTime(now.Add(12 * time.Hour)) suite.Require().NoError(app.BankKeeper.SendCoins(ctx, addr1, addr2, sendCoins)) @@ -760,13 +759,13 @@ func (suite *IntegrationTestSuite) TestPeriodicVestingAccountSend() { vacc := vesting.NewPeriodicVestingAccount(bacc, origCoins, ctx.BlockHeader().Time.Unix(), periods) app.AccountKeeper.SetAccount(ctx, vacc) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr1, origCoins)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr1, origCoins)) // require that no coins be sendable at the beginning of the vesting schedule suite.Require().Error(app.BankKeeper.SendCoins(ctx, addr1, addr2, sendCoins)) // receive some coins - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr1, sendCoins)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr1, sendCoins)) // require that all vested coins are spendable plus any received ctx = ctx.WithBlockTime(now.Add(12 * time.Hour)) @@ -792,8 +791,8 @@ func (suite *IntegrationTestSuite) TestVestingAccountReceive() { app.AccountKeeper.SetAccount(ctx, vacc) app.AccountKeeper.SetAccount(ctx, acc) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr1, origCoins)) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr2, origCoins)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr1, origCoins)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr2, origCoins)) // send some coins to the vesting account suite.Require().NoError(app.BankKeeper.SendCoins(ctx, addr2, addr1, sendCoins)) @@ -831,8 +830,8 @@ func (suite *IntegrationTestSuite) TestPeriodicVestingAccountReceive() { app.AccountKeeper.SetAccount(ctx, vacc) app.AccountKeeper.SetAccount(ctx, acc) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr1, origCoins)) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr2, origCoins)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr1, origCoins)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr2, origCoins)) // send some coins to the vesting account suite.Require().NoError(app.BankKeeper.SendCoins(ctx, addr2, addr1, sendCoins)) @@ -868,8 +867,8 @@ func (suite *IntegrationTestSuite) TestDelegateCoins() { app.AccountKeeper.SetAccount(ctx, vacc) app.AccountKeeper.SetAccount(ctx, acc) app.AccountKeeper.SetAccount(ctx, macc) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr1, origCoins)) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr2, origCoins)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr1, origCoins)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr2, origCoins)) ctx = ctx.WithBlockTime(now.Add(12 * time.Hour)) @@ -932,8 +931,8 @@ func (suite *IntegrationTestSuite) TestUndelegateCoins() { app.AccountKeeper.SetAccount(ctx, vacc) app.AccountKeeper.SetAccount(ctx, acc) app.AccountKeeper.SetAccount(ctx, macc) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr1, origCoins)) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr2, origCoins)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr1, origCoins)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr2, origCoins)) ctx = ctx.WithBlockTime(now.Add(12 * time.Hour)) @@ -983,7 +982,7 @@ func (suite *IntegrationTestSuite) TestUndelegateCoins_Invalid() { suite.Require().Error(app.BankKeeper.UndelegateCoins(ctx, addrModule, addr1, delCoins)) app.AccountKeeper.SetAccount(ctx, macc) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addr1, origCoins)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addr1, origCoins)) suite.Require().Error(app.BankKeeper.UndelegateCoins(ctx, addrModule, addr1, delCoins)) app.AccountKeeper.SetAccount(ctx, acc) diff --git a/x/bank/keeper/querier_test.go b/x/bank/keeper/querier_test.go index 66f98fdd17..8404ed360f 100644 --- a/x/bank/keeper/querier_test.go +++ b/x/bank/keeper/querier_test.go @@ -5,11 +5,11 @@ import ( abci "github.com/tendermint/tendermint/abci/types" - "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" "github.com/cosmos/cosmos-sdk/x/bank/keeper" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/bank/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) @@ -42,7 +42,7 @@ func (suite *IntegrationTestSuite) TestQuerier_QueryBalance() { acc := app.AccountKeeper.NewAccountWithAddress(ctx, addr) app.AccountKeeper.SetAccount(ctx, acc) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, acc.GetAddress(), origCoins)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, acc.GetAddress(), origCoins)) res, err = querier(ctx, []string{types.QueryBalance}, req) suite.Require().NoError(err) @@ -79,7 +79,7 @@ func (suite *IntegrationTestSuite) TestQuerier_QueryAllBalances() { acc := app.AccountKeeper.NewAccountWithAddress(ctx, addr) app.AccountKeeper.SetAccount(ctx, acc) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, acc.GetAddress(), origCoins)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, acc.GetAddress(), origCoins)) res, err = querier(ctx, []string{types.QueryAllBalances}, req) suite.Require().NoError(err) suite.Require().NotNil(res) diff --git a/x/bank/simulation/operations_test.go b/x/bank/simulation/operations_test.go index aeaa9f9389..b00716d27d 100644 --- a/x/bank/simulation/operations_test.go +++ b/x/bank/simulation/operations_test.go @@ -13,6 +13,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/bank/simulation" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/bank/types" ) @@ -193,7 +194,7 @@ func (suite *SimTestSuite) getTestingAccounts(r *rand.Rand, n int) []simtypes.Ac for _, account := range accounts { acc := suite.app.AccountKeeper.NewAccountWithAddress(suite.ctx, account.Address) suite.app.AccountKeeper.SetAccount(suite.ctx, acc) - suite.Require().NoError(simapp.FundAccount(suite.app.BankKeeper, suite.ctx, account.Address, initCoins)) + suite.Require().NoError(testutil.FundAccount(suite.app.BankKeeper, suite.ctx, account.Address, initCoins)) } return accounts diff --git a/x/bank/testutil/test_helpers.go b/x/bank/testutil/test_helpers.go new file mode 100644 index 0000000000..e8805ed7b3 --- /dev/null +++ b/x/bank/testutil/test_helpers.go @@ -0,0 +1,35 @@ +package testutil + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" +) + +// FundAccount is a utility function that funds an account by minting and +// sending the coins to the address. This should be used for testing purposes +// only! +// +// TODO: Instead of using the mint module account, which has the +// permission of minting, create a "faucet" account. (@fdymylja) +func FundAccount(bankKeeper bankkeeper.Keeper, ctx sdk.Context, addr sdk.AccAddress, amounts sdk.Coins) error { + if err := bankKeeper.MintCoins(ctx, minttypes.ModuleName, amounts); err != nil { + return err + } + + return bankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, addr, amounts) +} + +// FundModuleAccount is a utility function that funds a module account by +// minting and sending the coins to the address. This should be used for testing +// purposes only! +// +// TODO: Instead of using the mint module account, which has the +// permission of minting, create a "faucet" account. (@fdymylja) +func FundModuleAccount(bankKeeper bankkeeper.Keeper, ctx sdk.Context, recipientMod string, amounts sdk.Coins) error { + if err := bankKeeper.MintCoins(ctx, minttypes.ModuleName, amounts); err != nil { + return err + } + + return bankKeeper.SendCoinsFromModuleToModule(ctx, minttypes.ModuleName, recipientMod, amounts) +} diff --git a/x/distribution/keeper/allocation_test.go b/x/distribution/keeper/allocation_test.go index 5bcb8c1cff..bc7058d6f7 100644 --- a/x/distribution/keeper/allocation_test.go +++ b/x/distribution/keeper/allocation_test.go @@ -10,6 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) @@ -83,7 +84,7 @@ func TestAllocateTokensToManyValidators(t *testing.T) { require.NotNil(t, feeCollector) // fund fee collector - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, feeCollector.GetName(), fees)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, feeCollector.GetName(), fees)) app.AccountKeeper.SetAccount(ctx, feeCollector) @@ -163,7 +164,7 @@ func TestAllocateTokensTruncation(t *testing.T) { feeCollector := app.AccountKeeper.GetModuleAccount(ctx, types.FeeCollectorName) require.NotNil(t, feeCollector) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, feeCollector.GetName(), fees)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, feeCollector.GetName(), fees)) app.AccountKeeper.SetAccount(ctx, feeCollector) diff --git a/x/distribution/keeper/delegation_test.go b/x/distribution/keeper/delegation_test.go index 8b4219e280..7da5fc0296 100644 --- a/x/distribution/keeper/delegation_test.go +++ b/x/distribution/keeper/delegation_test.go @@ -8,6 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -280,7 +281,7 @@ func TestWithdrawDelegationRewardsBasic(t *testing.T) { // set module account coins distrAcc := app.DistrKeeper.GetDistributionAccount(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, distrAcc.GetName(), sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, balanceTokens)))) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, distrAcc.GetName(), sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, balanceTokens)))) app.AccountKeeper.SetModuleAccount(ctx, distrAcc) // create validator with 50% commission @@ -492,7 +493,7 @@ func TestCalculateRewardsMultiDelegatorMultWithdraw(t *testing.T) { // set module account coins distrAcc := app.DistrKeeper.GetDistributionAccount(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, distrAcc.GetName(), sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(1000))))) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, distrAcc.GetName(), sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(1000))))) app.AccountKeeper.SetModuleAccount(ctx, distrAcc) tokens := sdk.DecCoins{sdk.NewDecCoinFromDec(sdk.DefaultBondDenom, sdk.NewDec(initial))} diff --git a/x/distribution/keeper/grpc_query_test.go b/x/distribution/keeper/grpc_query_test.go index b8b716ddbc..33f2722304 100644 --- a/x/distribution/keeper/grpc_query_test.go +++ b/x/distribution/keeper/grpc_query_test.go @@ -12,6 +12,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/distribution/types" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" @@ -623,7 +624,7 @@ func (suite *KeeperTestSuite) TestGRPCCommunityPool() { "valid request", func() { amount := sdk.NewCoins(sdk.NewInt64Coin("stake", 100)) - suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, addrs[0], amount)) + suite.Require().NoError(testutil.FundAccount(app.BankKeeper, ctx, addrs[0], amount)) err := app.DistrKeeper.FundCommunityPool(ctx, amount, addrs[0]) suite.Require().Nil(err) diff --git a/x/distribution/keeper/keeper_test.go b/x/distribution/keeper/keeper_test.go index 40d6dcd736..bdb241051e 100644 --- a/x/distribution/keeper/keeper_test.go +++ b/x/distribution/keeper/keeper_test.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/distribution/types" ) @@ -49,7 +50,7 @@ func TestWithdrawValidatorCommission(t *testing.T) { // set module account coins distrAcc := app.DistrKeeper.GetDistributionAccount(ctx) coins := sdk.NewCoins(sdk.NewCoin("mytoken", sdk.NewInt(2)), sdk.NewCoin("stake", sdk.NewInt(2))) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, distrAcc.GetName(), coins)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, distrAcc.GetName(), coins)) app.AccountKeeper.SetModuleAccount(ctx, distrAcc) @@ -114,7 +115,7 @@ func TestFundCommunityPool(t *testing.T) { addr := simapp.AddTestAddrs(app, ctx, 2, sdk.ZeroInt()) amount := sdk.NewCoins(sdk.NewInt64Coin("stake", 100)) - require.NoError(t, simapp.FundAccount(app.BankKeeper, ctx, addr[0], amount)) + require.NoError(t, testutil.FundAccount(app.BankKeeper, ctx, addr[0], amount)) initPool := app.DistrKeeper.GetFeePool(ctx) assert.Empty(t, initPool.CommunityPool) diff --git a/x/distribution/proposal_handler_test.go b/x/distribution/proposal_handler_test.go index a9b11b321d..08e9268215 100644 --- a/x/distribution/proposal_handler_test.go +++ b/x/distribution/proposal_handler_test.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/distribution" "github.com/cosmos/cosmos-sdk/x/distribution/types" ) @@ -33,7 +34,7 @@ func TestProposalHandlerPassed(t *testing.T) { // add coins to the module account macc := app.DistrKeeper.GetDistributionAccount(ctx) balances := app.BankKeeper.GetAllBalances(ctx, macc.GetAddress()) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, macc.GetName(), amount)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, macc.GetName(), amount)) app.AccountKeeper.SetModuleAccount(ctx, macc) diff --git a/x/distribution/simulation/operations_test.go b/x/distribution/simulation/operations_test.go index 33b59a53cc..8129c5b8bc 100644 --- a/x/distribution/simulation/operations_test.go +++ b/x/distribution/simulation/operations_test.go @@ -12,6 +12,7 @@ import ( simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/distribution/simulation" "github.com/cosmos/cosmos-sdk/x/distribution/types" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" @@ -143,7 +144,7 @@ func (suite *SimTestSuite) testSimulateMsgWithdrawValidatorCommission(tokenName // set module account coins distrAcc := suite.app.DistrKeeper.GetDistributionAccount(suite.ctx) - suite.Require().NoError(simapp.FundModuleAccount(suite.app.BankKeeper, suite.ctx, distrAcc.GetName(), sdk.NewCoins( + suite.Require().NoError(testutil.FundModuleAccount(suite.app.BankKeeper, suite.ctx, distrAcc.GetName(), sdk.NewCoins( sdk.NewCoin(tokenName, sdk.NewInt(10)), sdk.NewCoin("stake", sdk.NewInt(5)), ))) @@ -229,7 +230,7 @@ func (suite *SimTestSuite) getTestingAccounts(r *rand.Rand, n int) []simtypes.Ac for _, account := range accounts { acc := suite.app.AccountKeeper.NewAccountWithAddress(suite.ctx, account.Address) suite.app.AccountKeeper.SetAccount(suite.ctx, acc) - suite.Require().NoError(simapp.FundAccount(suite.app.BankKeeper, suite.ctx, account.Address, initCoins)) + suite.Require().NoError(testutil.FundAccount(suite.app.BankKeeper, suite.ctx, account.Address, initCoins)) } return accounts diff --git a/x/feegrant/simulation/operations_test.go b/x/feegrant/simulation/operations_test.go index 4d7671f772..2a7427c6d2 100644 --- a/x/feegrant/simulation/operations_test.go +++ b/x/feegrant/simulation/operations_test.go @@ -6,7 +6,6 @@ import ( "time" "github.com/stretchr/testify/suite" - abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" @@ -14,6 +13,7 @@ import ( simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/feegrant" "github.com/cosmos/cosmos-sdk/x/feegrant/simulation" ) @@ -43,7 +43,7 @@ func (suite *SimTestSuite) getTestingAccounts(r *rand.Rand, n int) []simtypes.Ac // add coins to the accounts for _, account := range accounts { - err := simapp.FundAccount(suite.app.BankKeeper, suite.ctx, account.Address, initCoins) + err := testutil.FundAccount(suite.app.BankKeeper, suite.ctx, account.Address, initCoins) suite.Require().NoError(err) } diff --git a/x/genutil/gentx_test.go b/x/genutil/gentx_test.go index 8de5bc4afe..ac9ef6de3f 100644 --- a/x/genutil/gentx_test.go +++ b/x/genutil/gentx_test.go @@ -13,6 +13,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp/helpers" simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/genutil" "github.com/cosmos/cosmos-sdk/x/genutil/types" @@ -64,7 +65,7 @@ func (suite *GenTxTestSuite) setAccountBalance(addr sdk.AccAddress, amount int64 acc := suite.app.AccountKeeper.NewAccountWithAddress(suite.ctx, addr) suite.app.AccountKeeper.SetAccount(suite.ctx, acc) - err := simapp.FundAccount(suite.app.BankKeeper, suite.ctx, addr, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 25)}) + err := testutil.FundAccount(suite.app.BankKeeper, suite.ctx, addr, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 25)}) suite.Require().NoError(err) bankGenesisState := suite.app.BankKeeper.ExportGenesis(suite.ctx) diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index 6a5252dc37..83f612a835 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -14,6 +14,7 @@ import ( simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/gov/simulation" "github.com/cosmos/cosmos-sdk/x/gov/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" @@ -271,7 +272,7 @@ func getTestingAccounts(t *testing.T, r *rand.Rand, app *simapp.SimApp, ctx sdk. for _, account := range accounts { acc := app.AccountKeeper.NewAccountWithAddress(ctx, account.Address) app.AccountKeeper.SetAccount(ctx, acc) - require.NoError(t, simapp.FundAccount(app.BankKeeper, ctx, account.Address, initCoins)) + require.NoError(t, testutil.FundAccount(app.BankKeeper, ctx, account.Address, initCoins)) } return accounts diff --git a/x/slashing/simulation/operations_test.go b/x/slashing/simulation/operations_test.go index ea58a6e67c..8b25711bda 100644 --- a/x/slashing/simulation/operations_test.go +++ b/x/slashing/simulation/operations_test.go @@ -13,6 +13,7 @@ import ( simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/slashing/simulation" @@ -123,7 +124,7 @@ func getTestingAccounts(t *testing.T, r *rand.Rand, app *simapp.SimApp, ctx sdk. for _, account := range accounts { acc := app.AccountKeeper.NewAccountWithAddress(ctx, account.Address) app.AccountKeeper.SetAccount(ctx, acc) - require.NoError(t, simapp.FundAccount(app.BankKeeper, ctx, account.Address, initCoins)) + require.NoError(t, testutil.FundAccount(app.BankKeeper, ctx, account.Address, initCoins)) } return accounts diff --git a/x/staking/genesis_test.go b/x/staking/genesis_test.go index 0c686e2d99..93fea369e9 100644 --- a/x/staking/genesis_test.go +++ b/x/staking/genesis_test.go @@ -14,6 +14,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -64,7 +65,7 @@ func TestInitGenesis(t *testing.T) { log.Printf("%#v", len(validators)) // mint coins in the bonded pool representing the validators coins require.NoError(t, - simapp.FundModuleAccount( + testutil.FundModuleAccount( app.BankKeeper, ctx, types.BondedPoolName, @@ -182,7 +183,7 @@ func TestInitGenesisLargeValidatorSet(t *testing.T) { // mint coins in the bonded pool representing the validators coins require.NoError(t, - simapp.FundModuleAccount( + testutil.FundModuleAccount( app.BankKeeper, ctx, types.BondedPoolName, diff --git a/x/staking/handler_test.go b/x/staking/handler_test.go index 12dea7d726..240ddfee6a 100644 --- a/x/staking/handler_test.go +++ b/x/staking/handler_test.go @@ -5,14 +5,13 @@ import ( "testing" "time" + "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmtypes "github.com/tendermint/tendermint/types" - "github.com/golang/protobuf/proto" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" @@ -20,6 +19,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" @@ -38,7 +38,7 @@ func bootstrapHandlerGenesisTest(t *testing.T, power int64, numAddrs int, accAmo // set non bonded pool balance app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), totalSupply)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), totalSupply)) return app, ctx, addrDels, addrVals } diff --git a/x/staking/keeper/delegation_test.go b/x/staking/keeper/delegation_test.go index cac61af1fb..9a6699eb8b 100644 --- a/x/staking/keeper/delegation_test.go +++ b/x/staking/keeper/delegation_test.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -186,7 +187,7 @@ func TestUnbondDelegation(t *testing.T) { startTokens := app.StakingKeeper.TokensFromConsensusPower(ctx, 10) notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), startTokens)))) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), startTokens)))) app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) // create a validator and a delegator to that validator @@ -227,7 +228,7 @@ func TestUnbondingDelegationsMaxEntries(t *testing.T) { bondDenom := app.StakingKeeper.BondDenom(ctx) notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(bondDenom, startTokens)))) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(bondDenom, startTokens)))) app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) // create a validator and a delegator to that validator @@ -315,7 +316,7 @@ func TestUndelegateSelfDelegationBelowMinSelfDelegation(t *testing.T) { // add bonded tokens to pool for delegations notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), delCoins)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), delCoins)) app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) @@ -327,7 +328,7 @@ func TestUndelegateSelfDelegationBelowMinSelfDelegation(t *testing.T) { // add bonded tokens to pool for delegations bondedPool := app.StakingKeeper.GetBondedPool(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), delCoins)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), delCoins)) app.AccountKeeper.SetModuleAccount(ctx, bondedPool) // create a second delegation to this validator @@ -337,7 +338,7 @@ func TestUndelegateSelfDelegationBelowMinSelfDelegation(t *testing.T) { require.Equal(t, delTokens, issuedShares.RoundInt()) // add bonded tokens to pool for delegations - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), delCoins)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), delCoins)) app.AccountKeeper.SetModuleAccount(ctx, bondedPool) validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) @@ -375,7 +376,7 @@ func TestUndelegateFromUnbondingValidator(t *testing.T) { // add bonded tokens to pool for delegations notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), delCoins)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), delCoins)) app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) @@ -386,7 +387,7 @@ func TestUndelegateFromUnbondingValidator(t *testing.T) { // add bonded tokens to pool for delegations bondedPool := app.StakingKeeper.GetBondedPool(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), delCoins)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), delCoins)) app.AccountKeeper.SetModuleAccount(ctx, bondedPool) // create a second delegation to this validator @@ -395,14 +396,14 @@ func TestUndelegateFromUnbondingValidator(t *testing.T) { validator, issuedShares = validator.AddTokensFromDel(delTokens) require.Equal(t, delTokens, issuedShares.RoundInt()) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), delCoins)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), delCoins)) app.AccountKeeper.SetModuleAccount(ctx, bondedPool) validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) delegation := types.NewDelegation(addrDels[1], addrVals[0], issuedShares) app.StakingKeeper.SetDelegation(ctx, delegation) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), delCoins)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), delCoins)) app.AccountKeeper.SetModuleAccount(ctx, bondedPool) header := ctx.BlockHeader() @@ -454,7 +455,7 @@ func TestUndelegateFromUnbondedValidator(t *testing.T) { // add bonded tokens to pool for delegations notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), delCoins)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), delCoins)) app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) // create a validator with a self-delegation @@ -473,7 +474,7 @@ func TestUndelegateFromUnbondedValidator(t *testing.T) { // add bonded tokens to pool for delegations bondedPool := app.StakingKeeper.GetBondedPool(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), delCoins)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), delCoins)) app.AccountKeeper.SetModuleAccount(ctx, bondedPool) // create a second delegation to this validator @@ -535,7 +536,7 @@ func TestUnbondingAllDelegationFromValidator(t *testing.T) { // add bonded tokens to pool for delegations notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), delCoins)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), delCoins)) app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) //create a validator with a self-delegation @@ -560,7 +561,7 @@ func TestUnbondingAllDelegationFromValidator(t *testing.T) { // add bonded tokens to pool for delegations bondedPool := app.StakingKeeper.GetBondedPool(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), delCoins)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), delCoins)) app.AccountKeeper.SetModuleAccount(ctx, bondedPool) validator = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validator, true) @@ -699,7 +700,7 @@ func TestRedelegateToSameValidator(t *testing.T) { // add bonded tokens to pool for delegations notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), startCoins)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), startCoins)) app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) // create a validator with a self-delegation @@ -728,7 +729,7 @@ func TestRedelegationMaxEntries(t *testing.T) { // add bonded tokens to pool for delegations notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), startCoins)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), startCoins)) app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) // create a validator with a self-delegation @@ -784,7 +785,7 @@ func TestRedelegateSelfDelegation(t *testing.T) { // add bonded tokens to pool for delegations notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), startCoins)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), startCoins)) app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) //create a validator with a self-delegation @@ -840,7 +841,7 @@ func TestRedelegateFromUnbondingValidator(t *testing.T) { // add bonded tokens to pool for delegations notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), startCoins)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), startCoins)) app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) //create a validator with a self-delegation @@ -922,7 +923,7 @@ func TestRedelegateFromUnbondedValidator(t *testing.T) { // add bonded tokens to pool for delegations notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), startCoins)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), startCoins)) app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) //create a validator with a self-delegation diff --git a/x/staking/keeper/slash_test.go b/x/staking/keeper/slash_test.go index 64bdb0177d..81e5c8afb0 100644 --- a/x/staking/keeper/slash_test.go +++ b/x/staking/keeper/slash_test.go @@ -10,6 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -25,7 +26,7 @@ func bootstrapSlashTest(t *testing.T, power int64) (*simapp.SimApp, sdk.Context, totalSupply := sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), amt.MulRaw(int64(len(addrDels))))) notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), totalSupply)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), totalSupply)) app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) @@ -35,7 +36,7 @@ func bootstrapSlashTest(t *testing.T, power int64) (*simapp.SimApp, sdk.Context, // set bonded pool balance app.AccountKeeper.SetModuleAccount(ctx, bondedPool) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), bondedCoins)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), bondedCoins)) for i := int64(0); i < numVals; i++ { validator := teststaking.NewValidator(t, addrVals[i], PKs[i]) @@ -125,7 +126,7 @@ func TestSlashRedelegation(t *testing.T) { bondedPool := app.StakingKeeper.GetBondedPool(ctx) balances := app.BankKeeper.GetAllBalances(ctx, bondedPool.GetAddress()) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), startCoins)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), startCoins)) app.AccountKeeper.SetModuleAccount(ctx, bondedPool) // set a redelegation with an expiration timestamp beyond which the @@ -402,7 +403,7 @@ func TestSlashWithRedelegation(t *testing.T) { notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) rdCoins := sdk.NewCoins(sdk.NewCoin(bondDenom, rdTokens.MulRaw(2))) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), rdCoins)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), rdCoins)) app.AccountKeeper.SetModuleAccount(ctx, bondedPool) @@ -565,8 +566,8 @@ func TestSlashBoth(t *testing.T) { bondedPool := app.StakingKeeper.GetBondedPool(ctx) notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), bondedCoins)) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), notBondedCoins)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), bondedCoins)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), notBondedCoins)) app.AccountKeeper.SetModuleAccount(ctx, bondedPool) app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) diff --git a/x/staking/keeper/validator_test.go b/x/staking/keeper/validator_test.go index 31da70eab6..3017ffb92f 100644 --- a/x/staking/keeper/validator_test.go +++ b/x/staking/keeper/validator_test.go @@ -13,6 +13,7 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/teststaking" "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -36,7 +37,7 @@ func bootstrapValidatorTest(t testing.TB, power int64, numAddrs int) (*simapp.Si // set bonded pool supply app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), totalSupply)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), totalSupply)) return app, ctx, addrDels, addrVals } @@ -113,8 +114,8 @@ func TestUpdateValidatorByPowerIndex(t *testing.T) { bondedPool := app.StakingKeeper.GetBondedPool(ctx) notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), app.StakingKeeper.TokensFromConsensusPower(ctx, 1234))))) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), app.StakingKeeper.TokensFromConsensusPower(ctx, 10000))))) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), app.StakingKeeper.TokensFromConsensusPower(ctx, 1234))))) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), app.StakingKeeper.TokensFromConsensusPower(ctx, 10000))))) app.AccountKeeper.SetModuleAccount(ctx, bondedPool) app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) @@ -162,8 +163,8 @@ func TestUpdateBondedValidatorsDecreaseCliff(t *testing.T) { app.StakingKeeper.SetParams(ctx, params) // create a random pool - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), app.StakingKeeper.TokensFromConsensusPower(ctx, 1234))))) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), app.StakingKeeper.TokensFromConsensusPower(ctx, 10000))))) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), app.StakingKeeper.TokensFromConsensusPower(ctx, 1234))))) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), app.StakingKeeper.TokensFromConsensusPower(ctx, 10000))))) app.AccountKeeper.SetModuleAccount(ctx, bondedPool) app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) @@ -217,7 +218,7 @@ func TestSlashToZeroPowerRemoved(t *testing.T) { bondedPool := app.StakingKeeper.GetBondedPool(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), valTokens)))) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), valTokens)))) app.AccountKeeper.SetModuleAccount(ctx, bondedPool) @@ -422,8 +423,8 @@ func TestGetValidatorSortingMixed(t *testing.T) { bondedPool := app.StakingKeeper.GetBondedPool(ctx) notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), app.StakingKeeper.TokensFromConsensusPower(ctx, 501))))) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), app.StakingKeeper.TokensFromConsensusPower(ctx, 0))))) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), app.StakingKeeper.TokensFromConsensusPower(ctx, 501))))) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), app.StakingKeeper.TokensFromConsensusPower(ctx, 0))))) app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) app.AccountKeeper.SetModuleAccount(ctx, bondedPool) @@ -497,7 +498,7 @@ func TestGetValidatorsEdgeCases(t *testing.T) { validators[i], _ = validators[i].AddTokensFromDel(tokens) notBondedPool := app.StakingKeeper.GetNotBondedPool(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(params.BondDenom, tokens)))) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(params.BondDenom, tokens)))) app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) validators[i] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[i], true) } @@ -516,7 +517,7 @@ func TestGetValidatorsEdgeCases(t *testing.T) { newTokens := sdk.NewCoins() - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), newTokens)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), newTokens)) app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) // test that the two largest validators are @@ -548,7 +549,7 @@ func TestGetValidatorsEdgeCases(t *testing.T) { notBondedPool = app.StakingKeeper.GetNotBondedPool(ctx) newTokens = sdk.NewCoins(sdk.NewCoin(params.BondDenom, app.StakingKeeper.TokensFromConsensusPower(ctx, 1))) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), newTokens)) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), newTokens)) app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) validators[3] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[3], true) @@ -563,7 +564,7 @@ func TestGetValidatorsEdgeCases(t *testing.T) { validators[3], _ = validators[3].RemoveDelShares(sdk.NewDec(201)) bondedPool := app.StakingKeeper.GetBondedPool(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(params.BondDenom, rmTokens)))) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, bondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(params.BondDenom, rmTokens)))) app.AccountKeeper.SetModuleAccount(ctx, bondedPool) validators[3] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[3], true) @@ -577,7 +578,7 @@ func TestGetValidatorsEdgeCases(t *testing.T) { validators[3], _ = validators[3].AddTokensFromDel(sdk.NewInt(200)) notBondedPool = app.StakingKeeper.GetNotBondedPool(ctx) - require.NoError(t, simapp.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(params.BondDenom, sdk.NewInt(200))))) + require.NoError(t, testutil.FundModuleAccount(app.BankKeeper, ctx, notBondedPool.GetName(), sdk.NewCoins(sdk.NewCoin(params.BondDenom, sdk.NewInt(200))))) app.AccountKeeper.SetModuleAccount(ctx, notBondedPool) validators[3] = keeper.TestingUpdateValidator(app.StakingKeeper, ctx, validators[3], true) diff --git a/x/staking/simulation/operations_test.go b/x/staking/simulation/operations_test.go index da15fdd5e4..bfa27d8028 100644 --- a/x/staking/simulation/operations_test.go +++ b/x/staking/simulation/operations_test.go @@ -13,6 +13,7 @@ import ( simappparams "github.com/cosmos/cosmos-sdk/simapp/params" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/bank/testutil" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/staking/simulation" @@ -283,7 +284,7 @@ func getTestingAccounts(t *testing.T, r *rand.Rand, app *simapp.SimApp, ctx sdk. for _, account := range accounts { acc := app.AccountKeeper.NewAccountWithAddress(ctx, account.Address) app.AccountKeeper.SetAccount(ctx, acc) - require.NoError(t, simapp.FundAccount(app.BankKeeper, ctx, account.Address, initCoins)) + require.NoError(t, testutil.FundAccount(app.BankKeeper, ctx, account.Address, initCoins)) } return accounts From aef416f91e346f143684aecec6a9c89c59ecb91b Mon Sep 17 00:00:00 2001 From: Cory Date: Tue, 29 Jun 2021 12:41:55 +0200 Subject: [PATCH 42/50] feat: simd runs in-process testnet by default (#9246) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description ref: #9183 After some more recent conversations w/ @aaronc, I decided to go back to his original proposal of setting up a subcommand for running in-process testnets. This PR splits the `simd testnet` command into two subcommands: - `simd testnet start` which starts an in-process n-node testnet - `simd testnet init-files` which sets up configuration & genesis files for an n-node testnet to be run as separate processes (one per node, most likely via Docker Compose) --- Before we can merge this PR, please make sure that all the following items have been checked off. If any of the checklist items are not applicable, please leave them but write a little note why. - [x] Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. - [x] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules/structure.md). - **n/a** - [ ] Wrote unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [x] Updated relevant documentation (`docs/`) or specification (`x//spec/`) - **see #9411** - [x] Added relevant `godoc` [comments](https://blog.golang.org/godoc-documenting-go-code). - [x] Added a relevant changelog entry to the `Unreleased` section in `CHANGELOG.md` - [x] Re-reviewed `Files changed` in the Github PR explorer - [ ] Review `Codecov Report` in the comment section below once CI passes --- .gitignore | 2 +- CHANGELOG.md | 5 + Makefile | 6 +- client/context_test.go | 3 +- client/grpc/tmservice/service_test.go | 7 +- client/grpc_query_test.go | 7 +- client/rpc/rpc_test.go | 5 +- server/grpc/grpc_web_test.go | 8 +- server/grpc/server_test.go | 8 +- simapp/simd/cmd/root.go | 2 +- simapp/simd/cmd/testnet.go | 239 ++++++++++++---- simapp/simd/cmd/testnet_test.go | 2 +- testutil/network/network.go | 256 ++++++++++++++---- testutil/network/network_test.go | 7 +- x/auth/client/rest/rest_test.go | 8 +- x/auth/client/testutil/suite.go | 6 +- x/auth/tx/service_test.go | 9 +- x/auth/types/account_retriever_test.go | 5 +- x/auth/vesting/client/testutil/suite.go | 6 +- x/authz/client/rest/grpc_query_test.go | 6 +- x/authz/client/testutil/tx.go | 4 +- x/bank/client/rest/query_test.go | 5 +- x/bank/client/testutil/suite.go | 3 +- x/crisis/client/testsuite/suite.go | 7 +- x/distribution/client/rest/grpc_query_test.go | 8 +- x/distribution/client/testutil/suite.go | 3 +- x/evidence/client/testutil/suite.go | 6 +- x/feegrant/client/testutil/suite.go | 6 +- x/genutil/client/testutil/suite.go | 6 +- x/gov/client/rest/grpc_query_test.go | 6 +- x/gov/client/testutil/deposits.go | 6 +- x/gov/client/testutil/suite.go | 6 +- x/mint/client/rest/grpc_query_test.go | 3 +- x/mint/client/testutil/suite.go | 3 +- x/params/client/rest/grpc_query_test.go | 8 +- x/params/client/testutil/suite.go | 6 +- x/slashing/client/rest/grpc_query_test.go | 8 +- x/slashing/client/testutil/suite.go | 6 +- x/staking/client/rest/grpc_query_test.go | 8 +- x/staking/client/testutil/suite.go | 6 +- x/upgrade/client/testutil/suite.go | 5 +- 41 files changed, 526 insertions(+), 190 deletions(-) diff --git a/.gitignore b/.gitignore index 2bf1816598..83d56ddf8e 100644 --- a/.gitignore +++ b/.gitignore @@ -26,7 +26,7 @@ artifacts # Data - ideally these don't exist baseapp/data/* client/lcd/keys/* -mytestnet +.testnets # Testing coverage.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 72a86acc41..5c13f59bec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,11 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [\#9427](https://github.com/cosmos/cosmos-sdk/pull/9427) Move simapp `FundAccount` and `FundModuleAccount` to `x/bank/testutil` * (client/tx) [\#9421](https://github.com/cosmos/cosmos-sdk/pull/9421/) `BuildUnsignedTx`, `BuildSimTx`, `PrintUnsignedStdTx` functions are moved to the Tx Factory as methods. +* [\#9246](https://github.com/cosmos/cosmos-sdk/pull/9246) The `New` method for the network package now returns an error. + +### CLI Breaking Changes + +* [\#9246](https://github.com/cosmos/cosmos-sdk/pull/9246) Removed the CLI flag `--setup-config-only` from the `testnet` command and added the subcommand `init-files`. ### Improvements * (cli) [\#9593](https://github.com/cosmos/cosmos-sdk/pull/9593) Check if chain-id is blank before verifying signatures in multisign and error. diff --git a/Makefile b/Makefile index 12fbae141a..9d4d589bec 100644 --- a/Makefile +++ b/Makefile @@ -475,16 +475,16 @@ proto-update-deps: ### Localnet ### ############################################################################### -# Run a 4-node testnet locally +# Run a 4-node testnet locally via docker compose localnet-start: build-linux localnet-stop $(if $(shell $(DOCKER) inspect -f '{{ .Id }}' cosmossdk/simd-env 2>/dev/null),$(info found image cosmossdk/simd-env),$(MAKE) -C contrib/images simd-env) - if ! [ -f build/node0/simd/config/genesis.json ]; then $(DOCKER) run --rm \ + if ! test -f build/node0/simd/config/genesis.json; then $(DOCKER) run --rm \ --user $(shell id -u):$(shell id -g) \ -v $(BUILDDIR):/simd:Z \ -v /etc/group:/etc/group:ro \ -v /etc/passwd:/etc/passwd:ro \ -v /etc/shadow:/etc/shadow:ro \ - cosmossdk/simd-env testnet --v 4 -o . --starting-ip-address 192.168.10.2 --keyring-backend=test ; fi + cosmossdk/simd-env testnet init-files --v 4 -o . --starting-ip-address 192.168.10.2 --keyring-backend=test ; fi docker-compose up -d localnet-stop: diff --git a/client/context_test.go b/client/context_test.go index 9c2e8d4ab1..d500bc9778 100644 --- a/client/context_test.go +++ b/client/context_test.go @@ -105,7 +105,8 @@ func TestCLIQueryConn(t *testing.T) { cfg := network.DefaultConfig() cfg.NumValidators = 1 - n := network.New(t, cfg) + n, err := network.New(t, t.TempDir(), cfg) + require.NoError(t, err) defer n.Cleanup() testClient := testdata.NewQueryClient(n.Validators[0].ClientCtx) diff --git a/client/grpc/tmservice/service_test.go b/client/grpc/tmservice/service_test.go index 3de92411c9..abdc6145ad 100644 --- a/client/grpc/tmservice/service_test.go +++ b/client/grpc/tmservice/service_test.go @@ -32,11 +32,12 @@ func (s *IntegrationTestSuite) SetupSuite() { cfg.NumValidators = 1 s.cfg = cfg - s.network = network.New(s.T(), cfg) - s.Require().NotNil(s.network) + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) + s.Require().NoError(err) - _, err := s.network.WaitForHeight(1) + _, err = s.network.WaitForHeight(1) s.Require().NoError(err) s.queryClient = tmservice.NewServiceClient(s.network.Validators[0].ClientCtx) diff --git a/client/grpc_query_test.go b/client/grpc_query_test.go index c4d2f024a0..b63937ac23 100644 --- a/client/grpc_query_test.go +++ b/client/grpc_query_test.go @@ -27,10 +27,11 @@ type IntegrationTestSuite struct { func (s *IntegrationTestSuite) SetupSuite() { s.T().Log("setting up integration test suite") - s.network = network.New(s.T(), network.DefaultConfig()) - s.Require().NotNil(s.network) + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), network.DefaultConfig()) + s.Require().NoError(err) - _, err := s.network.WaitForHeight(2) + _, err = s.network.WaitForHeight(2) s.Require().NoError(err) } diff --git a/client/rpc/rpc_test.go b/client/rpc/rpc_test.go index adb7dac82d..c2c18a0d1c 100644 --- a/client/rpc/rpc_test.go +++ b/client/rpc/rpc_test.go @@ -23,8 +23,9 @@ type IntegrationTestSuite struct { func (s *IntegrationTestSuite) SetupSuite() { s.T().Log("setting up integration test suite") - s.network = network.New(s.T(), network.DefaultConfig()) - s.Require().NotNil(s.network) + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), network.DefaultConfig()) + s.Require().NoError(err) s.Require().NoError(s.network.WaitForNextBlock()) } diff --git a/server/grpc/grpc_web_test.go b/server/grpc/grpc_web_test.go index fa657ae941..8fcdd216be 100644 --- a/server/grpc/grpc_web_test.go +++ b/server/grpc/grpc_web_test.go @@ -45,10 +45,12 @@ func (s *GRPCWebTestSuite) SetupSuite() { cfg := network.DefaultConfig() cfg.NumValidators = 1 s.cfg = cfg - s.network = network.New(s.T(), s.cfg) - s.Require().NotNil(s.network) - _, err := s.network.WaitForHeight(2) + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) + s.Require().NoError(err) + + _, err = s.network.WaitForHeight(2) s.Require().NoError(err) s.protoCdc = codec.NewProtoCodec(s.cfg.InterfaceRegistry) diff --git a/server/grpc/server_test.go b/server/grpc/server_test.go index 7f3c7a742c..9867f9d088 100644 --- a/server/grpc/server_test.go +++ b/server/grpc/server_test.go @@ -48,10 +48,12 @@ func (s *IntegrationTestSuite) SetupSuite() { s.app = simapp.Setup(false) s.cfg = network.DefaultConfig() s.cfg.NumValidators = 1 - s.network = network.New(s.T(), s.cfg) - s.Require().NotNil(s.network) - _, err := s.network.WaitForHeight(2) + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) + s.Require().NoError(err) + + _, err = s.network.WaitForHeight(2) s.Require().NoError(err) val0 := s.network.Validators[0] diff --git a/simapp/simd/cmd/root.go b/simapp/simd/cmd/root.go index b33a660c87..62215c865b 100644 --- a/simapp/simd/cmd/root.go +++ b/simapp/simd/cmd/root.go @@ -146,7 +146,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { genutilcli.ValidateGenesisCmd(simapp.ModuleBasics), AddGenesisAccountCmd(simapp.DefaultNodeHome), tmcli.NewCompletionCmd(rootCmd, true), - testnetCmd(simapp.ModuleBasics, banktypes.GenesisBalancesIterator{}), + NewTestnetCmd(simapp.ModuleBasics, banktypes.GenesisBalancesIterator{}), debug.Cmd(), config.Cmd(), ) diff --git a/simapp/simd/cmd/testnet.go b/simapp/simd/cmd/testnet.go index 071d9364d0..d5c60f0522 100644 --- a/simapp/simd/cmd/testnet.go +++ b/simapp/simd/cmd/testnet.go @@ -25,6 +25,7 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/server" srvconfig "github.com/cosmos/cosmos-sdk/server/config" + "github.com/cosmos/cosmos-sdk/testutil/network" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -40,20 +41,78 @@ var ( flagOutputDir = "output-dir" flagNodeDaemonHome = "node-daemon-home" flagStartingIPAddress = "starting-ip-address" + flagEnableLogging = "enable-logging" + flagGRPCAddress = "grpc.address" + flagRPCAddress = "rpc.address" + flagAPIAddress = "api.address" + flagPrintMnemonic = "print-mnemonic" ) +type initArgs struct { + algo string + chainID string + keyringBackend string + minGasPrices string + nodeDaemonHome string + nodeDirPrefix string + numValidators int + outputDir string + startingIPAddress string +} + +type startArgs struct { + algo string + apiAddress string + chainID string + enableLogging bool + grpcAddress string + minGasPrices string + numValidators int + outputDir string + printMnemonic bool + rpcAddress string +} + +func addTestnetFlagsToCmd(cmd *cobra.Command) { + cmd.Flags().Int(flagNumValidators, 4, "Number of validators to initialize the testnet with") + cmd.Flags().StringP(flagOutputDir, "o", "./.testnets", "Directory to store initialization data for the testnet") + cmd.Flags().String(flags.FlagChainID, "", "genesis file chain-id, if left blank will be randomly created") + cmd.Flags().String(server.FlagMinGasPrices, fmt.Sprintf("0.000006%s", sdk.DefaultBondDenom), "Minimum gas prices to accept for transactions; All fees in a tx must meet this minimum (e.g. 0.01photino,0.001stake)") + cmd.Flags().String(flags.FlagKeyAlgorithm, string(hd.Secp256k1Type), "Key signing algorithm to generate keys for") +} + +// NewTestnetCmd creates a root testnet command with subcommands to run an in-process testnet or initialize +// validator configuration files for running a multi-validator testnet in a separate process +func NewTestnetCmd(mbm module.BasicManager, genBalIterator banktypes.GenesisBalancesIterator) *cobra.Command { + testnetCmd := &cobra.Command{ + Use: "testnet", + Short: "subcommands for starting or configuring local testnets", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + testnetCmd.AddCommand(testnetStartCmd()) + testnetCmd.AddCommand(testnetInitFilesCmd(mbm, genBalIterator)) + + return testnetCmd +} + // get cmd to initialize all files for tendermint testnet and application -func testnetCmd(mbm module.BasicManager, genBalIterator banktypes.GenesisBalancesIterator) *cobra.Command { +func testnetInitFilesCmd(mbm module.BasicManager, genBalIterator banktypes.GenesisBalancesIterator) *cobra.Command { cmd := &cobra.Command{ - Use: "testnet", - Short: "Initialize files for a simapp testnet", - Long: `testnet will create "v" number of directories and populate each with -necessary files (private validator, genesis, config, etc.). + Use: "init-files", + Short: "Initialize config directories & files for a multi-validator testnet running locally via separate processes (e.g. Docker Compose or similar)", + Long: `init-files will setup "v" number of directories and populate each with +necessary files (private validator, genesis, config, etc.) for running "v" validator nodes. + +Booting up a network with these validator folders is intended to be used with Docker Compose, +or a similar setup where each node has a manually configurable IP address. Note, strict routability for addresses is turned off in the config file. Example: - simd testnet --v 4 --output-dir ./output --starting-ip-address 192.168.10.2 + simd testnet init-files --v 4 --output-dir ./.testnets --starting-ip-address 192.168.10.2 `, RunE: func(cmd *cobra.Command, _ []string) error { clientCtx, err := client.GetClientQueryContext(cmd) @@ -64,70 +123,97 @@ Example: serverCtx := server.GetServerContextFromCmd(cmd) config := serverCtx.Config - outputDir, _ := cmd.Flags().GetString(flagOutputDir) - keyringBackend, _ := cmd.Flags().GetString(flags.FlagKeyringBackend) - chainID, _ := cmd.Flags().GetString(flags.FlagChainID) - minGasPrices, _ := cmd.Flags().GetString(server.FlagMinGasPrices) - nodeDirPrefix, _ := cmd.Flags().GetString(flagNodeDirPrefix) - nodeDaemonHome, _ := cmd.Flags().GetString(flagNodeDaemonHome) - startingIPAddress, _ := cmd.Flags().GetString(flagStartingIPAddress) - numValidators, _ := cmd.Flags().GetInt(flagNumValidators) - algo, _ := cmd.Flags().GetString(flags.FlagKeyAlgorithm) + args := initArgs{} + args.outputDir, _ = cmd.Flags().GetString(flagOutputDir) + args.keyringBackend, _ = cmd.Flags().GetString(flags.FlagKeyringBackend) + args.chainID, _ = cmd.Flags().GetString(flags.FlagChainID) + args.minGasPrices, _ = cmd.Flags().GetString(server.FlagMinGasPrices) + args.nodeDirPrefix, _ = cmd.Flags().GetString(flagNodeDirPrefix) + args.nodeDaemonHome, _ = cmd.Flags().GetString(flagNodeDaemonHome) + args.startingIPAddress, _ = cmd.Flags().GetString(flagStartingIPAddress) + args.numValidators, _ = cmd.Flags().GetInt(flagNumValidators) + args.algo, _ = cmd.Flags().GetString(flags.FlagKeyAlgorithm) + + return initTestnetFiles(clientCtx, cmd, config, mbm, genBalIterator, args) - return InitTestnet( - clientCtx, cmd, config, mbm, genBalIterator, outputDir, chainID, minGasPrices, - nodeDirPrefix, nodeDaemonHome, startingIPAddress, keyringBackend, algo, numValidators, - ) }, } - cmd.Flags().Int(flagNumValidators, 4, "Number of validators to initialize the testnet with") - cmd.Flags().StringP(flagOutputDir, "o", "./mytestnet", "Directory to store initialization data for the testnet") + addTestnetFlagsToCmd(cmd) cmd.Flags().String(flagNodeDirPrefix, "node", "Prefix the directory name for each node with (node results in node0, node1, ...)") cmd.Flags().String(flagNodeDaemonHome, "simd", "Home directory of the node's daemon configuration") cmd.Flags().String(flagStartingIPAddress, "192.168.0.1", "Starting IP address (192.168.0.1 results in persistent peers list ID0@192.168.0.1:46656, ID1@192.168.0.2:46656, ...)") - cmd.Flags().String(flags.FlagChainID, "", "genesis file chain-id, if left blank will be randomly created") - cmd.Flags().String(server.FlagMinGasPrices, fmt.Sprintf("0.000006%s", sdk.DefaultBondDenom), "Minimum gas prices to accept for transactions; All fees in a tx must meet this minimum (e.g. 0.01photino,0.001stake)") cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|test)") - cmd.Flags().String(flags.FlagKeyAlgorithm, string(hd.Secp256k1Type), "Key signing algorithm to generate keys for") return cmd } +// get cmd to start multi validator in-process testnet +func testnetStartCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "start", + Short: "Launch an in-process multi-validator testnet", + Long: `testnet will launch an in-process multi-validator testnet, +and generate "v" directories, populated with necessary validator configuration files +(private validator, genesis, config, etc.). + +Example: + simd testnet --v 4 --output-dir ./.testnets + `, + RunE: func(cmd *cobra.Command, _ []string) error { + + args := startArgs{} + args.outputDir, _ = cmd.Flags().GetString(flagOutputDir) + args.chainID, _ = cmd.Flags().GetString(flags.FlagChainID) + args.minGasPrices, _ = cmd.Flags().GetString(server.FlagMinGasPrices) + args.numValidators, _ = cmd.Flags().GetInt(flagNumValidators) + args.algo, _ = cmd.Flags().GetString(flags.FlagKeyAlgorithm) + args.enableLogging, _ = cmd.Flags().GetBool(flagEnableLogging) + args.rpcAddress, _ = cmd.Flags().GetString(flagRPCAddress) + args.apiAddress, _ = cmd.Flags().GetString(flagAPIAddress) + args.grpcAddress, _ = cmd.Flags().GetString(flagGRPCAddress) + args.printMnemonic, _ = cmd.Flags().GetBool(flagPrintMnemonic) + + return startTestnet(cmd, args) + + }, + } + + addTestnetFlagsToCmd(cmd) + cmd.Flags().Bool(flagEnableLogging, false, "Enable INFO logging of tendermint validator nodes") + cmd.Flags().String(flagRPCAddress, "tcp://0.0.0.0:26657", "the RPC address to listen on") + cmd.Flags().String(flagAPIAddress, "tcp://0.0.0.0:1317", "the address to listen on for REST API") + cmd.Flags().String(flagGRPCAddress, "0.0.0.0:9090", "the gRPC server address to listen on") + cmd.Flags().Bool(flagPrintMnemonic, true, "print mnemonic of first validator to stdout for manual testing") + return cmd +} + const nodeDirPerm = 0755 -// Initialize the testnet -func InitTestnet( +// initTestnetFiles initializes testnet files for a testnet to be run in a separate process +func initTestnetFiles( clientCtx client.Context, cmd *cobra.Command, nodeConfig *tmconfig.Config, mbm module.BasicManager, genBalIterator banktypes.GenesisBalancesIterator, - outputDir, - chainID, - minGasPrices, - nodeDirPrefix, - nodeDaemonHome, - startingIPAddress, - keyringBackend, - algoStr string, - numValidators int, + args initArgs, ) error { - if chainID == "" { - chainID = "chain-" + tmrand.NewRand().Str(6) + if args.chainID == "" { + args.chainID = "chain-" + tmrand.NewRand().Str(6) } - nodeIDs := make([]string, numValidators) - valPubKeys := make([]cryptotypes.PubKey, numValidators) + nodeIDs := make([]string, args.numValidators) + valPubKeys := make([]cryptotypes.PubKey, args.numValidators) simappConfig := srvconfig.DefaultConfig() - simappConfig.MinGasPrices = minGasPrices + simappConfig.MinGasPrices = args.minGasPrices simappConfig.API.Enable = true simappConfig.Telemetry.Enabled = true simappConfig.Telemetry.PrometheusRetentionTime = 60 simappConfig.Telemetry.EnableHostnameLabel = false - simappConfig.Telemetry.GlobalLabels = [][]string{{"chain_id", chainID}} + simappConfig.Telemetry.GlobalLabels = [][]string{{"chain_id", args.chainID}} var ( genAccounts []authtypes.GenesisAccount @@ -137,50 +223,50 @@ func InitTestnet( inBuf := bufio.NewReader(cmd.InOrStdin()) // generate private keys, node IDs, and initial transactions - for i := 0; i < numValidators; i++ { - nodeDirName := fmt.Sprintf("%s%d", nodeDirPrefix, i) - nodeDir := filepath.Join(outputDir, nodeDirName, nodeDaemonHome) - gentxsDir := filepath.Join(outputDir, "gentxs") + for i := 0; i < args.numValidators; i++ { + nodeDirName := fmt.Sprintf("%s%d", args.nodeDirPrefix, i) + nodeDir := filepath.Join(args.outputDir, nodeDirName, args.nodeDaemonHome) + gentxsDir := filepath.Join(args.outputDir, "gentxs") nodeConfig.SetRoot(nodeDir) nodeConfig.RPC.ListenAddress = "tcp://0.0.0.0:26657" if err := os.MkdirAll(filepath.Join(nodeDir, "config"), nodeDirPerm); err != nil { - _ = os.RemoveAll(outputDir) + _ = os.RemoveAll(args.outputDir) return err } nodeConfig.Moniker = nodeDirName - ip, err := getIP(i, startingIPAddress) + ip, err := getIP(i, args.startingIPAddress) if err != nil { - _ = os.RemoveAll(outputDir) + _ = os.RemoveAll(args.outputDir) return err } nodeIDs[i], valPubKeys[i], err = genutil.InitializeNodeValidatorFiles(nodeConfig) if err != nil { - _ = os.RemoveAll(outputDir) + _ = os.RemoveAll(args.outputDir) return err } memo := fmt.Sprintf("%s@%s:26656", nodeIDs[i], ip) genFiles = append(genFiles, nodeConfig.GenesisFile()) - kb, err := keyring.New(sdk.KeyringServiceName(), keyringBackend, nodeDir, inBuf) + kb, err := keyring.New(sdk.KeyringServiceName(), args.keyringBackend, nodeDir, inBuf) if err != nil { return err } keyringAlgos, _ := kb.SupportedAlgorithms() - algo, err := keyring.NewSigningAlgoFromString(algoStr, keyringAlgos) + algo, err := keyring.NewSigningAlgoFromString(args.algo, keyringAlgos) if err != nil { return err } addr, secret, err := server.GenerateSaveCoinKey(kb, nodeDirName, true, algo) if err != nil { - _ = os.RemoveAll(outputDir) + _ = os.RemoveAll(args.outputDir) return err } @@ -228,7 +314,7 @@ func InitTestnet( txFactory := tx.Factory{} txFactory = txFactory. - WithChainID(chainID). + WithChainID(args.chainID). WithMemo(memo). WithKeybase(kb). WithTxConfig(clientCtx.TxConfig) @@ -249,19 +335,19 @@ func InitTestnet( srvconfig.WriteConfigFile(filepath.Join(nodeDir, "config/app.toml"), simappConfig) } - if err := initGenFiles(clientCtx, mbm, chainID, genAccounts, genBalances, genFiles, numValidators); err != nil { + if err := initGenFiles(clientCtx, mbm, args.chainID, genAccounts, genBalances, genFiles, args.numValidators); err != nil { return err } err := collectGenFiles( - clientCtx, nodeConfig, chainID, nodeIDs, valPubKeys, numValidators, - outputDir, nodeDirPrefix, nodeDaemonHome, genBalIterator, + clientCtx, nodeConfig, args.chainID, nodeIDs, valPubKeys, args.numValidators, + args.outputDir, args.nodeDirPrefix, args.nodeDaemonHome, genBalIterator, ) if err != nil { return err } - cmd.PrintErrf("Successfully initialized %d node directories\n", numValidators) + cmd.PrintErrf("Successfully initialized %d node directories\n", args.numValidators) return nil } @@ -401,3 +487,42 @@ func writeFile(name string, dir string, contents []byte) error { return nil } + +// startTestnet starts an in-process testnet +func startTestnet(cmd *cobra.Command, args startArgs) error { + networkConfig := network.DefaultConfig() + + // Default networkConfig.ChainID is random, and we should only override it if chainID provided + // is non-empty + if args.chainID != "" { + networkConfig.ChainID = args.chainID + } + networkConfig.SigningAlgo = args.algo + networkConfig.MinGasPrices = args.minGasPrices + networkConfig.NumValidators = args.numValidators + networkConfig.EnableTMLogging = args.enableLogging + networkConfig.RPCAddress = args.rpcAddress + networkConfig.APIAddress = args.apiAddress + networkConfig.GRPCAddress = args.grpcAddress + networkConfig.PrintMnemonic = args.printMnemonic + networkLogger := network.NewCLILogger(cmd) + + baseDir := fmt.Sprintf("%s/%s", args.outputDir, networkConfig.ChainID) + if _, err := os.Stat(baseDir); !os.IsNotExist(err) { + return fmt.Errorf( + "testnests directory already exists for chain-id '%s': %s, please remove or select a new --chain-id", + networkConfig.ChainID, baseDir) + } + + testnet, err := network.New(networkLogger, baseDir, networkConfig) + if err != nil { + return err + } + + testnet.WaitForHeight(1) + cmd.Println("press the Enter Key to terminate") + fmt.Scanln() // wait for Enter Key + testnet.Cleanup() + + return nil +} diff --git a/simapp/simd/cmd/testnet_test.go b/simapp/simd/cmd/testnet_test.go index da58fd454d..fae1323407 100644 --- a/simapp/simd/cmd/testnet_test.go +++ b/simapp/simd/cmd/testnet_test.go @@ -36,7 +36,7 @@ func Test_TestnetCmd(t *testing.T) { ctx := context.Background() ctx = context.WithValue(ctx, server.ServerContextKey, serverCtx) ctx = context.WithValue(ctx, client.ClientContextKey, &clientCtx) - cmd := testnetCmd(simapp.ModuleBasics, banktypes.GenesisBalancesIterator{}) + cmd := testnetInitFilesCmd(simapp.ModuleBasics, banktypes.GenesisBalancesIterator{}) cmd.SetArgs([]string{fmt.Sprintf("--%s=test", flags.FlagKeyringBackend), fmt.Sprintf("--output-dir=%s", home)}) err = cmd.ExecuteContext(ctx) require.NoError(t, err) diff --git a/testutil/network/network.go b/testutil/network/network.go index 2f17bca132..7087e4bd9f 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -6,16 +6,16 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" "net/http" "net/url" "os" "path/filepath" + "strings" "sync" "testing" "time" - "github.com/stretchr/testify/require" + "github.com/spf13/cobra" tmcfg "github.com/tendermint/tendermint/config" tmflags "github.com/tendermint/tendermint/libs/cli/flags" "github.com/tendermint/tendermint/libs/log" @@ -87,10 +87,14 @@ type Config struct { StakingTokens sdk.Int // the amount of tokens each validator has available to stake BondedTokens sdk.Int // the amount of tokens each validator stakes PruningStrategy string // the pruning strategy each validator will have - EnableLogging bool // enable Tendermint logging to STDOUT + EnableTMLogging bool // enable Tendermint logging to STDOUT CleanupDir bool // remove base temporary directory during cleanup SigningAlgo string // signing algorithm for keys - KeyringOptions []keyring.Option + KeyringOptions []keyring.Option // keyring configuration options + RPCAddress string // RPC listen address (including port) + APIAddress string // REST API listen address (including port) + GRPCAddress string // GRPC server listen address (including port) + PrintMnemonic bool // print the mnemonic of first validator as log output for testing } // DefaultConfig returns a sane default configuration suitable for nearly all @@ -118,6 +122,7 @@ func DefaultConfig() Config { CleanupDir: true, SigningAlgo: string(hd.Secp256k1Type), KeyringOptions: []keyring.Option{}, + PrintMnemonic: false, } } @@ -133,7 +138,7 @@ type ( // to create networks. In addition, only the first validator will have a valid // RPC and API server/client. Network struct { - T *testing.T + Logger Logger BaseDir string Validators []*Validator @@ -165,24 +170,46 @@ type ( } ) -// New creates a new Network for integration tests. -func New(t *testing.T, cfg Config) *Network { +// Logger is a network logger interface that exposes testnet-level Log() methods for an in-process testing network +// This is not to be confused with logging that may happen at an individual node or validator level +type Logger interface { + Log(args ...interface{}) + Logf(format string, args ...interface{}) +} + +var _ Logger = (*testing.T)(nil) +var _ Logger = (*CLILogger)(nil) + +type CLILogger struct { + cmd *cobra.Command +} + +func (s CLILogger) Log(args ...interface{}) { + s.cmd.Println(args...) +} + +func (s CLILogger) Logf(format string, args ...interface{}) { + s.cmd.Printf(format, args...) +} + +func NewCLILogger(cmd *cobra.Command) CLILogger { + return CLILogger{cmd} +} + +// New creates a new Network for integration tests or in-process testnets run via the CLI +func New(l Logger, baseDir string, cfg Config) (*Network, error) { // only one caller/test can create and use a network at a time - t.Log("acquiring test network lock") + l.Log("acquiring test network lock") lock.Lock() - baseDir, err := ioutil.TempDir(t.TempDir(), cfg.ChainID) - require.NoError(t, err) - t.Logf("created temporary directory: %s", baseDir) - network := &Network{ - T: t, + Logger: l, BaseDir: baseDir, Validators: make([]*Validator, cfg.NumValidators), Config: cfg, } - t.Log("preparing test network...") + l.Logf("preparing test network with chain-id \"%s\"\n", cfg.ChainID) monikers := make([]string, cfg.NumValidators) nodeIDs := make([]string, cfg.NumValidators) @@ -215,32 +242,56 @@ func New(t *testing.T, cfg Config) *Network { tmCfg.RPC.ListenAddress = "" appCfg.GRPC.Enable = false appCfg.GRPCWeb.Enable = false + apiListenAddr := "" if i == 0 { - apiListenAddr, _, err := server.FreeTCPAddr() - require.NoError(t, err) - appCfg.API.Address = apiListenAddr + if cfg.APIAddress != "" { + apiListenAddr = cfg.APIAddress + } else { + var err error + apiListenAddr, _, err = server.FreeTCPAddr() + if err != nil { + return nil, err + } + } + appCfg.API.Address = apiListenAddr apiURL, err := url.Parse(apiListenAddr) - require.NoError(t, err) + if err != nil { + return nil, err + } apiAddr = fmt.Sprintf("http://%s:%s", apiURL.Hostname(), apiURL.Port()) - rpcAddr, _, err := server.FreeTCPAddr() - require.NoError(t, err) - tmCfg.RPC.ListenAddress = rpcAddr + if cfg.RPCAddress != "" { + tmCfg.RPC.ListenAddress = cfg.RPCAddress + } else { + rpcAddr, _, err := server.FreeTCPAddr() + if err != nil { + return nil, err + } + tmCfg.RPC.ListenAddress = rpcAddr + } - _, grpcPort, err := server.FreeTCPAddr() - require.NoError(t, err) - appCfg.GRPC.Address = fmt.Sprintf("0.0.0.0:%s", grpcPort) + if cfg.GRPCAddress != "" { + appCfg.GRPC.Address = cfg.GRPCAddress + } else { + _, grpcPort, err := server.FreeTCPAddr() + if err != nil { + return nil, err + } + appCfg.GRPC.Address = fmt.Sprintf("0.0.0.0:%s", grpcPort) + } appCfg.GRPC.Enable = true _, grpcWebPort, err := server.FreeTCPAddr() - require.NoError(t, err) + if err != nil { + return nil, err + } appCfg.GRPCWeb.Address = fmt.Sprintf("0.0.0.0:%s", grpcWebPort) appCfg.GRPCWeb.Enable = true } logger := log.NewNopLogger() - if cfg.EnableLogging { + if cfg.EnableTMLogging { logger = log.NewTMLogger(log.NewSyncWriter(os.Stdout)) logger, _ = tmflags.ParseLogLevel("info", logger, tmcfg.DefaultLogLevel) } @@ -252,44 +303,74 @@ func New(t *testing.T, cfg Config) *Network { clientDir := filepath.Join(network.BaseDir, nodeDirName, "simcli") gentxsDir := filepath.Join(network.BaseDir, "gentxs") - require.NoError(t, os.MkdirAll(filepath.Join(nodeDir, "config"), 0755)) - require.NoError(t, os.MkdirAll(clientDir, 0755)) + err := os.MkdirAll(filepath.Join(nodeDir, "config"), 0755) + if err != nil { + return nil, err + } + + err = os.MkdirAll(clientDir, 0755) + if err != nil { + return nil, err + } tmCfg.SetRoot(nodeDir) tmCfg.Moniker = nodeDirName monikers[i] = nodeDirName proxyAddr, _, err := server.FreeTCPAddr() - require.NoError(t, err) + if err != nil { + return nil, err + } tmCfg.ProxyApp = proxyAddr p2pAddr, _, err := server.FreeTCPAddr() - require.NoError(t, err) + if err != nil { + return nil, err + } tmCfg.P2P.ListenAddress = p2pAddr tmCfg.P2P.AddrBookStrict = false tmCfg.P2P.AllowDuplicateIP = true nodeID, pubKey, err := genutil.InitializeNodeValidatorFiles(tmCfg) - require.NoError(t, err) + if err != nil { + return nil, err + } nodeIDs[i] = nodeID valPubKeys[i] = pubKey kb, err := keyring.New(sdk.KeyringServiceName(), keyring.BackendTest, clientDir, buf, cfg.KeyringOptions...) - require.NoError(t, err) + if err != nil { + return nil, err + } keyringAlgos, _ := kb.SupportedAlgorithms() algo, err := keyring.NewSigningAlgoFromString(cfg.SigningAlgo, keyringAlgos) - require.NoError(t, err) + if err != nil { + return nil, err + } addr, secret, err := server.GenerateSaveCoinKey(kb, nodeDirName, true, algo) - require.NoError(t, err) + if err != nil { + return nil, err + } + + // if PrintMnemonic is set to true, we print the first validator node's secret to the network's logger + // for debugging and manual testing + if cfg.PrintMnemonic && i == 0 { + printMnemonic(l, secret) + } info := map[string]string{"secret": secret} infoBz, err := json.Marshal(info) - require.NoError(t, err) + if err != nil { + return nil, err + } // save private key seed words - require.NoError(t, writeFile(fmt.Sprintf("%v.json", "key_seed"), clientDir, infoBz)) + err = writeFile(fmt.Sprintf("%v.json", "key_seed"), clientDir, infoBz) + if err != nil { + return nil, err + } balances := sdk.NewCoins( sdk.NewCoin(fmt.Sprintf("%stoken", nodeDirName), cfg.AccountTokens), @@ -301,7 +382,9 @@ func New(t *testing.T, cfg Config) *Network { genAccounts = append(genAccounts, authtypes.NewBaseAccount(addr, nil, 0, 0)) commission, err := sdk.NewDecFromStr("0.5") - require.NoError(t, err) + if err != nil { + return nil, err + } createValMsg, err := stakingtypes.NewMsgCreateValidator( sdk.ValAddress(addr), @@ -311,15 +394,22 @@ func New(t *testing.T, cfg Config) *Network { stakingtypes.NewCommissionRates(commission, sdk.OneDec(), sdk.OneDec()), sdk.OneInt(), ) - require.NoError(t, err) + if err != nil { + return nil, err + } p2pURL, err := url.Parse(p2pAddr) - require.NoError(t, err) + if err != nil { + return nil, err + } memo := fmt.Sprintf("%s@%s:%s", nodeIDs[i], p2pURL.Hostname(), p2pURL.Port()) fee := sdk.NewCoins(sdk.NewCoin(fmt.Sprintf("%stoken", nodeDirName), sdk.NewInt(0))) txBuilder := cfg.TxConfig.NewTxBuilder() - require.NoError(t, txBuilder.SetMsgs(createValMsg)) + err = txBuilder.SetMsgs(createValMsg) + if err != nil { + return nil, err + } txBuilder.SetFeeAmount(fee) // Arbitrary fee txBuilder.SetGasLimit(1000000) // Need at least 100386 txBuilder.SetMemo(memo) @@ -332,11 +422,18 @@ func New(t *testing.T, cfg Config) *Network { WithTxConfig(cfg.TxConfig) err = tx.Sign(txFactory, nodeDirName, txBuilder, true) - require.NoError(t, err) + if err != nil { + return nil, err + } txBz, err := cfg.TxConfig.TxJSONEncoder()(txBuilder.GetTx()) - require.NoError(t, err) - require.NoError(t, writeFile(fmt.Sprintf("%v.json", nodeDirName), gentxsDir, txBz)) + if err != nil { + return nil, err + } + err = writeFile(fmt.Sprintf("%v.json", nodeDirName), gentxsDir, txBz) + if err != nil { + return nil, err + } srvconfig.WriteConfigFile(filepath.Join(nodeDir, "config/app.toml"), appCfg) @@ -367,21 +464,30 @@ func New(t *testing.T, cfg Config) *Network { } } - require.NoError(t, initGenFiles(cfg, genAccounts, genBalances, genFiles)) - require.NoError(t, collectGenFiles(cfg, network.Validators, network.BaseDir)) - - t.Log("starting test network...") - for _, v := range network.Validators { - require.NoError(t, startInProcess(cfg, v)) + err := initGenFiles(cfg, genAccounts, genBalances, genFiles) + if err != nil { + return nil, err + } + err = collectGenFiles(cfg, network.Validators, network.BaseDir) + if err != nil { + return nil, err } - t.Log("started test network") + l.Log("starting test network...") + for _, v := range network.Validators { + err := startInProcess(cfg, v) + if err != nil { + return nil, err + } + } + + l.Log("started test network") // Ensure we cleanup incase any test was abruptly halted (e.g. SIGINT) as any // defer in a test would not be called. server.TrapSignal(network.Cleanup) - return network + return network, nil } // LatestHeight returns the latest height of the network or an error if the @@ -459,10 +565,10 @@ func (n *Network) WaitForNextBlock() error { func (n *Network) Cleanup() { defer func() { lock.Unlock() - n.T.Log("released test network lock") + n.Logger.Log("released test network lock") }() - n.T.Log("cleaning up test network...") + n.Logger.Log("cleaning up test network...") for _, v := range n.Validators { if v.tmNode != nil && v.tmNode.IsRunning() { @@ -485,5 +591,47 @@ func (n *Network) Cleanup() { _ = os.RemoveAll(n.BaseDir) } - n.T.Log("finished cleaning up test network") + n.Logger.Log("finished cleaning up test network") +} + +// printMnemonic prints a provided mnemonic seed phrase on a network logger +// for debugging and manual testing +func printMnemonic(l Logger, secret string) { + lines := []string{ + "THIS MNEMONIC IS FOR TESTING PURPOSES ONLY", + "DO NOT USE IN PRODUCTION", + "", + strings.Join(strings.Fields(secret)[0:8], " "), + strings.Join(strings.Fields(secret)[8:16], " "), + strings.Join(strings.Fields(secret)[16:24], " "), + } + + lineLengths := make([]int, len(lines)) + for i, line := range lines { + lineLengths[i] = len(line) + } + + maxLineLength := 0 + for _, lineLen := range lineLengths { + if lineLen > maxLineLength { + maxLineLength = lineLen + } + } + + l.Log("\n") + l.Log(strings.Repeat("+", maxLineLength+8)) + for _, line := range lines { + l.Logf("++ %s ++\n", centerText(line, maxLineLength)) + } + l.Log(strings.Repeat("+", maxLineLength+8)) + l.Log("\n") +} + +// centerText centers text across a fixed width, filling either side with whitespace buffers +func centerText(text string, width int) string { + textLen := len(text) + leftBuffer := strings.Repeat(" ", (width-textLen)/2) + rightBuffer := strings.Repeat(" ", (width-textLen)/2+(width-textLen)%2) + + return fmt.Sprintf("%s%s%s", leftBuffer, text, rightBuffer) } diff --git a/testutil/network/network_test.go b/testutil/network/network_test.go index 3e45309f2f..e13c8c454d 100644 --- a/testutil/network/network_test.go +++ b/testutil/network/network_test.go @@ -20,10 +20,11 @@ type IntegrationTestSuite struct { func (s *IntegrationTestSuite) SetupSuite() { s.T().Log("setting up integration test suite") - s.network = network.New(s.T(), network.DefaultConfig()) - s.Require().NotNil(s.network) + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), network.DefaultConfig()) + s.Require().NoError(err) - _, err := s.network.WaitForHeight(1) + _, err = s.network.WaitForHeight(1) s.Require().NoError(err) } diff --git a/x/auth/client/rest/rest_test.go b/x/auth/client/rest/rest_test.go index 4d7ebf9268..a382306e32 100644 --- a/x/auth/client/rest/rest_test.go +++ b/x/auth/client/rest/rest_test.go @@ -48,12 +48,14 @@ func (s *IntegrationTestSuite) SetupSuite() { cfg := network.DefaultConfig() cfg.NumValidators = 2 - s.cfg = cfg - s.network = network.New(s.T(), cfg) + + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), cfg) + s.Require().NoError(err) kb := s.network.Validators[0].ClientCtx.Keyring - _, _, err := kb.NewMnemonic("newAccount", keyring.English, sdk.FullFundraiserPath, keyring.DefaultBIP39Passphrase, hd.Secp256k1) + _, _, err = kb.NewMnemonic("newAccount", keyring.English, sdk.FullFundraiserPath, keyring.DefaultBIP39Passphrase, hd.Secp256k1) s.Require().NoError(err) account1, _, err := kb.NewMnemonic("newAccount1", keyring.English, sdk.FullFundraiserPath, keyring.DefaultBIP39Passphrase, hd.Secp256k1) diff --git a/x/auth/client/testutil/suite.go b/x/auth/client/testutil/suite.go index 773f8dba1a..c285a0841b 100644 --- a/x/auth/client/testutil/suite.go +++ b/x/auth/client/testutil/suite.go @@ -48,10 +48,12 @@ func NewIntegrationTestSuite(cfg network.Config) *IntegrationTestSuite { func (s *IntegrationTestSuite) SetupSuite() { s.T().Log("setting up integration test suite") - s.network = network.New(s.T(), s.cfg) + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) + s.Require().NoError(err) kb := s.network.Validators[0].ClientCtx.Keyring - _, _, err := kb.NewMnemonic("newAccount", keyring.English, sdk.FullFundraiserPath, keyring.DefaultBIP39Passphrase, hd.Secp256k1) + _, _, err = kb.NewMnemonic("newAccount", keyring.English, sdk.FullFundraiserPath, keyring.DefaultBIP39Passphrase, hd.Secp256k1) s.Require().NoError(err) account1, _, err := kb.NewMnemonic("newAccount1", keyring.English, sdk.FullFundraiserPath, keyring.DefaultBIP39Passphrase, hd.Secp256k1) diff --git a/x/auth/tx/service_test.go b/x/auth/tx/service_test.go index 9a4bc1d40d..266c81439f 100644 --- a/x/auth/tx/service_test.go +++ b/x/auth/tx/service_test.go @@ -49,14 +49,15 @@ func (s *IntegrationTestSuite) SetupSuite() { cfg := network.DefaultConfig() cfg.NumValidators = 1 - s.cfg = cfg - s.network = network.New(s.T(), cfg) - s.Require().NotNil(s.network) + + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) + s.Require().NoError(err) val := s.network.Validators[0] - _, err := s.network.WaitForHeight(1) + _, err = s.network.WaitForHeight(1) s.Require().NoError(err) s.queryClient = tx.NewServiceClient(val.ClientCtx) diff --git a/x/auth/types/account_retriever_test.go b/x/auth/types/account_retriever_test.go index 1053ffdcbd..e756a802da 100644 --- a/x/auth/types/account_retriever_test.go +++ b/x/auth/types/account_retriever_test.go @@ -13,10 +13,11 @@ func TestAccountRetriever(t *testing.T) { cfg := network.DefaultConfig() cfg.NumValidators = 1 - network := network.New(t, cfg) + network, err := network.New(t, t.TempDir(), cfg) + require.NoError(t, err) defer network.Cleanup() - _, err := network.WaitForHeight(3) + _, err = network.WaitForHeight(3) require.NoError(t, err) val := network.Validators[0] diff --git a/x/auth/vesting/client/testutil/suite.go b/x/auth/vesting/client/testutil/suite.go index f619f31165..d76090f308 100644 --- a/x/auth/vesting/client/testutil/suite.go +++ b/x/auth/vesting/client/testutil/suite.go @@ -27,9 +27,11 @@ func NewIntegrationTestSuite(cfg network.Config) *IntegrationTestSuite { func (s *IntegrationTestSuite) SetupSuite() { s.T().Log("setting up integration test suite") - s.network = network.New(s.T(), s.cfg) + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) + s.Require().NoError(err) - _, err := s.network.WaitForHeight(1) + _, err = s.network.WaitForHeight(1) s.Require().NoError(err) } diff --git a/x/authz/client/rest/grpc_query_test.go b/x/authz/client/rest/grpc_query_test.go index 3f29323815..2de1e713bb 100644 --- a/x/authz/client/rest/grpc_query_test.go +++ b/x/authz/client/rest/grpc_query_test.go @@ -37,10 +37,12 @@ func (s *IntegrationTestSuite) SetupSuite() { s.T().Log("setting up integration test suite") cfg := network.DefaultConfig() - cfg.NumValidators = 1 s.cfg = cfg - s.network = network.New(s.T(), cfg) + + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), cfg) + s.Require().NoError(err) val := s.network.Validators[0] // Create new account in the keyring. diff --git a/x/authz/client/testutil/tx.go b/x/authz/client/testutil/tx.go index 10932d9bda..119edec998 100644 --- a/x/authz/client/testutil/tx.go +++ b/x/authz/client/testutil/tx.go @@ -38,7 +38,9 @@ func NewIntegrationTestSuite(cfg network.Config) *IntegrationTestSuite { func (s *IntegrationTestSuite) SetupSuite() { s.T().Log("setting up integration test suite") - s.network = network.New(s.T(), s.cfg) + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) + s.Require().NoError(err) val := s.network.Validators[0] diff --git a/x/bank/client/rest/query_test.go b/x/bank/client/rest/query_test.go index a9e43a53db..ef9e26d507 100644 --- a/x/bank/client/rest/query_test.go +++ b/x/bank/client/rest/query_test.go @@ -58,9 +58,10 @@ func (s *IntegrationTestSuite) SetupSuite() { s.Require().NoError(err) genesisState[types.ModuleName] = bankGenesisBz cfg.GenesisState = genesisState - s.cfg = cfg - s.network = network.New(s.T(), cfg) + + s.network, err = network.New(s.T(), s.T().TempDir(), cfg) + s.Require().NoError(err) _, err = s.network.WaitForHeight(2) s.Require().NoError(err) diff --git a/x/bank/client/testutil/suite.go b/x/bank/client/testutil/suite.go index 19be5401c6..da09851701 100644 --- a/x/bank/client/testutil/suite.go +++ b/x/bank/client/testutil/suite.go @@ -80,7 +80,8 @@ func (s *IntegrationTestSuite) SetupSuite() { genesisState[types.ModuleName] = bankGenesisBz s.cfg.GenesisState = genesisState - s.network = network.New(s.T(), s.cfg) + s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) + s.Require().NoError(err) _, err = s.network.WaitForHeight(1) s.Require().NoError(err) diff --git a/x/crisis/client/testsuite/suite.go b/x/crisis/client/testsuite/suite.go index d0d82f6212..c80679a2d4 100644 --- a/x/crisis/client/testsuite/suite.go +++ b/x/crisis/client/testsuite/suite.go @@ -27,8 +27,11 @@ func NewIntegrationTestSuite(cfg network.Config) *IntegrationTestSuite { func (s *IntegrationTestSuite) SetupSuite() { s.T().Log("setting up integration test suite") - s.network = network.New(s.T(), s.cfg) - _, err := s.network.WaitForHeight(1) + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) + s.Require().NoError(err) + + _, err = s.network.WaitForHeight(1) s.Require().NoError(err) } diff --git a/x/distribution/client/rest/grpc_query_test.go b/x/distribution/client/rest/grpc_query_test.go index ec8e2a7666..d458d4a5a2 100644 --- a/x/distribution/client/rest/grpc_query_test.go +++ b/x/distribution/client/rest/grpc_query_test.go @@ -28,11 +28,13 @@ func (s *IntegrationTestSuite) SetupSuite() { cfg := network.DefaultConfig() cfg.NumValidators = 1 - s.cfg = cfg - s.network = network.New(s.T(), cfg) - _, err := s.network.WaitForHeight(1) + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), cfg) + s.Require().NoError(err) + + _, err = s.network.WaitForHeight(1) s.Require().NoError(err) } diff --git a/x/distribution/client/testutil/suite.go b/x/distribution/client/testutil/suite.go index 3dcfca70aa..3be8d5410a 100644 --- a/x/distribution/client/testutil/suite.go +++ b/x/distribution/client/testutil/suite.go @@ -50,7 +50,8 @@ func (s *IntegrationTestSuite) SetupTest() { genesisState[minttypes.ModuleName] = mintDataBz s.cfg.GenesisState = genesisState - s.network = network.New(s.T(), s.cfg) + s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) + s.Require().NoError(err) _, err = s.network.WaitForHeight(1) s.Require().NoError(err) diff --git a/x/evidence/client/testutil/suite.go b/x/evidence/client/testutil/suite.go index d12083b647..32eae04fd5 100644 --- a/x/evidence/client/testutil/suite.go +++ b/x/evidence/client/testutil/suite.go @@ -24,9 +24,11 @@ func NewIntegrationTestSuite(cfg network.Config) *IntegrationTestSuite { func (s *IntegrationTestSuite) SetupSuite() { s.T().Log("setting up integration test suite") - s.network = network.New(s.T(), s.cfg) + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) + s.Require().NoError(err) - _, err := s.network.WaitForHeight(1) + _, err = s.network.WaitForHeight(1) s.Require().NoError(err) } diff --git a/x/feegrant/client/testutil/suite.go b/x/feegrant/client/testutil/suite.go index c539cf8476..74fe155e66 100644 --- a/x/feegrant/client/testutil/suite.go +++ b/x/feegrant/client/testutil/suite.go @@ -50,9 +50,11 @@ func (s *IntegrationTestSuite) SetupSuite() { s.T().Skip("skipping test in unit-tests mode.") } - s.network = network.New(s.T(), s.cfg) + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) + s.Require().NoError(err) - _, err := s.network.WaitForHeight(1) + _, err = s.network.WaitForHeight(1) s.Require().NoError(err) val := s.network.Validators[0] diff --git a/x/genutil/client/testutil/suite.go b/x/genutil/client/testutil/suite.go index 4c5c389185..bc226a2ab1 100644 --- a/x/genutil/client/testutil/suite.go +++ b/x/genutil/client/testutil/suite.go @@ -34,9 +34,11 @@ func NewIntegrationTestSuite(cfg network.Config) *IntegrationTestSuite { func (s *IntegrationTestSuite) SetupSuite() { s.T().Log("setting up integration test suite") - s.network = network.New(s.T(), s.cfg) + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) + s.Require().NoError(err) - _, err := s.network.WaitForHeight(1) + _, err = s.network.WaitForHeight(1) s.Require().NoError(err) } diff --git a/x/gov/client/rest/grpc_query_test.go b/x/gov/client/rest/grpc_query_test.go index 12247aeb9a..a7806bde2e 100644 --- a/x/gov/client/rest/grpc_query_test.go +++ b/x/gov/client/rest/grpc_query_test.go @@ -32,9 +32,11 @@ func (s *IntegrationTestSuite) SetupSuite() { s.cfg = network.DefaultConfig() s.cfg.NumValidators = 1 - s.network = network.New(s.T(), s.cfg) + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) + s.Require().NoError(err) - _, err := s.network.WaitForHeight(1) + _, err = s.network.WaitForHeight(1) s.Require().NoError(err) val := s.network.Validators[0] diff --git a/x/gov/client/testutil/deposits.go b/x/gov/client/testutil/deposits.go index 57c3c93633..a6096eb33a 100644 --- a/x/gov/client/testutil/deposits.go +++ b/x/gov/client/testutil/deposits.go @@ -28,9 +28,11 @@ func NewDepositTestSuite(cfg network.Config) *DepositTestSuite { func (s *DepositTestSuite) SetupSuite() { s.T().Log("setting up test suite") - s.network = network.New(s.T(), s.cfg) + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) + s.Require().NoError(err) - _, err := s.network.WaitForHeight(1) + _, err = s.network.WaitForHeight(1) s.Require().NoError(err) s.fees = sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(20))).String() diff --git a/x/gov/client/testutil/suite.go b/x/gov/client/testutil/suite.go index ee2634e3d1..ba1db3ff62 100644 --- a/x/gov/client/testutil/suite.go +++ b/x/gov/client/testutil/suite.go @@ -33,9 +33,11 @@ func NewIntegrationTestSuite(cfg network.Config) *IntegrationTestSuite { func (s *IntegrationTestSuite) SetupSuite() { s.T().Log("setting up integration test suite") - s.network = network.New(s.T(), s.cfg) + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) + s.Require().NoError(err) - _, err := s.network.WaitForHeight(1) + _, err = s.network.WaitForHeight(1) s.Require().NoError(err) val := s.network.Validators[0] diff --git a/x/mint/client/rest/grpc_query_test.go b/x/mint/client/rest/grpc_query_test.go index fdbb4ff759..d813d6467b 100644 --- a/x/mint/client/rest/grpc_query_test.go +++ b/x/mint/client/rest/grpc_query_test.go @@ -45,7 +45,8 @@ func (s *IntegrationTestSuite) SetupSuite() { cfg.GenesisState = genesisState s.cfg = cfg - s.network = network.New(s.T(), cfg) + s.network, err = network.New(s.T(), s.T().TempDir(), cfg) + s.Require().NoError(err) _, err = s.network.WaitForHeight(1) s.Require().NoError(err) diff --git a/x/mint/client/testutil/suite.go b/x/mint/client/testutil/suite.go index 24e7426760..dd90d2d543 100644 --- a/x/mint/client/testutil/suite.go +++ b/x/mint/client/testutil/suite.go @@ -44,7 +44,8 @@ func (s *IntegrationTestSuite) SetupSuite() { genesisState[minttypes.ModuleName] = mintDataBz s.cfg.GenesisState = genesisState - s.network = network.New(s.T(), s.cfg) + s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) + s.Require().NoError(err) _, err = s.network.WaitForHeight(1) s.Require().NoError(err) diff --git a/x/params/client/rest/grpc_query_test.go b/x/params/client/rest/grpc_query_test.go index f2c4440e29..8de3f2cbd8 100644 --- a/x/params/client/rest/grpc_query_test.go +++ b/x/params/client/rest/grpc_query_test.go @@ -24,11 +24,13 @@ func (s *IntegrationTestSuite) SetupSuite() { cfg := network.DefaultConfig() cfg.NumValidators = 1 - s.cfg = cfg - s.network = network.New(s.T(), cfg) - _, err := s.network.WaitForHeight(1) + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), cfg) + s.Require().NoError(err) + + _, err = s.network.WaitForHeight(1) s.Require().NoError(err) } diff --git a/x/params/client/testutil/suite.go b/x/params/client/testutil/suite.go index e539b8791d..c38d93b9b6 100644 --- a/x/params/client/testutil/suite.go +++ b/x/params/client/testutil/suite.go @@ -26,9 +26,11 @@ func NewIntegrationTestSuite(cfg network.Config) *IntegrationTestSuite { func (s *IntegrationTestSuite) SetupSuite() { s.T().Log("setting up integration test suite") - s.network = network.New(s.T(), s.cfg) + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) + s.Require().NoError(err) - _, err := s.network.WaitForHeight(1) + _, err = s.network.WaitForHeight(1) s.Require().NoError(err) } diff --git a/x/slashing/client/rest/grpc_query_test.go b/x/slashing/client/rest/grpc_query_test.go index 39daf06f69..0531d1e98e 100644 --- a/x/slashing/client/rest/grpc_query_test.go +++ b/x/slashing/client/rest/grpc_query_test.go @@ -28,11 +28,13 @@ func (s *IntegrationTestSuite) SetupSuite() { cfg := network.DefaultConfig() cfg.NumValidators = 1 - s.cfg = cfg - s.network = network.New(s.T(), cfg) - _, err := s.network.WaitForHeight(1) + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), cfg) + s.Require().NoError(err) + + _, err = s.network.WaitForHeight(1) s.Require().NoError(err) } diff --git a/x/slashing/client/testutil/suite.go b/x/slashing/client/testutil/suite.go index cf5cf997b6..06bcdca701 100644 --- a/x/slashing/client/testutil/suite.go +++ b/x/slashing/client/testutil/suite.go @@ -31,9 +31,11 @@ func NewIntegrationTestSuite(cfg network.Config) *IntegrationTestSuite { func (s *IntegrationTestSuite) SetupSuite() { s.T().Log("setting up integration test suite") - s.network = network.New(s.T(), s.cfg) + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) + s.Require().NoError(err) - _, err := s.network.WaitForHeight(1) + _, err = s.network.WaitForHeight(1) s.Require().NoError(err) } diff --git a/x/staking/client/rest/grpc_query_test.go b/x/staking/client/rest/grpc_query_test.go index 55a10194f6..29e95775e2 100644 --- a/x/staking/client/rest/grpc_query_test.go +++ b/x/staking/client/rest/grpc_query_test.go @@ -35,11 +35,13 @@ func (s *IntegrationTestSuite) SetupSuite() { cfg := network.DefaultConfig() cfg.NumValidators = 2 - s.cfg = cfg - s.network = network.New(s.T(), cfg) - _, err := s.network.WaitForHeight(1) + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), cfg) + s.Require().NoError(err) + + _, err = s.network.WaitForHeight(1) s.Require().NoError(err) unbond, err := sdk.ParseCoinNormalized("10stake") diff --git a/x/staking/client/testutil/suite.go b/x/staking/client/testutil/suite.go index f24a1ad5a2..fc6229ecca 100644 --- a/x/staking/client/testutil/suite.go +++ b/x/staking/client/testutil/suite.go @@ -43,9 +43,11 @@ func (s *IntegrationTestSuite) SetupSuite() { s.T().Skip("skipping test in unit-tests mode.") } - s.network = network.New(s.T(), s.cfg) + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), s.cfg) + s.Require().NoError(err) - _, err := s.network.WaitForHeight(1) + _, err = s.network.WaitForHeight(1) s.Require().NoError(err) unbond, err := sdk.ParseCoinNormalized("10stake") diff --git a/x/upgrade/client/testutil/suite.go b/x/upgrade/client/testutil/suite.go index 6b559e823c..bfa7859087 100644 --- a/x/upgrade/client/testutil/suite.go +++ b/x/upgrade/client/testutil/suite.go @@ -36,7 +36,10 @@ func (s *IntegrationTestSuite) SetupSuite() { cfg.NumValidators = 1 s.cfg = cfg - s.network = network.New(s.T(), cfg) + + var err error + s.network, err = network.New(s.T(), s.T().TempDir(), cfg) + s.Require().NoError(err) } func (s *IntegrationTestSuite) TearDownSuite() { From f5b11bc3289a08aca33b4e293300ce1ab4879fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Federico=20Kunze=20K=C3=BCllmer?= <31522760+fedekunze@users.noreply.github.com> Date: Wed, 30 Jun 2021 06:13:07 -0400 Subject: [PATCH 43/50] feat!: add error handling to staking hooks (#9571) ## Description - Adds error handling for staking hooks --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [x] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- CHANGELOG.md | 1 + simapp/export.go | 4 +- x/distribution/keeper/hooks.go | 40 ++++++++++----- x/slashing/keeper/hooks.go | 46 +++++++++++------- x/slashing/types/expected_keepers.go | 6 +-- x/staking/genesis.go | 15 ++++-- x/staking/keeper/delegation.go | 32 +++++++++--- x/staking/keeper/hooks.go | 48 ++++++++++-------- x/staking/keeper/msg_server.go | 8 ++- x/staking/spec/06_hooks.md | 16 +++--- x/staking/types/expected_keepers.go | 20 ++++---- x/staking/types/hooks.go | 73 ++++++++++++++++++++-------- 12 files changed, 203 insertions(+), 106 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c13f59bec..4bccf1210b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking Changes +* [\#9571](https://github.com/cosmos/cosmos-sdk/pull/9571) Implemented error handling for staking hooks, which now return an error on failure. * [\#9427](https://github.com/cosmos/cosmos-sdk/pull/9427) Move simapp `FundAccount` and `FundModuleAccount` to `x/bank/testutil` * (client/tx) [\#9421](https://github.com/cosmos/cosmos-sdk/pull/9421/) `BuildUnsignedTx`, `BuildSimTx`, `PrintUnsignedStdTx` functions are moved to the Tx Factory as methods. diff --git a/simapp/export.go b/simapp/export.go index 8d09e333a2..7c59ffc69c 100644 --- a/simapp/export.go +++ b/simapp/export.go @@ -109,7 +109,9 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [] feePool.CommunityPool = feePool.CommunityPool.Add(scraps...) app.DistrKeeper.SetFeePool(ctx, feePool) - app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator()) + if err := app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator()); err != nil { + panic(err) + } return false }) diff --git a/x/distribution/keeper/hooks.go b/x/distribution/keeper/hooks.go index 1d12fcc555..0c66d44e33 100644 --- a/x/distribution/keeper/hooks.go +++ b/x/distribution/keeper/hooks.go @@ -17,13 +17,14 @@ var _ stakingtypes.StakingHooks = Hooks{} func (k Keeper) Hooks() Hooks { return Hooks{k} } // initialize validator distribution record -func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) { +func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error { val := h.k.stakingKeeper.Validator(ctx, valAddr) h.k.initializeValidator(ctx, val) + return nil } // AfterValidatorRemoved performs clean up after a validator is removed -func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress) { +func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress) error { // fetch outstanding outstanding := h.k.GetValidatorOutstandingRewardsCoins(ctx, valAddr) @@ -47,7 +48,7 @@ func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, _ sdk.ConsAddress, valAddr withdrawAddr := h.k.GetDelegatorWithdrawAddr(ctx, accAddr) if err := h.k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, withdrawAddr, coins); err != nil { - panic(err) + return err } } } @@ -73,35 +74,48 @@ func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, _ sdk.ConsAddress, valAddr // clear current rewards h.k.DeleteValidatorCurrentRewards(ctx, valAddr) + + return nil } // increment period -func (h Hooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) { +func (h Hooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { val := h.k.stakingKeeper.Validator(ctx, valAddr) - h.k.IncrementValidatorPeriod(ctx, val) + _ = h.k.IncrementValidatorPeriod(ctx, val) + return nil } // withdraw delegation rewards (which also increments period) -func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) { +func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { val := h.k.stakingKeeper.Validator(ctx, valAddr) del := h.k.stakingKeeper.Delegation(ctx, delAddr, valAddr) if _, err := h.k.withdrawDelegationRewards(ctx, val, del); err != nil { - panic(err) + return err } + + return nil } // create new delegation period record -func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) { +func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { h.k.initializeDelegation(ctx, valAddr, delAddr) + return nil } // record the slash event -func (h Hooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) { +func (h Hooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error { h.k.updateValidatorSlashFraction(ctx, valAddr, fraction) + return nil } -func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress) {} -func (h Hooks) AfterValidatorBonded(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) {} -func (h Hooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) {} -func (h Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) {} +func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress) error { return nil } +func (h Hooks) AfterValidatorBonded(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { + return nil +} +func (h Hooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { + return nil +} +func (h Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { + return nil +} diff --git a/x/slashing/keeper/hooks.go b/x/slashing/keeper/hooks.go index e3a00e9f55..09d1afe02f 100644 --- a/x/slashing/keeper/hooks.go +++ b/x/slashing/keeper/hooks.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/slashing/types" ) -func (k Keeper) AfterValidatorBonded(ctx sdk.Context, address sdk.ConsAddress, _ sdk.ValAddress) { +func (k Keeper) AfterValidatorBonded(ctx sdk.Context, address sdk.ConsAddress, _ sdk.ValAddress) error { // Update the signing info start height or create a new signing info _, found := k.GetValidatorSigningInfo(ctx, address) if !found { @@ -23,6 +23,8 @@ func (k Keeper) AfterValidatorBonded(ctx sdk.Context, address sdk.ConsAddress, _ ) k.SetValidatorSigningInfo(ctx, address, signingInfo) } + + return nil } // AfterValidatorCreated adds the address-pubkey relation when a validator is created. @@ -32,14 +34,14 @@ func (k Keeper) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) e if err != nil { return err } - k.AddPubkey(ctx, consPk) - return nil + return k.AddPubkey(ctx, consPk) } // AfterValidatorRemoved deletes the address-pubkey relation when a validator is removed, -func (k Keeper) AfterValidatorRemoved(ctx sdk.Context, address sdk.ConsAddress) { +func (k Keeper) AfterValidatorRemoved(ctx sdk.Context, address sdk.ConsAddress) error { k.deleteAddrPubkeyRelation(ctx, crypto.Address(address)) + return nil } // Hooks wrapper struct for slashing keeper @@ -55,24 +57,34 @@ func (k Keeper) Hooks() Hooks { } // Implements sdk.ValidatorHooks -func (h Hooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) { - h.k.AfterValidatorBonded(ctx, consAddr, valAddr) +func (h Hooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { + return h.k.AfterValidatorBonded(ctx, consAddr, valAddr) } // Implements sdk.ValidatorHooks -func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, _ sdk.ValAddress) { - h.k.AfterValidatorRemoved(ctx, consAddr) +func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, _ sdk.ValAddress) error { + return h.k.AfterValidatorRemoved(ctx, consAddr) } // Implements sdk.ValidatorHooks -func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) { - h.k.AfterValidatorCreated(ctx, valAddr) +func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error { + return h.k.AfterValidatorCreated(ctx, valAddr) } -func (h Hooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) {} -func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress) {} -func (h Hooks) BeforeDelegationCreated(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) {} -func (h Hooks) BeforeDelegationSharesModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) {} -func (h Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) {} -func (h Hooks) AfterDelegationModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) {} -func (h Hooks) BeforeValidatorSlashed(_ sdk.Context, _ sdk.ValAddress, _ sdk.Dec) {} +func (h Hooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error { + return nil +} +func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress) error { return nil } +func (h Hooks) BeforeDelegationCreated(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { + return nil +} +func (h Hooks) BeforeDelegationSharesModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { + return nil +} +func (h Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { + return nil +} +func (h Hooks) AfterDelegationModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress) error { + return nil +} +func (h Hooks) BeforeValidatorSlashed(_ sdk.Context, _ sdk.ValAddress, _ sdk.Dec) error { return nil } diff --git a/x/slashing/types/expected_keepers.go b/x/slashing/types/expected_keepers.go index 9710ad1786..7bddb6cebc 100644 --- a/x/slashing/types/expected_keepers.go +++ b/x/slashing/types/expected_keepers.go @@ -56,8 +56,8 @@ type StakingKeeper interface { // StakingHooks event hooks for staking validator object (noalias) type StakingHooks interface { - AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) // Must be called when a validator is created - AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) // Must be called when a validator is deleted + AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error // Must be called when a validator is created + AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator is deleted - AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) // Must be called when a validator is bonded + AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator is bonded } diff --git a/x/staking/genesis.go b/x/staking/genesis.go index 34a5be852a..55daae2ce9 100644 --- a/x/staking/genesis.go +++ b/x/staking/genesis.go @@ -2,7 +2,6 @@ package staking import ( "fmt" - "log" abci "github.com/tendermint/tendermint/abci/types" tmtypes "github.com/tendermint/tendermint/types" @@ -44,7 +43,9 @@ func InitGenesis( // Call the creation hook if not exported if !data.Exported { - keeper.AfterValidatorCreated(ctx, validator.GetOperator()) + if err := keeper.AfterValidatorCreated(ctx, validator.GetOperator()); err != nil { + panic(err) + } } // update timeslice if necessary @@ -70,13 +71,17 @@ func InitGenesis( // Call the before-creation hook if not exported if !data.Exported { - keeper.BeforeDelegationCreated(ctx, delegatorAddress, delegation.GetValidatorAddr()) + if err := keeper.BeforeDelegationCreated(ctx, delegatorAddress, delegation.GetValidatorAddr()); err != nil { + panic(err) + } } keeper.SetDelegation(ctx, delegation) // Call the after-modification hook if not exported if !data.Exported { - keeper.AfterDelegationModified(ctx, delegatorAddress, delegation.GetValidatorAddr()) + if err := keeper.AfterDelegationModified(ctx, delegatorAddress, delegation.GetValidatorAddr()); err != nil { + panic(err) + } } } @@ -149,7 +154,7 @@ func InitGenesis( var err error res, err = keeper.ApplyAndReturnValidatorSetUpdates(ctx) if err != nil { - log.Fatal(err) + panic(err) } } diff --git a/x/staking/keeper/delegation.go b/x/staking/keeper/delegation.go index 6ed92e37aa..ca4ab27658 100644 --- a/x/staking/keeper/delegation.go +++ b/x/staking/keeper/delegation.go @@ -101,15 +101,19 @@ func (k Keeper) SetDelegation(ctx sdk.Context, delegation types.Delegation) { } // remove a delegation -func (k Keeper) RemoveDelegation(ctx sdk.Context, delegation types.Delegation) { +func (k Keeper) RemoveDelegation(ctx sdk.Context, delegation types.Delegation) error { delegatorAddress, err := sdk.AccAddressFromBech32(delegation.DelegatorAddress) if err != nil { panic(err) } // TODO: Consider calling hooks outside of the store wrapper functions, it's unobvious. - k.BeforeDelegationRemoved(ctx, delegatorAddress, delegation.GetValidatorAddr()) + if err := k.BeforeDelegationRemoved(ctx, delegatorAddress, delegation.GetValidatorAddr()); err != nil { + return err + } + store := ctx.KVStore(k.storeKey) store.Delete(types.GetDelegationKey(delegatorAddress, delegation.GetValidatorAddr())) + return nil } // return a given amount of all the delegator unbonding-delegations @@ -563,9 +567,13 @@ func (k Keeper) Delegate( // call the appropriate hook if present if found { - k.BeforeDelegationSharesModified(ctx, delAddr, validator.GetOperator()) + err = k.BeforeDelegationSharesModified(ctx, delAddr, validator.GetOperator()) } else { - k.BeforeDelegationCreated(ctx, delAddr, validator.GetOperator()) + err = k.BeforeDelegationCreated(ctx, delAddr, validator.GetOperator()) + } + + if err != nil { + return sdk.ZeroDec(), err } delegatorAddress, err := sdk.AccAddressFromBech32(delegation.DelegatorAddress) @@ -621,7 +629,9 @@ func (k Keeper) Delegate( k.SetDelegation(ctx, delegation) // Call the after-modification hook - k.AfterDelegationModified(ctx, delegatorAddress, delegation.GetValidatorAddr()) + if err := k.AfterDelegationModified(ctx, delegatorAddress, delegation.GetValidatorAddr()); err != nil { + return newShares, err + } return newShares, nil } @@ -637,7 +647,9 @@ func (k Keeper) Unbond( } // call the before-delegation-modified hook - k.BeforeDelegationSharesModified(ctx, delAddr, valAddr) + if err := k.BeforeDelegationSharesModified(ctx, delAddr, valAddr); err != nil { + return amount, err + } // ensure that we have enough shares to remove if delegation.Shares.LT(shares) { @@ -670,11 +682,15 @@ func (k Keeper) Unbond( // remove the delegation if delegation.Shares.IsZero() { - k.RemoveDelegation(ctx, delegation) + err = k.RemoveDelegation(ctx, delegation) } else { k.SetDelegation(ctx, delegation) // call the after delegation modification hook - k.AfterDelegationModified(ctx, delegatorAddress, delegation.GetValidatorAddr()) + err = k.AfterDelegationModified(ctx, delegatorAddress, delegation.GetValidatorAddr()) + } + + if err != nil { + return amount, err } // remove the shares and coins from the validator diff --git a/x/staking/keeper/hooks.go b/x/staking/keeper/hooks.go index b8f25908ba..91375c9e38 100644 --- a/x/staking/keeper/hooks.go +++ b/x/staking/keeper/hooks.go @@ -9,71 +9,81 @@ import ( var _ types.StakingHooks = Keeper{} // AfterValidatorCreated - call hook if registered -func (k Keeper) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) { +func (k Keeper) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error { if k.hooks != nil { - k.hooks.AfterValidatorCreated(ctx, valAddr) + return k.hooks.AfterValidatorCreated(ctx, valAddr) } + return nil } // BeforeValidatorModified - call hook if registered -func (k Keeper) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) { +func (k Keeper) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) error { if k.hooks != nil { - k.hooks.BeforeValidatorModified(ctx, valAddr) + return k.hooks.BeforeValidatorModified(ctx, valAddr) } + return nil } // AfterValidatorRemoved - call hook if registered -func (k Keeper) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) { +func (k Keeper) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { if k.hooks != nil { - k.hooks.AfterValidatorRemoved(ctx, consAddr, valAddr) + return k.hooks.AfterValidatorRemoved(ctx, consAddr, valAddr) } + return nil } // AfterValidatorBonded - call hook if registered -func (k Keeper) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) { +func (k Keeper) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { if k.hooks != nil { - k.hooks.AfterValidatorBonded(ctx, consAddr, valAddr) + return k.hooks.AfterValidatorBonded(ctx, consAddr, valAddr) } + return nil } // AfterValidatorBeginUnbonding - call hook if registered -func (k Keeper) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) { +func (k Keeper) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { if k.hooks != nil { - k.hooks.AfterValidatorBeginUnbonding(ctx, consAddr, valAddr) + return k.hooks.AfterValidatorBeginUnbonding(ctx, consAddr, valAddr) } + return nil } // BeforeDelegationCreated - call hook if registered -func (k Keeper) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) { +func (k Keeper) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { if k.hooks != nil { - k.hooks.BeforeDelegationCreated(ctx, delAddr, valAddr) + return k.hooks.BeforeDelegationCreated(ctx, delAddr, valAddr) } + return nil } // BeforeDelegationSharesModified - call hook if registered -func (k Keeper) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) { +func (k Keeper) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { if k.hooks != nil { - k.hooks.BeforeDelegationSharesModified(ctx, delAddr, valAddr) + return k.hooks.BeforeDelegationSharesModified(ctx, delAddr, valAddr) } + return nil } // BeforeDelegationRemoved - call hook if registered -func (k Keeper) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) { +func (k Keeper) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { if k.hooks != nil { k.hooks.BeforeDelegationRemoved(ctx, delAddr, valAddr) } + return nil } // AfterDelegationModified - call hook if registered -func (k Keeper) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) { +func (k Keeper) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { if k.hooks != nil { - k.hooks.AfterDelegationModified(ctx, delAddr, valAddr) + return k.hooks.AfterDelegationModified(ctx, delAddr, valAddr) } + return nil } // BeforeValidatorSlashed - call hook if registered -func (k Keeper) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) { +func (k Keeper) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error { if k.hooks != nil { - k.hooks.BeforeValidatorSlashed(ctx, valAddr, fraction) + return k.hooks.BeforeValidatorSlashed(ctx, valAddr, fraction) } + return nil } diff --git a/x/staking/keeper/msg_server.go b/x/staking/keeper/msg_server.go index 30857c3a01..db084531ca 100644 --- a/x/staking/keeper/msg_server.go +++ b/x/staking/keeper/msg_server.go @@ -96,7 +96,9 @@ func (k msgServer) CreateValidator(goCtx context.Context, msg *types.MsgCreateVa k.SetNewValidatorByPowerIndex(ctx, validator) // call the after-creation hook - k.AfterValidatorCreated(ctx, validator.GetOperator()) + if err := k.AfterValidatorCreated(ctx, validator.GetOperator()); err != nil { + return nil, err + } // move coins from the msg.Address account to a (self-delegation) delegator account // the validator account and global shares are updated within here @@ -150,7 +152,9 @@ func (k msgServer) EditValidator(goCtx context.Context, msg *types.MsgEditValida } // call the before-modification hook since we're about to update the commission - k.BeforeValidatorModified(ctx, valAddr) + if err := k.BeforeValidatorModified(ctx, valAddr); err != nil { + return nil, err + } validator.Commission = commission } diff --git a/x/staking/spec/06_hooks.md b/x/staking/spec/06_hooks.md index d4c3228eca..655431a7e6 100644 --- a/x/staking/spec/06_hooks.md +++ b/x/staking/spec/06_hooks.md @@ -9,19 +9,19 @@ occurred within staking. These events can be registered to execute either right `Before` or `After` the staking event (as per the hook name). The following hooks can registered with staking: -- `AfterValidatorCreated(Context, ValAddress)` +- `AfterValidatorCreated(Context, ValAddress) error` - called when a validator is created -- `BeforeValidatorModified(Context, ValAddress)` +- `BeforeValidatorModified(Context, ValAddress) error` - called when a validator's state is changed -- `AfterValidatorRemoved(Context, ConsAddress, ValAddress)` +- `AfterValidatorRemoved(Context, ConsAddress, ValAddress) error` - called when a validator is deleted -- `AfterValidatorBonded(Context, ConsAddress, ValAddress)` +- `AfterValidatorBonded(Context, ConsAddress, ValAddress) error` - called when a validator is bonded -- `AfterValidatorBeginUnbonding(Context, ConsAddress, ValAddress)` +- `AfterValidatorBeginUnbonding(Context, ConsAddress, ValAddress) error` - called when a validator begins unbonding -- `BeforeDelegationCreated(Context, AccAddress, ValAddress)` +- `BeforeDelegationCreated(Context, AccAddress, ValAddress) error` - called when a delegation is created -- `BeforeDelegationSharesModified(Context, AccAddress, ValAddress)` +- `BeforeDelegationSharesModified(Context, AccAddress, ValAddress) error` - called when a delegation's shares are modified -- `BeforeDelegationRemoved(Context, AccAddress, ValAddress)` +- `BeforeDelegationRemoved(Context, AccAddress, ValAddress) error` - called when a delegation is removed diff --git a/x/staking/types/expected_keepers.go b/x/staking/types/expected_keepers.go index 313db78e7b..f00971751c 100644 --- a/x/staking/types/expected_keepers.go +++ b/x/staking/types/expected_keepers.go @@ -89,16 +89,16 @@ type DelegationSet interface { // StakingHooks event hooks for staking validator object (noalias) type StakingHooks interface { - AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) // Must be called when a validator is created - BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) // Must be called when a validator's state changes - AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) // Must be called when a validator is deleted + AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error // Must be called when a validator is created + BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) error // Must be called when a validator's state changes + AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator is deleted - AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) // Must be called when a validator is bonded - AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) // Must be called when a validator begins unbonding + AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator is bonded + AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error // Must be called when a validator begins unbonding - BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) // Must be called when a delegation is created - BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) // Must be called when a delegation's shares are modified - BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) // Must be called when a delegation is removed - AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) - BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) + BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error // Must be called when a delegation is created + BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error // Must be called when a delegation's shares are modified + BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error // Must be called when a delegation is removed + AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error + BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error } diff --git a/x/staking/types/hooks.go b/x/staking/types/hooks.go index 694caca540..33838bcaa0 100644 --- a/x/staking/types/hooks.go +++ b/x/staking/types/hooks.go @@ -5,59 +5,92 @@ import ( ) // combine multiple staking hooks, all hook functions are run in array sequence +var _ StakingHooks = &MultiStakingHooks{} + type MultiStakingHooks []StakingHooks func NewMultiStakingHooks(hooks ...StakingHooks) MultiStakingHooks { return hooks } -func (h MultiStakingHooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) { +func (h MultiStakingHooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error { for i := range h { - h[i].AfterValidatorCreated(ctx, valAddr) + if err := h[i].AfterValidatorCreated(ctx, valAddr); err != nil { + return err + } } + + return nil } -func (h MultiStakingHooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) { +func (h MultiStakingHooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) error { for i := range h { - h[i].BeforeValidatorModified(ctx, valAddr) + if err := h[i].BeforeValidatorModified(ctx, valAddr); err != nil { + return err + } } + return nil } -func (h MultiStakingHooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) { +func (h MultiStakingHooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { for i := range h { - h[i].AfterValidatorRemoved(ctx, consAddr, valAddr) + if err := h[i].AfterValidatorRemoved(ctx, consAddr, valAddr); err != nil { + return err + } } + return nil } -func (h MultiStakingHooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) { +func (h MultiStakingHooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { for i := range h { - h[i].AfterValidatorBonded(ctx, consAddr, valAddr) + if err := h[i].AfterValidatorBonded(ctx, consAddr, valAddr); err != nil { + return err + } } + return nil } -func (h MultiStakingHooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) { +func (h MultiStakingHooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error { for i := range h { - h[i].AfterValidatorBeginUnbonding(ctx, consAddr, valAddr) + if err := h[i].AfterValidatorBeginUnbonding(ctx, consAddr, valAddr); err != nil { + return err + } } + return nil } -func (h MultiStakingHooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) { +func (h MultiStakingHooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { for i := range h { - h[i].BeforeDelegationCreated(ctx, delAddr, valAddr) + if err := h[i].BeforeDelegationCreated(ctx, delAddr, valAddr); err != nil { + return err + } } + return nil } -func (h MultiStakingHooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) { +func (h MultiStakingHooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { for i := range h { - h[i].BeforeDelegationSharesModified(ctx, delAddr, valAddr) + if err := h[i].BeforeDelegationSharesModified(ctx, delAddr, valAddr); err != nil { + return err + } } + return nil } -func (h MultiStakingHooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) { +func (h MultiStakingHooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { for i := range h { - h[i].BeforeDelegationRemoved(ctx, delAddr, valAddr) + if err := h[i].BeforeDelegationRemoved(ctx, delAddr, valAddr); err != nil { + return err + } } + return nil } -func (h MultiStakingHooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) { +func (h MultiStakingHooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error { for i := range h { - h[i].AfterDelegationModified(ctx, delAddr, valAddr) + if err := h[i].AfterDelegationModified(ctx, delAddr, valAddr); err != nil { + return err + } } + return nil } -func (h MultiStakingHooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) { +func (h MultiStakingHooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error { for i := range h { - h[i].BeforeValidatorSlashed(ctx, valAddr, fraction) + if err := h[i].BeforeValidatorSlashed(ctx, valAddr, fraction); err != nil { + return err + } } + return nil } From d9fb4cf34d4ca65d2eca078dbd7edde084c884db Mon Sep 17 00:00:00 2001 From: MD Aleem <72057206+aleem1314@users.noreply.github.com> Date: Thu, 1 Jul 2021 14:22:38 +0530 Subject: [PATCH 44/50] refactor!: Remove `clientCtx.JSONCodec` and rename `EncodingConfig.Marshaler` to `Codec` (#9521) ## Description Closes: #9499 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [x] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [x] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- CHANGELOG.md | 2 ++ client/context.go | 20 +++----------------- client/keys/add_test.go | 4 ++-- codec/any_test.go | 18 +++++++++--------- crypto/keys/multisig/multisig_test.go | 2 +- server/export_test.go | 2 +- server/util_test.go | 4 ++-- simapp/app.go | 2 +- simapp/app_test.go | 4 ++-- simapp/params/encoding.go | 7 +++---- simapp/params/proto.go | 6 +++--- simapp/simd/cmd/genaccounts_test.go | 2 +- simapp/simd/cmd/root.go | 4 ++-- simapp/simd/cmd/testnet_test.go | 6 +++--- simapp/test_helpers.go | 2 +- testutil/network/network.go | 4 ++-- x/auth/client/cli/encode_test.go | 4 ++-- x/auth/keeper/keeper_test.go | 2 +- x/auth/legacy/v040/migrate_test.go | 2 +- x/auth/legacy/v043/store_test.go | 2 +- x/auth/simulation/decoder_test.go | 2 +- x/auth/types/common_test.go | 2 +- x/authz/simulation/decoder_test.go | 2 +- x/bank/keeper/keeper_test.go | 2 +- x/bank/legacy/v040/migrate_test.go | 2 +- x/bank/legacy/v043/store_test.go | 6 +++--- x/capability/simulation/decoder_test.go | 2 +- x/distribution/client/cli/tx_test.go | 2 +- x/distribution/simulation/decoder_test.go | 2 +- x/evidence/keeper/querier_test.go | 2 +- x/evidence/legacy/v040/migrate_test.go | 2 +- x/feegrant/simulation/decoder_test.go | 2 +- x/genutil/gentx_test.go | 4 ++-- x/gov/keeper/common_test.go | 2 +- x/gov/legacy/v040/migrate_test.go | 2 +- x/gov/legacy/v043/json_test.go | 2 +- x/gov/legacy/v043/store_test.go | 2 +- x/gov/simulation/decoder_test.go | 2 +- x/mint/simulation/decoder_test.go | 2 +- x/params/keeper/common_test.go | 2 +- x/params/types/subspace_test.go | 4 ++-- x/slashing/legacy/v040/migrate_test.go | 2 +- x/slashing/simulation/decoder_test.go | 2 +- x/staking/keeper/grpc_query_test.go | 2 +- x/staking/legacy/v040/migrate_test.go | 2 +- x/staking/simulation/decoder_test.go | 2 +- 46 files changed, 73 insertions(+), 86 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bccf1210b..9611cd3531 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (client/tx) [\#9421](https://github.com/cosmos/cosmos-sdk/pull/9421/) `BuildUnsignedTx`, `BuildSimTx`, `PrintUnsignedStdTx` functions are moved to the Tx Factory as methods. * [\#9246](https://github.com/cosmos/cosmos-sdk/pull/9246) The `New` method for the network package now returns an error. +* (codec) [\#9521](https://github.com/cosmos/cosmos-sdk/pull/9521) Removed deprecated `clientCtx.JSONCodec` from `client.Context`. +* (codec) [\#9521](https://github.com/cosmos/cosmos-sdk/pull/9521) Rename `EncodingConfig.Marshaler` to `Codec`. ### CLI Breaking Changes diff --git a/client/context.go b/client/context.go index 246ea5b40d..1308823c84 100644 --- a/client/context.go +++ b/client/context.go @@ -22,11 +22,9 @@ import ( // Context implements a typical context created in SDK modules for transaction // handling and queries. type Context struct { - FromAddress sdk.AccAddress - Client rpcclient.Client - ChainID string - // Deprecated: Codec codec will be changed to Codec: codec.Codec - JSONCodec codec.JSONCodec + FromAddress sdk.AccAddress + Client rpcclient.Client + ChainID string Codec codec.Codec InterfaceRegistry codectypes.InterfaceRegistry Input io.Reader @@ -74,20 +72,8 @@ func (ctx Context) WithInput(r io.Reader) Context { return ctx } -// Deprecated: WithJSONCodec returns a copy of the Context with an updated JSONCodec. -func (ctx Context) WithJSONCodec(m codec.JSONCodec) Context { - ctx.JSONCodec = m - // since we are using ctx.Codec everywhere in the SDK, for backward compatibility - // we need to try to set it here as well. - if c, ok := m.(codec.Codec); ok { - ctx.Codec = c - } - return ctx -} - // WithCodec returns a copy of the Context with an updated Codec. func (ctx Context) WithCodec(m codec.Codec) Context { - ctx.JSONCodec = m ctx.Codec = m return ctx } diff --git a/client/keys/add_test.go b/client/keys/add_test.go index 06375257a4..8e6bf7e5cc 100644 --- a/client/keys/add_test.go +++ b/client/keys/add_test.go @@ -191,9 +191,9 @@ func Test_runAddCmdDryRun(t *testing.T) { kb, err := keyring.New(sdk.KeyringServiceName(), keyring.BackendTest, kbHome, mockIn) require.NoError(t, err) - appCodec := simapp.MakeTestEncodingConfig().Marshaler + appCodec := simapp.MakeTestEncodingConfig().Codec clientCtx := client.Context{}. - WithJSONCodec(appCodec). + WithCodec(appCodec). WithKeyringDir(kbHome). WithKeyring(kb) ctx := context.WithValue(context.Background(), client.ClientContextKey, &clientCtx) diff --git a/codec/any_test.go b/codec/any_test.go index 8b5ecaca3c..92bb9d0d50 100644 --- a/codec/any_test.go +++ b/codec/any_test.go @@ -68,11 +68,11 @@ func TestMarshalProtoPubKey(t *testing.T) { pkAny, err := codectypes.NewAnyWithValue(pk) require.NoError(err) - bz, err := ccfg.Marshaler.MarshalJSON(pkAny) + bz, err := ccfg.Codec.MarshalJSON(pkAny) require.NoError(err) var pkAny2 codectypes.Any - err = ccfg.Marshaler.UnmarshalJSON(bz, &pkAny2) + err = ccfg.Codec.UnmarshalJSON(bz, &pkAny2) require.NoError(err) // Before getting a cached value we need to unpack it. // Normally this happens in types which implement UnpackInterfaces @@ -84,11 +84,11 @@ func TestMarshalProtoPubKey(t *testing.T) { // **** test binary serialization **** - bz, err = ccfg.Marshaler.Marshal(pkAny) + bz, err = ccfg.Codec.Marshal(pkAny) require.NoError(err) var pkAny3 codectypes.Any - err = ccfg.Marshaler.Unmarshal(bz, &pkAny3) + err = ccfg.Codec.Unmarshal(bz, &pkAny3) require.NoError(err) err = ccfg.InterfaceRegistry.UnpackAny(&pkAny3, &pkI) require.NoError(err) @@ -106,11 +106,11 @@ func TestMarshalProtoInterfacePubKey(t *testing.T) { // **** test JSON serialization **** - bz, err := ccfg.Marshaler.MarshalInterfaceJSON(pk) + bz, err := ccfg.Codec.MarshalInterfaceJSON(pk) require.NoError(err) var pk3 cryptotypes.PubKey - err = ccfg.Marshaler.UnmarshalInterfaceJSON(bz, &pk3) + err = ccfg.Codec.UnmarshalInterfaceJSON(bz, &pk3) require.NoError(err) require.True(pk3.Equals(pk)) @@ -119,18 +119,18 @@ func TestMarshalProtoInterfacePubKey(t *testing.T) { // Any can't implement UnpackInterfacesMessage interface. So Any is not // automatically unpacked and we won't get a value. var pkAny codectypes.Any - err = ccfg.Marshaler.UnmarshalJSON(bz, &pkAny) + err = ccfg.Codec.UnmarshalJSON(bz, &pkAny) require.NoError(err) ifc := pkAny.GetCachedValue() require.Nil(ifc) // **** test binary serialization **** - bz, err = ccfg.Marshaler.MarshalInterface(pk) + bz, err = ccfg.Codec.MarshalInterface(pk) require.NoError(err) var pk2 cryptotypes.PubKey - err = ccfg.Marshaler.UnmarshalInterface(bz, &pk2) + err = ccfg.Codec.UnmarshalInterface(bz, &pk2) require.NoError(err) require.True(pk2.Equals(pk)) } diff --git a/crypto/keys/multisig/multisig_test.go b/crypto/keys/multisig/multisig_test.go index 8fb93d3524..93ef120fab 100644 --- a/crypto/keys/multisig/multisig_test.go +++ b/crypto/keys/multisig/multisig_test.go @@ -352,7 +352,7 @@ func TestDisplay(t *testing.T) { func() { require.Empty(msig.String()) }, ) ccfg := simapp.MakeTestEncodingConfig() - bz, err := ccfg.Marshaler.MarshalInterfaceJSON(msig) + bz, err := ccfg.Codec.MarshalInterfaceJSON(msig) require.NoError(err) expectedPrefix := `{"@type":"/cosmos.crypto.multisig.LegacyAminoPubKey","threshold":2,"public_keys":[{"@type":"/cosmos.crypto.secp256k1.PubKey"` require.True(strings.HasPrefix(string(bz), expectedPrefix)) diff --git a/server/export_test.go b/server/export_test.go index 364a8475dd..c41d60f027 100644 --- a/server/export_test.go +++ b/server/export_test.go @@ -136,7 +136,7 @@ func setupApp(t *testing.T, tempDir string) (*simapp.SimApp, context.Context, *t serverCtx.Config.RootDir = tempDir clientCtx := client.Context{}.WithCodec(app.AppCodec()) - genDoc := newDefaultGenesisDoc(encCfg.Marshaler) + genDoc := newDefaultGenesisDoc(encCfg.Codec) require.NoError(t, saveGenesisFile(genDoc, serverCtx.Config.GenesisFile())) app.InitChain( diff --git a/server/util_test.go b/server/util_test.go index b83531f562..c027925c94 100644 --- a/server/util_test.go +++ b/server/util_test.go @@ -18,8 +18,8 @@ import ( "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/server/config" "github.com/cosmos/cosmos-sdk/simapp" - genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" ) var cancelledInPreRun = errors.New("Cancelled in prerun") @@ -414,7 +414,7 @@ func TestEmptyMinGasPrices(t *testing.T) { encCfg := simapp.MakeTestEncodingConfig() // Run InitCmd to create necessary config files. - clientCtx := client.Context{}.WithHomeDir(tempDir).WithJSONCodec(encCfg.Marshaler) + clientCtx := client.Context{}.WithHomeDir(tempDir).WithCodec(encCfg.Codec) serverCtx := server.NewDefaultContext() ctx := context.WithValue(context.Background(), server.ServerContextKey, serverCtx) ctx = context.WithValue(ctx, client.ClientContextKey, &clientCtx) diff --git a/simapp/app.go b/simapp/app.go index 88b23865c0..d36bf9de2c 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -193,7 +193,7 @@ func NewSimApp( appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), ) *SimApp { - appCodec := encodingConfig.Marshaler + appCodec := encodingConfig.Codec legacyAmino := encodingConfig.Amino interfaceRegistry := encodingConfig.InterfaceRegistry diff --git a/simapp/app_test.go b/simapp/app_test.go index 56c6dc1485..c84c990030 100644 --- a/simapp/app_test.go +++ b/simapp/app_test.go @@ -48,7 +48,7 @@ func TestSimAppExportAndBlockedAddrs(t *testing.T) { ) } - genesisState := NewDefaultGenesisState(encCfg.Marshaler) + genesisState := NewDefaultGenesisState(encCfg.Codec) stateBytes, err := json.MarshalIndent(genesisState, "", " ") require.NoError(t, err) @@ -243,7 +243,7 @@ func TestUpgradeStateOnGenesis(t *testing.T) { encCfg := MakeTestEncodingConfig() db := dbm.NewMemDB() app := NewSimApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, encCfg, EmptyAppOptions{}) - genesisState := NewDefaultGenesisState(encCfg.Marshaler) + genesisState := NewDefaultGenesisState(encCfg.Codec) stateBytes, err := json.MarshalIndent(genesisState, "", " ") require.NoError(t, err) diff --git a/simapp/params/encoding.go b/simapp/params/encoding.go index 2cd16263a8..8ff9ea04b3 100644 --- a/simapp/params/encoding.go +++ b/simapp/params/encoding.go @@ -10,8 +10,7 @@ import ( // This is provided for compatibility between protobuf and amino implementations. type EncodingConfig struct { InterfaceRegistry types.InterfaceRegistry - // NOTE: this field will be renamed to Codec - Marshaler codec.Codec - TxConfig client.TxConfig - Amino *codec.LegacyAmino + Codec codec.Codec + TxConfig client.TxConfig + Amino *codec.LegacyAmino } diff --git a/simapp/params/proto.go b/simapp/params/proto.go index 04aa524b90..c3975c669f 100644 --- a/simapp/params/proto.go +++ b/simapp/params/proto.go @@ -15,12 +15,12 @@ import ( func MakeTestEncodingConfig() EncodingConfig { cdc := codec.NewLegacyAmino() interfaceRegistry := types.NewInterfaceRegistry() - marshaler := codec.NewProtoCodec(interfaceRegistry) + codec := codec.NewProtoCodec(interfaceRegistry) return EncodingConfig{ InterfaceRegistry: interfaceRegistry, - Marshaler: marshaler, - TxConfig: tx.NewTxConfig(marshaler, tx.DefaultSignModes), + Codec: codec, + TxConfig: tx.NewTxConfig(codec, tx.DefaultSignModes), Amino: cdc, } } diff --git a/simapp/simd/cmd/genaccounts_test.go b/simapp/simd/cmd/genaccounts_test.go index 2802cd4af8..b4ce4b7671 100644 --- a/simapp/simd/cmd/genaccounts_test.go +++ b/simapp/simd/cmd/genaccounts_test.go @@ -58,7 +58,7 @@ func TestAddGenesisAccountCmd(t *testing.T) { cfg, err := genutiltest.CreateDefaultTendermintConfig(home) require.NoError(t, err) - appCodec := simapp.MakeTestEncodingConfig().Marshaler + appCodec := simapp.MakeTestEncodingConfig().Codec err = genutiltest.ExecInitCmd(testMbm, home, appCodec) require.NoError(t, err) diff --git a/simapp/simd/cmd/root.go b/simapp/simd/cmd/root.go index 62215c865b..a5bdbced59 100644 --- a/simapp/simd/cmd/root.go +++ b/simapp/simd/cmd/root.go @@ -39,7 +39,7 @@ import ( func NewRootCmd() (*cobra.Command, params.EncodingConfig) { encodingConfig := simapp.MakeTestEncodingConfig() initClientCtx := client.Context{}. - WithCodec(encodingConfig.Marshaler). + WithCodec(encodingConfig.Codec). WithInterfaceRegistry(encodingConfig.InterfaceRegistry). WithTxConfig(encodingConfig.TxConfig). WithLegacyAmino(encodingConfig.Amino). @@ -163,7 +163,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { ) // add rosetta - rootCmd.AddCommand(server.RosettaCommand(encodingConfig.InterfaceRegistry, encodingConfig.Marshaler)) + rootCmd.AddCommand(server.RosettaCommand(encodingConfig.InterfaceRegistry, encodingConfig.Codec)) } func addModuleInitFlags(startCmd *cobra.Command) { diff --git a/simapp/simd/cmd/testnet_test.go b/simapp/simd/cmd/testnet_test.go index fae1323407..eafc3d4cdd 100644 --- a/simapp/simd/cmd/testnet_test.go +++ b/simapp/simd/cmd/testnet_test.go @@ -24,12 +24,12 @@ func Test_TestnetCmd(t *testing.T) { cfg, err := genutiltest.CreateDefaultTendermintConfig(home) require.NoError(t, err) - err = genutiltest.ExecInitCmd(simapp.ModuleBasics, home, encodingConfig.Marshaler) + err = genutiltest.ExecInitCmd(simapp.ModuleBasics, home, encodingConfig.Codec) require.NoError(t, err) serverCtx := server.NewContext(viper.New(), cfg, logger) clientCtx := client.Context{}. - WithCodec(encodingConfig.Marshaler). + WithCodec(encodingConfig.Codec). WithHomeDir(home). WithTxConfig(encodingConfig.TxConfig) @@ -45,6 +45,6 @@ func Test_TestnetCmd(t *testing.T) { appState, _, err := genutiltypes.GenesisStateFromGenFile(genFile) require.NoError(t, err) - bankGenState := banktypes.GetGenesisStateFromAppState(encodingConfig.Marshaler, appState) + bankGenState := banktypes.GetGenesisStateFromAppState(encodingConfig.Codec, appState) require.NotEmpty(t, bankGenState.Supply.String()) } diff --git a/simapp/test_helpers.go b/simapp/test_helpers.go index 9b50236e9d..8d7548e102 100644 --- a/simapp/test_helpers.go +++ b/simapp/test_helpers.go @@ -55,7 +55,7 @@ func setup(withGenesis bool, invCheckPeriod uint) (*SimApp, GenesisState) { encCdc := MakeTestEncodingConfig() app := NewSimApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, invCheckPeriod, encCdc, EmptyAppOptions{}) if withGenesis { - return app, NewDefaultGenesisState(encCdc.Marshaler) + return app, NewDefaultGenesisState(encCdc.Codec) } return app, GenesisState{} } diff --git a/testutil/network/network.go b/testutil/network/network.go index 7087e4bd9f..738f0afd96 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -103,13 +103,13 @@ func DefaultConfig() Config { encCfg := simapp.MakeTestEncodingConfig() return Config{ - Codec: encCfg.Marshaler, + Codec: encCfg.Codec, TxConfig: encCfg.TxConfig, LegacyAmino: encCfg.Amino, InterfaceRegistry: encCfg.InterfaceRegistry, AccountRetriever: authtypes.AccountRetriever{}, AppConstructor: NewAppConstructor(encCfg), - GenesisState: simapp.ModuleBasics.DefaultGenesis(encCfg.Marshaler), + GenesisState: simapp.ModuleBasics.DefaultGenesis(encCfg.Codec), TimeoutCommit: 2 * time.Second, ChainID: "chain-" + tmrand.NewRand().Str(6), NumValidators: 4, diff --git a/x/auth/client/cli/encode_test.go b/x/auth/client/cli/encode_test.go index ed3566aaf2..a0b5a7427e 100644 --- a/x/auth/client/cli/encode_test.go +++ b/x/auth/client/cli/encode_test.go @@ -39,7 +39,7 @@ func TestGetCommandEncode(t *testing.T) { ctx := context.Background() clientCtx := client.Context{}. WithTxConfig(encodingConfig.TxConfig). - WithCodec(encodingConfig.Marshaler) + WithCodec(encodingConfig.Codec) ctx = context.WithValue(ctx, client.ClientContextKey, &clientCtx) cmd.SetArgs([]string{txFileName}) @@ -52,7 +52,7 @@ func TestGetCommandDecode(t *testing.T) { clientCtx := client.Context{}. WithTxConfig(encodingConfig.TxConfig). - WithCodec(encodingConfig.Marshaler) + WithCodec(encodingConfig.Codec) cmd := GetDecodeCommand() _ = testutil.ApplyMockIODiscardOutErr(cmd) diff --git a/x/auth/keeper/keeper_test.go b/x/auth/keeper/keeper_test.go index 16cf53a253..7b9cd99c3c 100644 --- a/x/auth/keeper/keeper_test.go +++ b/x/auth/keeper/keeper_test.go @@ -129,7 +129,7 @@ func TestSupply_ValidatePermissions(t *testing.T) { maccPerms[multiPerm] = []string{types.Burner, types.Minter, types.Staking} maccPerms[randomPerm] = []string{"random"} - cdc := simapp.MakeTestEncodingConfig().Marshaler + cdc := simapp.MakeTestEncodingConfig().Codec keeper := keeper.NewAccountKeeper( cdc, app.GetKey(types.StoreKey), app.GetSubspace(types.ModuleName), types.ProtoBaseAccount, maccPerms, diff --git a/x/auth/legacy/v040/migrate_test.go b/x/auth/legacy/v040/migrate_test.go index 9b09d6e18a..d666337b18 100644 --- a/x/auth/legacy/v040/migrate_test.go +++ b/x/auth/legacy/v040/migrate_test.go @@ -22,7 +22,7 @@ func TestMigrate(t *testing.T) { WithInterfaceRegistry(encodingConfig.InterfaceRegistry). WithTxConfig(encodingConfig.TxConfig). WithLegacyAmino(encodingConfig.Amino). - WithJSONCodec(encodingConfig.Marshaler) + WithCodec(encodingConfig.Codec) coins := sdk.NewCoins(sdk.NewInt64Coin("stake", 50)) diff --git a/x/auth/legacy/v043/store_test.go b/x/auth/legacy/v043/store_test.go index 3daa2d52fc..bb2cdfdee4 100644 --- a/x/auth/legacy/v043/store_test.go +++ b/x/auth/legacy/v043/store_test.go @@ -661,7 +661,7 @@ func createValidator(t *testing.T, ctx sdk.Context, app *simapp.SimApp, powers i addrs := simapp.AddTestAddrsIncremental(app, ctx, 1, valTokens) valAddrs := simapp.ConvertAddrsToValAddrs(addrs) pks := simapp.CreateTestPubKeys(1) - cdc := simapp.MakeTestEncodingConfig().Marshaler + cdc := simapp.MakeTestEncodingConfig().Codec app.StakingKeeper = stakingkeeper.NewKeeper( cdc, diff --git a/x/auth/simulation/decoder_test.go b/x/auth/simulation/decoder_test.go index 9e21df6e57..ee78c511dd 100644 --- a/x/auth/simulation/decoder_test.go +++ b/x/auth/simulation/decoder_test.go @@ -22,7 +22,7 @@ var ( func TestDecodeStore(t *testing.T) { app := simapp.Setup(false) - cdc := simapp.MakeTestEncodingConfig().Marshaler + cdc := simapp.MakeTestEncodingConfig().Codec acc := types.NewBaseAccountWithAddress(delAddr1) dec := simulation.NewDecodeStore(app.AccountKeeper) diff --git a/x/auth/types/common_test.go b/x/auth/types/common_test.go index 8588778994..6c045029fd 100644 --- a/x/auth/types/common_test.go +++ b/x/auth/types/common_test.go @@ -7,5 +7,5 @@ import ( var ( app = simapp.Setup(false) ecdc = simapp.MakeTestEncodingConfig() - appCodec, legacyAmino = ecdc.Marshaler, ecdc.Amino + appCodec, legacyAmino = ecdc.Codec, ecdc.Amino ) diff --git a/x/authz/simulation/decoder_test.go b/x/authz/simulation/decoder_test.go index cfda286a83..4851b6ec2c 100644 --- a/x/authz/simulation/decoder_test.go +++ b/x/authz/simulation/decoder_test.go @@ -17,7 +17,7 @@ import ( ) func TestDecodeStore(t *testing.T) { - cdc := simapp.MakeTestEncodingConfig().Marshaler + cdc := simapp.MakeTestEncodingConfig().Codec dec := simulation.NewDecodeStore(cdc) grant, _ := authz.NewGrant(banktypes.NewSendAuthorization(sdk.NewCoins(sdk.NewInt64Coin("foo", 123))), time.Now().UTC()) diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index 5e67204d34..d7f840f9e1 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -74,7 +74,7 @@ type IntegrationTestSuite struct { func (suite *IntegrationTestSuite) initKeepersWithmAccPerms(blockedAddrs map[string]bool) (authkeeper.AccountKeeper, keeper.BaseKeeper) { app := suite.app maccPerms := simapp.GetMaccPerms() - appCodec := simapp.MakeTestEncodingConfig().Marshaler + appCodec := simapp.MakeTestEncodingConfig().Codec maccPerms[holder] = nil maccPerms[authtypes.Burner] = []string{authtypes.Burner} diff --git a/x/bank/legacy/v040/migrate_test.go b/x/bank/legacy/v040/migrate_test.go index e30299ff92..b00af1af2c 100644 --- a/x/bank/legacy/v040/migrate_test.go +++ b/x/bank/legacy/v040/migrate_test.go @@ -21,7 +21,7 @@ func TestMigrate(t *testing.T) { WithInterfaceRegistry(encodingConfig.InterfaceRegistry). WithTxConfig(encodingConfig.TxConfig). WithLegacyAmino(encodingConfig.Amino). - WithJSONCodec(encodingConfig.Marshaler) + WithCodec(encodingConfig.Codec) coins := sdk.NewCoins(sdk.NewInt64Coin("stake", 50)) addr1, _ := sdk.AccAddressFromBech32("cosmos1xxkueklal9vejv9unqu80w9vptyepfa95pd53u") diff --git a/x/bank/legacy/v043/store_test.go b/x/bank/legacy/v043/store_test.go index 5f61e33dff..3473039a8d 100644 --- a/x/bank/legacy/v043/store_test.go +++ b/x/bank/legacy/v043/store_test.go @@ -27,12 +27,12 @@ func TestSupplyMigration(t *testing.T) { // Old supply was stored as a single blob under the `SupplyKey`. var oldSupply v040bank.SupplyI oldSupply = &types.Supply{Total: sdk.NewCoins(oldFooCoin, oldBarCoin)} - oldSupplyBz, err := encCfg.Marshaler.MarshalInterface(oldSupply) + oldSupplyBz, err := encCfg.Codec.MarshalInterface(oldSupply) require.NoError(t, err) store.Set(v040bank.SupplyKey, oldSupplyBz) // Run migration. - err = v043bank.MigrateStore(ctx, bankKey, encCfg.Marshaler) + err = v043bank.MigrateStore(ctx, bankKey, encCfg.Codec) require.NoError(t, err) // New supply is indexed by denom. @@ -72,7 +72,7 @@ func TestBalanceKeysMigration(t *testing.T) { oldKey := append(append(v040bank.BalancesPrefix, addr...), denom...) store.Set(oldKey, value) - err := v043bank.MigrateStore(ctx, bankKey, encCfg.Marshaler) + err := v043bank.MigrateStore(ctx, bankKey, encCfg.Codec) require.NoError(t, err) newKey := append(types.CreateAccountBalancesPrefix(addr), denom...) diff --git a/x/capability/simulation/decoder_test.go b/x/capability/simulation/decoder_test.go index a18bcd5611..093cf5f2da 100644 --- a/x/capability/simulation/decoder_test.go +++ b/x/capability/simulation/decoder_test.go @@ -14,7 +14,7 @@ import ( ) func TestDecodeStore(t *testing.T) { - cdc := simapp.MakeTestEncodingConfig().Marshaler + cdc := simapp.MakeTestEncodingConfig().Codec dec := simulation.NewDecodeStore(cdc) capOwners := types.CapabilityOwners{ diff --git a/x/distribution/client/cli/tx_test.go b/x/distribution/client/cli/tx_test.go index 36a946e7cc..7176c6bf95 100644 --- a/x/distribution/client/cli/tx_test.go +++ b/x/distribution/client/cli/tx_test.go @@ -77,7 +77,7 @@ func TestParseProposal(t *testing.T) { } `) - proposal, err := ParseCommunityPoolSpendProposalWithDeposit(encodingConfig.Marshaler, okJSON.Name()) + proposal, err := ParseCommunityPoolSpendProposalWithDeposit(encodingConfig.Codec, okJSON.Name()) require.NoError(t, err) require.Equal(t, "Community Pool Spend", proposal.Title) diff --git a/x/distribution/simulation/decoder_test.go b/x/distribution/simulation/decoder_test.go index 69bb6b3b77..01e986fe53 100644 --- a/x/distribution/simulation/decoder_test.go +++ b/x/distribution/simulation/decoder_test.go @@ -22,7 +22,7 @@ var ( ) func TestDecodeDistributionStore(t *testing.T) { - cdc := simapp.MakeTestEncodingConfig().Marshaler + cdc := simapp.MakeTestEncodingConfig().Codec dec := simulation.NewDecodeStore(cdc) decCoins := sdk.DecCoins{sdk.NewDecCoinFromDec(sdk.DefaultBondDenom, sdk.OneDec())} diff --git a/x/evidence/keeper/querier_test.go b/x/evidence/keeper/querier_test.go index 40a9f94e5f..709340d241 100644 --- a/x/evidence/keeper/querier_test.go +++ b/x/evidence/keeper/querier_test.go @@ -37,7 +37,7 @@ func (suite *KeeperTestSuite) TestQuerier_QueryEvidence_Existing() { func (suite *KeeperTestSuite) TestQuerier_QueryEvidence_NonExisting() { ctx := suite.ctx.WithIsCheckTx(false) - cdc := simapp.MakeTestEncodingConfig().Marshaler + cdc := simapp.MakeTestEncodingConfig().Codec numEvidence := 100 suite.populateEvidence(ctx, numEvidence) diff --git a/x/evidence/legacy/v040/migrate_test.go b/x/evidence/legacy/v040/migrate_test.go index 43d3d9db7e..0244643922 100644 --- a/x/evidence/legacy/v040/migrate_test.go +++ b/x/evidence/legacy/v040/migrate_test.go @@ -18,7 +18,7 @@ func TestMigrate(t *testing.T) { WithInterfaceRegistry(encodingConfig.InterfaceRegistry). WithTxConfig(encodingConfig.TxConfig). WithLegacyAmino(encodingConfig.Amino). - WithJSONCodec(encodingConfig.Marshaler) + WithCodec(encodingConfig.Codec) addr1, _ := sdk.AccAddressFromBech32("cosmos1xxkueklal9vejv9unqu80w9vptyepfa95pd53u") diff --git a/x/feegrant/simulation/decoder_test.go b/x/feegrant/simulation/decoder_test.go index 57ed0dfa1a..bb6fc789d7 100644 --- a/x/feegrant/simulation/decoder_test.go +++ b/x/feegrant/simulation/decoder_test.go @@ -22,7 +22,7 @@ var ( ) func TestDecodeStore(t *testing.T) { - cdc := simapp.MakeTestEncodingConfig().Marshaler + cdc := simapp.MakeTestEncodingConfig().Codec dec := simulation.NewDecodeStore(cdc) grant, err := feegrant.NewGrant(granterAddr, granteeAddr, &feegrant.BasicAllowance{ diff --git a/x/genutil/gentx_test.go b/x/genutil/gentx_test.go index ac9ef6de3f..65fd5194d9 100644 --- a/x/genutil/gentx_test.go +++ b/x/genutil/gentx_test.go @@ -111,7 +111,7 @@ func (suite *GenTxTestSuite) TestSetGenTxsInAppGenesisState() { for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { suite.SetupTest() - cdc := suite.encodingConfig.Marshaler + cdc := suite.encodingConfig.Codec txJSONEncoder := suite.encodingConfig.TxConfig.TxJSONEncoder() tc.malleate() @@ -178,7 +178,7 @@ func (suite *GenTxTestSuite) TestValidateAccountInGenesis() { for _, tc := range testCases { suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { suite.SetupTest() - cdc := suite.encodingConfig.Marshaler + cdc := suite.encodingConfig.Codec suite.app.StakingKeeper.SetParams(suite.ctx, stakingtypes.DefaultParams()) stakingGenesisState := staking.ExportGenesis(suite.ctx, suite.app.StakingKeeper) diff --git a/x/gov/keeper/common_test.go b/x/gov/keeper/common_test.go index e39ca9c703..89da4e0607 100644 --- a/x/gov/keeper/common_test.go +++ b/x/gov/keeper/common_test.go @@ -21,7 +21,7 @@ func createValidators(t *testing.T, ctx sdk.Context, app *simapp.SimApp, powers addrs := simapp.AddTestAddrsIncremental(app, ctx, 5, sdk.NewInt(30000000)) valAddrs := simapp.ConvertAddrsToValAddrs(addrs) pks := simapp.CreateTestPubKeys(5) - cdc := simapp.MakeTestEncodingConfig().Marshaler + cdc := simapp.MakeTestEncodingConfig().Codec app.StakingKeeper = stakingkeeper.NewKeeper( cdc, diff --git a/x/gov/legacy/v040/migrate_test.go b/x/gov/legacy/v040/migrate_test.go index 664696bf29..2d399f38be 100644 --- a/x/gov/legacy/v040/migrate_test.go +++ b/x/gov/legacy/v040/migrate_test.go @@ -22,7 +22,7 @@ func TestMigrate(t *testing.T) { WithInterfaceRegistry(encodingConfig.InterfaceRegistry). WithTxConfig(encodingConfig.TxConfig). WithLegacyAmino(encodingConfig.Amino). - WithJSONCodec(encodingConfig.Marshaler) + WithCodec(encodingConfig.Codec) recipient, err := sdk.AccAddressFromBech32("cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh") require.NoError(t, err) diff --git a/x/gov/legacy/v043/json_test.go b/x/gov/legacy/v043/json_test.go index d9f0457746..4fa05b9413 100644 --- a/x/gov/legacy/v043/json_test.go +++ b/x/gov/legacy/v043/json_test.go @@ -19,7 +19,7 @@ func TestMigrateJSON(t *testing.T) { clientCtx := client.Context{}. WithInterfaceRegistry(encodingConfig.InterfaceRegistry). WithTxConfig(encodingConfig.TxConfig). - WithCodec(encodingConfig.Marshaler) + WithCodec(encodingConfig.Codec) voter, err := sdk.AccAddressFromBech32("cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh") require.NoError(t, err) diff --git a/x/gov/legacy/v043/store_test.go b/x/gov/legacy/v043/store_test.go index b65b126b03..3501395010 100644 --- a/x/gov/legacy/v043/store_test.go +++ b/x/gov/legacy/v043/store_test.go @@ -17,7 +17,7 @@ import ( ) func TestMigrateStore(t *testing.T) { - cdc := simapp.MakeTestEncodingConfig().Marshaler + cdc := simapp.MakeTestEncodingConfig().Codec govKey := sdk.NewKVStoreKey("gov") ctx := testutil.DefaultContext(govKey, sdk.NewTransientStoreKey("transient_test")) store := ctx.KVStore(govKey) diff --git a/x/gov/simulation/decoder_test.go b/x/gov/simulation/decoder_test.go index 188fe9e540..44752440f0 100644 --- a/x/gov/simulation/decoder_test.go +++ b/x/gov/simulation/decoder_test.go @@ -22,7 +22,7 @@ var ( ) func TestDecodeStore(t *testing.T) { - cdc := simapp.MakeTestEncodingConfig().Marshaler + cdc := simapp.MakeTestEncodingConfig().Codec dec := simulation.NewDecodeStore(cdc) endTime := time.Now().UTC() diff --git a/x/mint/simulation/decoder_test.go b/x/mint/simulation/decoder_test.go index 43a8cfbd42..9ee8315f00 100644 --- a/x/mint/simulation/decoder_test.go +++ b/x/mint/simulation/decoder_test.go @@ -14,7 +14,7 @@ import ( ) func TestDecodeStore(t *testing.T) { - cdc := simapp.MakeTestEncodingConfig().Marshaler + cdc := simapp.MakeTestEncodingConfig().Codec dec := simulation.NewDecodeStore(cdc) minter := types.NewMinter(sdk.OneDec(), sdk.NewDec(15)) diff --git a/x/params/keeper/common_test.go b/x/params/keeper/common_test.go index 3ba4441735..e5bebaf09b 100644 --- a/x/params/keeper/common_test.go +++ b/x/params/keeper/common_test.go @@ -9,7 +9,7 @@ import ( ) func testComponents() (*codec.LegacyAmino, sdk.Context, sdk.StoreKey, sdk.StoreKey, paramskeeper.Keeper) { - marshaler := simapp.MakeTestEncodingConfig().Marshaler + marshaler := simapp.MakeTestEncodingConfig().Codec legacyAmino := createTestCodec() mkey := sdk.NewKVStoreKey("test") tkey := sdk.NewTransientStoreKey("transient_test") diff --git a/x/params/types/subspace_test.go b/x/params/types/subspace_test.go index a347a5f542..664c70df18 100644 --- a/x/params/types/subspace_test.go +++ b/x/params/types/subspace_test.go @@ -35,9 +35,9 @@ func (suite *SubspaceTestSuite) SetupTest() { suite.NoError(ms.LoadLatestVersion()) encCfg := simapp.MakeTestEncodingConfig() - ss := types.NewSubspace(encCfg.Marshaler, encCfg.Amino, key, tkey, "testsubspace") + ss := types.NewSubspace(encCfg.Codec, encCfg.Amino, key, tkey, "testsubspace") - suite.cdc = encCfg.Marshaler + suite.cdc = encCfg.Codec suite.amino = encCfg.Amino suite.ctx = sdk.NewContext(ms, tmproto.Header{}, false, log.NewNopLogger()) suite.ss = ss.WithKeyTable(paramKeyTable()) diff --git a/x/slashing/legacy/v040/migrate_test.go b/x/slashing/legacy/v040/migrate_test.go index f11d2e9d26..03186634c0 100644 --- a/x/slashing/legacy/v040/migrate_test.go +++ b/x/slashing/legacy/v040/migrate_test.go @@ -19,7 +19,7 @@ func TestMigrate(t *testing.T) { WithInterfaceRegistry(encodingConfig.InterfaceRegistry). WithTxConfig(encodingConfig.TxConfig). WithLegacyAmino(encodingConfig.Amino). - WithJSONCodec(encodingConfig.Marshaler) + WithCodec(encodingConfig.Codec) addr1, err := sdk.ConsAddressFromBech32("cosmosvalcons104cjmxkrg8y8lmrp25de02e4zf00zle4mzs685") require.NoError(t, err) diff --git a/x/slashing/simulation/decoder_test.go b/x/slashing/simulation/decoder_test.go index 94b9f5a1c8..883b3874d2 100644 --- a/x/slashing/simulation/decoder_test.go +++ b/x/slashing/simulation/decoder_test.go @@ -25,7 +25,7 @@ var ( ) func TestDecodeStore(t *testing.T) { - cdc := simapp.MakeTestEncodingConfig().Marshaler + cdc := simapp.MakeTestEncodingConfig().Codec dec := simulation.NewDecodeStore(cdc) info := types.NewValidatorSigningInfo(consAddr1, 0, 1, time.Now().UTC(), false, 0) diff --git a/x/staking/keeper/grpc_query_test.go b/x/staking/keeper/grpc_query_test.go index ba43269e2e..1b06f85886 100644 --- a/x/staking/keeper/grpc_query_test.go +++ b/x/staking/keeper/grpc_query_test.go @@ -773,7 +773,7 @@ func createValidators(t *testing.T, ctx sdk.Context, app *simapp.SimApp, powers addrs := simapp.AddTestAddrsIncremental(app, ctx, 5, app.StakingKeeper.TokensFromConsensusPower(ctx, 300)) valAddrs := simapp.ConvertAddrsToValAddrs(addrs) pks := simapp.CreateTestPubKeys(5) - cdc := simapp.MakeTestEncodingConfig().Marshaler + cdc := simapp.MakeTestEncodingConfig().Codec app.StakingKeeper = keeper.NewKeeper( cdc, app.GetKey(types.StoreKey), diff --git a/x/staking/legacy/v040/migrate_test.go b/x/staking/legacy/v040/migrate_test.go index af409dde26..d336d4dd39 100644 --- a/x/staking/legacy/v040/migrate_test.go +++ b/x/staking/legacy/v040/migrate_test.go @@ -20,7 +20,7 @@ func TestMigrate(t *testing.T) { WithInterfaceRegistry(encodingConfig.InterfaceRegistry). WithTxConfig(encodingConfig.TxConfig). WithLegacyAmino(encodingConfig.Amino). - WithJSONCodec(encodingConfig.Marshaler) + WithCodec(encodingConfig.Codec) consPubKey := ed25519.GenPrivKeyFromSecret([]byte("val0")).PubKey() stakingGenState := v038staking.GenesisState{ diff --git a/x/staking/simulation/decoder_test.go b/x/staking/simulation/decoder_test.go index 6584df24f5..3d7546369d 100644 --- a/x/staking/simulation/decoder_test.go +++ b/x/staking/simulation/decoder_test.go @@ -32,7 +32,7 @@ func makeTestCodec() (cdc *codec.LegacyAmino) { } func TestDecodeStore(t *testing.T) { - cdc := simapp.MakeTestEncodingConfig().Marshaler + cdc := simapp.MakeTestEncodingConfig().Codec dec := simulation.NewDecodeStore(cdc) bondTime := time.Now().UTC() From e0ccb763012876712c2dc6c43d0dc4cc0d3876ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Jul 2021 17:09:35 +0000 Subject: [PATCH 45/50] build(deps): bump prismjs from 1.23.0 to 1.24.0 in /docs (#9600) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [prismjs](https://github.com/PrismJS/prism) from 1.23.0 to 1.24.0.
Release notes

Sourced from prismjs's releases.

v1.24.0

Release 1.24.0

Changelog

Sourced from prismjs's changelog.

1.24.0 (2021-06-27)

New components

Updated components

... (truncated)

Commits
Maintainer changes

This version was pushed to npm by rundevelopment, a new releaser for prismjs since your current version.


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=prismjs&package-manager=npm_and_yarn&previous-version=1.23.0&new-version=1.24.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/cosmos/cosmos-sdk/network/alerts).
--- docs/package-lock.json | 47 +++--------------------------------------- 1 file changed, 3 insertions(+), 44 deletions(-) diff --git a/docs/package-lock.json b/docs/package-lock.json index eced509f49..eb556f3afb 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -2914,17 +2914,6 @@ "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==" }, - "clipboard": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.8.tgz", - "integrity": "sha512-Y6WO0unAIQp5bLmk1zdThRhgJt/x3ks6f30s3oE3H1mgIEU33XyQjEf8gsf6DxC7NPX8Y1SsNWjUjL/ywLnnbQ==", - "optional": true, - "requires": { - "good-listener": "^1.2.2", - "select": "^1.1.2", - "tiny-emitter": "^2.0.0" - } - }, "clipboard-copy": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/clipboard-copy/-/clipboard-copy-3.2.0.tgz", @@ -3830,12 +3819,6 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, - "delegate": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz", - "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==", - "optional": true - }, "depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -4818,15 +4801,6 @@ "slash": "^2.0.0" } }, - "good-listener": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz", - "integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=", - "optional": true, - "requires": { - "delegate": "^3.1.2" - } - }, "got": { "version": "9.6.0", "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", @@ -7499,12 +7473,9 @@ "integrity": "sha512-28iF6xPQrP8Oa6uxE6a1biz+lWeTOAPKggvjB8HAs6nVMKZwf5bG++632Dx614hIWgUPkgivRfG+a8uAXGTIbA==" }, "prismjs": { - "version": "1.23.0", - "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.23.0.tgz", - "integrity": "sha512-c29LVsqOaLbBHuIbsTxaKENh1N2EQBOHaWv7gkHN4dgRbxSREqDnDbtFJYdpPauS4YCplMSNCABQ6Eeor69bAA==", - "requires": { - "clipboard": "^2.0.0" - } + "version": "1.24.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.24.0.tgz", + "integrity": "sha512-SqV5GRsNqnzCL8k5dfAjCNhUrF3pR0A9lTDSCUZeh/LIshheXJEaP0hwLz2t4XHivd2J/v2HR+gRnigzeKe3cQ==" }, "process": { "version": "0.11.10", @@ -8263,12 +8234,6 @@ "kind-of": "^6.0.0" } }, - "select": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz", - "integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=", - "optional": true - }, "select-hose": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", @@ -9286,12 +9251,6 @@ "resolved": "https://registry.npmjs.org/tiny-cookie/-/tiny-cookie-2.3.2.tgz", "integrity": "sha512-qbymkVh+6+Gc/c9sqnvbG+dOHH6bschjphK3SHgIfT6h/t+63GBL37JXNoXEc6u/+BcwU6XmaWUuf19ouLVtPg==" }, - "tiny-emitter": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", - "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==", - "optional": true - }, "to-arraybuffer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", From e109d8afc2c91c5ee5c449452be391f17f6e06ca Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Thu, 1 Jul 2021 20:40:07 +0200 Subject: [PATCH 46/50] feat(bank): update bank.Metadata - add URI and URIHash (#9618) ## Description Closes: #9502 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [x] included comments for [documenting Go code](https://blog.golang.org/godoc) - [x] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- CHANGELOG.md | 1 + docs/core/proto-docs.md | 10 +- proto/cosmos/bank/v1beta1/bank.proto | 5 + x/bank/types/bank.pb.go | 185 +++++++++++++++++++++------ 4 files changed, 162 insertions(+), 39 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9611cd3531..33fd7a9009 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Features * [\#9533](https://github.com/cosmos/cosmos-sdk/pull/9533) Added a new gRPC method, `DenomOwners`, in `x/bank` to query for all account holders of a specific denomination. +* (bank) [\#9618](https://github.com/cosmos/cosmos-sdk/pull/9618) Update bank.Metadata: add URI and URIHash attributes. ### API Breaking Changes diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 87e6a2e623..0794c8c0f8 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -1567,6 +1567,8 @@ a basic token. | `display` | [string](#string) | | display indicates the suggested denom that should be displayed in clients. | | `name` | [string](#string) | | name defines the name of the token (eg: Cosmos Atom) | | `symbol` | [string](#string) | | symbol is the token symbol usually shown on exchanges (eg: ATOM). This can be the same as the display. | +| `uri` | [string](#string) | | URI to a document (on or off-chain) that contains additional information. Optional. | +| `uri_hash` | [string](#string) | | URIHash is a sha256 hash of a document pointed by URI. It's used to verify that the document didn't change. Optional. | @@ -1709,16 +1711,21 @@ GenesisState defines the bank module's genesis state. ### DenomOwner - DenomOwner defines structure representing an account that owns or holds a particular denominated token. It contains the account address and account balance of the denominated token. + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `address` | [string](#string) | | address defines the address that owns a particular denomination. | | `balance` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | balance is the balance of the denominated coin for an account. | + + + + + ### QueryAllBalancesRequest @@ -8310,3 +8317,4 @@ still be used for delegating and for governance votes even while locked. | bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | | string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | | bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | + diff --git a/proto/cosmos/bank/v1beta1/bank.proto b/proto/cosmos/bank/v1beta1/bank.proto index eb843b2cb6..ad55835f72 100644 --- a/proto/cosmos/bank/v1beta1/bank.proto +++ b/proto/cosmos/bank/v1beta1/bank.proto @@ -89,4 +89,9 @@ message Metadata { // symbol is the token symbol usually shown on exchanges (eg: ATOM). This can // be the same as the display. string symbol = 6; + // URI to a document (on or off-chain) that contains additional information. Optional. + string uri = 7 [(gogoproto.customname) = "URI"]; + // URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + // the document didn't change. Optional. + string uri_hash = 8 [(gogoproto.customname) = "URIHash"]; } diff --git a/x/bank/types/bank.pb.go b/x/bank/types/bank.pb.go index f190a457b2..ff39b06c53 100644 --- a/x/bank/types/bank.pb.go +++ b/x/bank/types/bank.pb.go @@ -336,6 +336,11 @@ type Metadata struct { // symbol is the token symbol usually shown on exchanges (eg: ATOM). This can // be the same as the display. Symbol string `protobuf:"bytes,6,opt,name=symbol,proto3" json:"symbol,omitempty"` + // URI to a document (on or off-chain) that contains additional information. Optional. + URI string `protobuf:"bytes,7,opt,name=uri,proto3" json:"uri,omitempty"` + // URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + // the document didn't change. Optional. + URIHash string `protobuf:"bytes,8,opt,name=uri_hash,json=uriHash,proto3" json:"uri_hash,omitempty"` } func (m *Metadata) Reset() { *m = Metadata{} } @@ -413,6 +418,20 @@ func (m *Metadata) GetSymbol() string { return "" } +func (m *Metadata) GetURI() string { + if m != nil { + return m.URI + } + return "" +} + +func (m *Metadata) GetURIHash() string { + if m != nil { + return m.URIHash + } + return "" +} + func init() { proto.RegisterType((*Params)(nil), "cosmos.bank.v1beta1.Params") proto.RegisterType((*SendEnabled)(nil), "cosmos.bank.v1beta1.SendEnabled") @@ -426,44 +445,48 @@ func init() { func init() { proto.RegisterFile("cosmos/bank/v1beta1/bank.proto", fileDescriptor_dd052eee12edf988) } var fileDescriptor_dd052eee12edf988 = []byte{ - // 592 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0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1b, 0xa7, - 0x13, 0xdb, 0xf8, 0x36, 0xb1, 0x8d, 0x17, 0x9b, 0x7f, 0xe3, 0xbb, 0x7a, 0xbc, 0xd0, 0x54, 0x7f, - 0x33, 0xb7, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0xcc, 0x03, 0xbf, 0xe9, 0xee, 0x04, 0x00, 0x00, + // 642 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x54, 0xbf, 0x6e, 0x13, 0x4f, + 0x10, 0xf6, 0xc6, 0xb1, 0x7d, 0x59, 0xff, 0x7e, 0xcd, 0x12, 0xa1, 0x4b, 0x24, 0xee, 0xcc, 0x49, + 0x20, 0x07, 0x11, 0x3b, 0x01, 0x0a, 0xe4, 0x06, 0xc9, 0xe1, 0x9f, 0x0b, 0x04, 0xba, 0x28, 0x42, + 0x82, 0xc2, 0xda, 0xf3, 0x6d, 0xec, 0x55, 0xee, 0x76, 0x4f, 0xb7, 0x7b, 0x51, 0xee, 0x0d, 0x10, + 0x05, 0x50, 0x52, 0xa6, 0xa6, 0x85, 0x87, 0x48, 0x19, 0x41, 0x43, 0x65, 0x90, 0xd3, 0x50, 0xe7, + 0x09, 0xd0, 0xee, 0x9e, 0x1d, 0x47, 0x0a, 0x88, 0x82, 0x82, 0xea, 0xe6, 0x9b, 0xf9, 0xe6, 0x9b, + 0xd1, 0xcc, 0xec, 0x41, 0x67, 0xc0, 0x45, 0xcc, 0x45, 0x3b, 0xc0, 0x6c, 0xaf, 0xbd, 0xbf, 0x19, + 0x10, 0x89, 0x37, 0x35, 0x68, 0x25, 0x29, 0x97, 0x1c, 0x5d, 0x32, 0xf1, 0x96, 0x76, 0x15, 0xf1, + 0xd5, 0xe5, 0x21, 0x1f, 0x72, 0x1d, 0x6f, 0x2b, 0xcb, 0x50, 0x57, 0x57, 0x0c, 0xb5, 0x6f, 0x02, + 0x45, 0x9e, 0x09, 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, 0xad, 0x6d, 0xd5, 0x5d, 0x48, 0x45, 0x12, 0xe1, 0xdc, 0x5e, 0x34, 0x97, 0x51, 0x40, 0xc5, + 0x66, 0x38, 0x26, 0x76, 0xc5, 0xb0, 0x95, 0x8d, 0x2e, 0xc3, 0xaa, 0xc8, 0xe3, 0x80, 0x47, 0x76, + 0x55, 0x7b, 0x0b, 0x84, 0x56, 0x60, 0x39, 0x4b, 0xa9, 0x5d, 0x53, 0xce, 0x6e, 0x6d, 0x32, 0x76, + 0xcb, 0x3b, 0x7e, 0xcf, 0x57, 0x3e, 0x74, 0x1d, 0x5a, 0x59, 0x4a, 0xfb, 0x23, 0x2c, 0x46, 0xb6, + 0xa5, 0xe3, 0xf5, 0xc9, 0xd8, 0xad, 0xed, 0xf8, 0xbd, 0xc7, 0x58, 0x8c, 0xfc, 0x5a, 0x96, 0x52, + 0x65, 0x74, 0xb7, 0x8e, 0x26, 0x0e, 0x38, 0x9e, 0x38, 0xe0, 0xfb, 0xc4, 0x01, 0xef, 0x4e, 0x9c, + 0xd2, 0xf1, 0x89, 0x53, 0xfa, 0x7a, 0xe2, 0x94, 0x5e, 0xac, 0xfd, 0xc9, 0xea, 0xf4, 0xfe, 0x83, + 0xaa, 0xfe, 0x53, 0xdd, 0xfe, 0x19, 0x00, 0x00, 0xff, 0xff, 0x5c, 0x64, 0xd4, 0xf7, 0x31, 0x05, + 0x00, 0x00, } func (this *SendEnabled) Equal(that interface{}) bool { @@ -798,6 +821,20 @@ func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.URIHash) > 0 { + i -= len(m.URIHash) + copy(dAtA[i:], m.URIHash) + i = encodeVarintBank(dAtA, i, uint64(len(m.URIHash))) + i-- + dAtA[i] = 0x42 + } + if len(m.URI) > 0 { + i -= len(m.URI) + copy(dAtA[i:], m.URI) + i = encodeVarintBank(dAtA, i, uint64(len(m.URI))) + i-- + dAtA[i] = 0x3a + } if len(m.Symbol) > 0 { i -= len(m.Symbol) copy(dAtA[i:], m.Symbol) @@ -1002,6 +1039,14 @@ func (m *Metadata) Size() (n int) { if l > 0 { n += 1 + l + sovBank(uint64(l)) } + l = len(m.URI) + if l > 0 { + n += 1 + l + sovBank(uint64(l)) + } + l = len(m.URIHash) + if l > 0 { + n += 1 + l + sovBank(uint64(l)) + } return n } @@ -1889,6 +1934,70 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { } m.Symbol = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URI", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBank + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthBank + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBank + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URI = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URIHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBank + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthBank + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthBank + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URIHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipBank(dAtA[iNdEx:]) From d7deafccf5262d77b0c3643fb5eb0bd4710bf232 Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Thu, 1 Jul 2021 13:06:11 -0600 Subject: [PATCH 47/50] fix: enable gentx `--keyring-dir` flag to take effect (#9574) ## Description Closes: #XXXX The `--keyring-dir=xxx` flag was allowed by `appd gentx`, but wasn't actually used to search for key parameters. On investigation, it appears that `gentx` only initialized the query-side of the client context, but the tx-side needed to be initialized since keys and signing were involved. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change (not a breaking change) - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [x] added a changelog entry to `CHANGELOG.md` - [x] included comments for [documenting Go code](https://blog.golang.org/godoc) - [x] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- CHANGELOG.md | 5 +++++ x/genutil/client/cli/gentx.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33fd7a9009..2054833b29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,11 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements * (cli) [\#9593](https://github.com/cosmos/cosmos-sdk/pull/9593) Check if chain-id is blank before verifying signatures in multisign and error. +### Bug Fixes + +* (x/genutil) [\#9574](https://github.com/cosmos/cosmos-sdk/pull/9575) Actually use the `gentx` client tx flags (like `--keyring-dir`) + + ## [v0.43.0-rc0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.43.0-rc0) - 2021-06-25 ### Features diff --git a/x/genutil/client/cli/gentx.go b/x/genutil/client/cli/gentx.go index 3b1aaceb02..db00129a07 100644 --- a/x/genutil/client/cli/gentx.go +++ b/x/genutil/client/cli/gentx.go @@ -57,7 +57,7 @@ $ %s gentx my-key-name 1000000stake --home=/path/to/home/dir --keyring-backend=o ), RunE: func(cmd *cobra.Command, args []string) error { serverCtx := server.GetServerContextFromCmd(cmd) - clientCtx, err := client.GetClientQueryContext(cmd) + clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err } From e5ad9d1fb816fba490b06e6d524959776e46c8dd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Jul 2021 08:45:06 +0000 Subject: [PATCH 48/50] build(deps): bump google.golang.org/grpc from 1.38.0 to 1.39.0 (#9614) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.38.0 to 1.39.0.
Release notes

Sourced from google.golang.org/grpc's releases.

Release 1.39.0

Behavior Changes

  • csds: return empty response if xds client is not set (#4505)
  • metadata: convert keys to lowercase in FromContext() (#4416)

New Features

  • xds: add GetServiceInfo to GRPCServer (#4507)
  • xds: add test-only injection of xds config to client and server (#4476)
  • server: allow PreparedMsgs to work for server streams (#3480)

Performance Improvements

  • transport: remove decodeState from client & server to reduce allocations (#4423)

Bug Fixes

  • server: return UNIMPLEMENTED on receipt of malformed method name (#4464)
  • xds/rds: use 100 as default weighted cluster totalWeight instead of 0 (#4439)
  • transport: unblock read throttling when controlbuf exits (#4447)
  • client: fix status code to return Unavailable for servers shutting down instead of Unknown (#4561)

Documentation

  • doc: fix broken benchmark dashboard link in README.md (#4503)
  • example: improve hello world server with starting msg (#4468)
  • client: Clarify that WaitForReady will block for CONNECTING channels (#4477)

Release 1.38.1

internal/transport: do not mask ConnectionError (#4561)

Commits
  • ebf6a4b Change version to 1.39.0 (#4541)
  • 20551e1 internal/transport: do not mask ConnectionError (#4561) (#4569)
  • 22c5358 xds: add HashPolicy fields to RDS update (#4521)
  • 4554924 internal: fix deadlock during switch_balancer and NewSubConn() (#4536)
  • 2d3b1f9 grpc: prevent deadlock in Test/ClientUpdatesParamsAfterGoAway on failure (#4534)
  • 6351a55 xds: remove env var protetion of advanced routing features (#4529)
  • 95e48a8 Add GetServiceInfo to xds.GRPCServer (#4507)
  • aa1169a vet: remove support for non-module-aware Go versions (#4530)
  • b1418a6 xds: export XDSClient interface and use it in balancer tests (#4510)
  • 7301a31 c2p: add random number to xDS node ID in google-c2p resolver (#4519)
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=google.golang.org/grpc&package-manager=go_modules&previous-version=1.38.0&new-version=1.39.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 0f40c6da15..a34865e33e 100644 --- a/go.mod +++ b/go.mod @@ -48,7 +48,7 @@ require ( github.com/tendermint/tm-db v0.6.4 golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c - google.golang.org/grpc v1.38.0 + google.golang.org/grpc v1.39.0 google.golang.org/protobuf v1.26.0 gopkg.in/yaml.v2 v2.4.0 nhooyr.io/websocket v1.8.6 // indirect From 5ffe21ff1fe5c5fb623223c982f60ee1445ef7b2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Jul 2021 09:49:36 +0000 Subject: [PATCH 49/50] build(deps): bump google.golang.org/protobuf from 1.26.0 to 1.27.1 (#9610) Bumps [google.golang.org/protobuf](https://github.com/protocolbuffers/protobuf-go) from 1.26.0 to 1.27.1.
Release notes

Sourced from google.golang.org/protobuf's releases.

v1.27.1

Notable changes since v1.27.0:

  • CL/331149: cmd/protoc-gen-go: fix generation of enum defaults

v1.27.0

Overview

The release provides new functionality for iterating through a message using protobuf reflection. There are some minor changes to the code generator.

Notable changes

New features:

  • CL/309669: testing/protopack: add Message.UnmarshalAbductive

Bug fixes:

  • CL/317430: encoding/prototext: fix skipping of unknown fields
  • CL/321529: internal/impl: support typed nil source for Merge of aberrant messages

Generator changes

  • CL/305574: cmd/protoc-gen-go: remove generation of the ExtensionRangeArray method
  • CL/319649: cmd/protoc-gen-go: avoid referencing remote enum values by name
  • CL/316949: compiler/protogen: relax rules for valid import paths
  • CL/306209: cmd/protoc-gen-go: add protoc suffix

Reflectively ranging over a message

  • CL/236540: reflect: add protopath and protorange packages

The new reflect/protorange package supports recursively ranging through all populated fields of a message. There are many use cases for such a feature. See the examples for inspiration.

Upcoming breakage changes

This release removes generation of the ExtensionRangeArray method, as originally announced since the v1.20.0 release on March 2nd, 2020. Our analysis of the entire public module proxy found no static usages of this method. This method is pseudo-internal to the implementation and we expect removal of it to have no material impact. If something is broken by this change, please file an issue and we can consider re-generating this method in a patch release.

There are no new upcoming breaking changes to announce in this release.

Commits
  • b92717e all: release v1.27.1
  • 177d70e README.md: mention protopath and protorange packages
  • aa432c0 cmd/protoc-gen-go: fix generation of enum defaults
  • 49b6f72 all: start v1.27.0-devel
  • 3f51f05 all: release v1.27.0
  • dc57387 release.bash: make work on Linux
  • 21e33cc reflect/protoregistry: restore conflicting file names check
  • 426f20b release.bash: make work on macOS
  • febffdd reflect/protoregistry: permit conflicting file names
  • 4c193d1 compiler/protogen: relax rules for valid import paths
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=google.golang.org/protobuf&package-manager=go_modules&previous-version=1.26.0&new-version=1.27.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index a34865e33e..0b32bc9e20 100644 --- a/go.mod +++ b/go.mod @@ -49,7 +49,7 @@ require ( golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c google.golang.org/grpc v1.39.0 - google.golang.org/protobuf v1.26.0 + google.golang.org/protobuf v1.27.1 gopkg.in/yaml.v2 v2.4.0 nhooyr.io/websocket v1.8.6 // indirect ) diff --git a/go.sum b/go.sum index 1e41847aa1..f10b9e9f87 100644 --- a/go.sum +++ b/go.sum @@ -1189,8 +1189,9 @@ 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.25.1-0.20200805231151-a709e31e5d12/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 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 8297f2f3125e6b729b4377144246b38f8b73b7a1 Mon Sep 17 00:00:00 2001 From: Amaury <1293565+amaurym@users.noreply.github.com> Date: Fri, 2 Jul 2021 17:28:11 +0200 Subject: [PATCH 50/50] chore: Audit v0.43 CHANGELOG against commit log (#9592) ## Description ref: #9116 Audit of all commits, and adding a Changelog entry where deemed necessary - [x] from April 11th to June 28th - [x] from Feb 23rd to April 10th - [x] from Jan 7th to Feb 22nd depends on: - [x] #9591 to test mergify --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- CHANGELOG.md | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2054833b29..10a35a077f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### CLI Breaking Changes * [\#9246](https://github.com/cosmos/cosmos-sdk/pull/9246) Removed the CLI flag `--setup-config-only` from the `testnet` command and added the subcommand `init-files`. +* [\#9371](https://github.com/cosmos/cosmos-sdk/pull/9371) Non-zero default fees/Server will error if there's an empty value for min-gas-price in app.toml ### Improvements * (cli) [\#9593](https://github.com/cosmos/cosmos-sdk/pull/9593) Check if chain-id is blank before verifying signatures in multisign and error. @@ -68,8 +69,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Features +* [\#6711](https://github.com/cosmos/cosmos-sdk/pull/6711) Make integration test suites reusable by apps, tests are exported in each module's `client/testutil` package. * [\#8077](https://github.com/cosmos/cosmos-sdk/pull/8077) Added support for grpc-web, enabling browsers to communicate with a chain's gRPC server * [\#8965](https://github.com/cosmos/cosmos-sdk/pull/8965) cosmos reflection now provides more information on the application such as: deliverable msgs, sdk.Config info etc (still in alpha stage). +* [\#8520](https://github.com/cosmos/cosmos-sdk/pull/8520) Add support for permanently locked vesting accounts. * [\#8559](https://github.com/cosmos/cosmos-sdk/pull/8559) Added Protobuf compatible secp256r1 ECDSA signatures. * [\#8786](https://github.com/cosmos/cosmos-sdk/pull/8786) Enabled secp256r1 in x/auth. * (rosetta) [\#8729](https://github.com/cosmos/cosmos-sdk/pull/8729) Data API fully supports balance tracking. Construction API can now construct any message supported by the application. @@ -82,6 +85,9 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [\#9457](https://github.com/cosmos/cosmos-sdk/pull/9457) Add amino support for x/authz and x/feegrant Msgs. * [\#9498](https://github.com/cosmos/cosmos-sdk/pull/9498) Added `Codec: codec.Codec` attribute to `client/Context` structure. * [\#9540](https://github.com/cosmos/cosmos-sdk/pull/9540) Add output flag for query txs command. +* (errors) [\#8845](https://github.com/cosmos/cosmos-sdk/pull/8845) Add `Error.Wrap` handy method +* [\#8518](https://github.com/cosmos/cosmos-sdk/pull/8518) Help users of multisig wallets debug signature issues. + ### Client Breaking Changes @@ -98,6 +104,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * via legacy `msg.Type()` (e.g. `message.action='send'`) is being deprecated, new `Msg`s won't emit these events. * Please use concrete `Msg` TypeURLs instead (e.g. `message.action='/cosmos.bank.v1beta1.MsgSend'`). + ### API Breaking Changes * (keyring) [#\8662](https://github.com/cosmos/cosmos-sdk/pull/8662) `NewMnemonic` now receives an additional `passphrase` argument to secure the key generated by the bip39 mnemonic. @@ -124,7 +131,9 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (client) [\#8926](https://github.com/cosmos/cosmos-sdk/pull/8926) `client/tx.PrepareFactory` has been converted to a private function, as it's only used internally. * (auth/tx) [\#8926](https://github.com/cosmos/cosmos-sdk/pull/8926) The `ProtoTxProvider` interface used as a workaround for transaction simulation has been removed. * (x/bank) [\#8798](https://github.com/cosmos/cosmos-sdk/pull/8798) `GetTotalSupply` is removed in favour of `GetPaginatedTotalSupply` +* (keyring) [\#8739](https://github.com/cosmos/cosmos-sdk/pull/8739) Rename InfoImporter -> LegacyInfoImporter. * (x/bank/types) [\#9061](https://github.com/cosmos/cosmos-sdk/pull/9061) `AddressFromBalancesStore` now returns an error for invalid key instead of panic. +* (x/auth) [\#9144](https://github.com/cosmos/cosmos-sdk/pull/9144) The `NewTxTimeoutHeightDecorator` antehandler has been converted from a struct to a function. * (codec) [\#9226](https://github.com/cosmos/cosmos-sdk/pull/9226) Rename codec interfaces and methods, to follow a general Go interfaces: * `codec.Marshaler` → `codec.Codec` (this defines objects which serialize other objects) * `codec.BinaryMarshaler` → `codec.BinaryCodec` @@ -137,6 +146,9 @@ Ref: https://keepachangelog.com/en/1.0.0/ * The `RegisterCustomTypeURL` function and the `cosmos.base.v1beta1.ServiceMsg` interface have been removed from the interface registry. * (codec) [\#9251](https://github.com/cosmos/cosmos-sdk/pull/9251) Rename `clientCtx.JSONMarshaler` to `clientCtx.JSONCodec` as per #9226. * (x/bank) [\#9271](https://github.com/cosmos/cosmos-sdk/pull/9271) SendEnabledCoin(s) renamed to IsSendEnabledCoin(s) to better reflect its functionality. +* (x/bank) [\#9550](https://github.com/cosmos/cosmos-sdk/pull/9550) `server.InterceptConfigsPreRunHandler` now takes 2 additional arguments: customAppConfigTemplate and customAppConfig. If you don't need to customize these, simply put `""` and `nil`. +* [\#8245](https://github.com/cosmos/cosmos-sdk/pull/8245) Removed `simapp.MakeCodecs` and use `simapp.MakeTestEncodingConfig` instead. + ### State Machine Breaking @@ -154,19 +166,23 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [\#8628](https://github.com/cosmos/cosmos-sdk/issues/8628) Commands no longer print outputs using `stderr` by default * [\#9134](https://github.com/cosmos/cosmos-sdk/pull/9134) Renamed the CLI flag `--memo` to `--note`. * [\#9291](https://github.com/cosmos/cosmos-sdk/pull/9291) Migration scripts prior to v0.38 have been removed from the CLI `migrate` command. The oldest supported migration is v0.39->v0.42. -* [\#9371](https://github.com/cosmos/cosmos-sdk/pull/9371) Non-zero default fees/Server will error if there's an empty value for min-gas-price in app.toml ### Improvements +* (store) [\#8012](https://github.com/cosmos/cosmos-sdk/pull/8012) Implementation of ADR-038 WriteListener and listen.KVStore * (x/bank) [\#8614](https://github.com/cosmos/cosmos-sdk/issues/8614) Add `Name` and `Symbol` fields to denom metadata * (x/auth) [\#8522](https://github.com/cosmos/cosmos-sdk/pull/8522) Allow to query all stored accounts * (crypto/types) [\#8600](https://github.com/cosmos/cosmos-sdk/pull/8600) `CompactBitArray`: optimize the `NumTrueBitsBefore` method and add an `Equal` method. * (x/upgrade) [\#8743](https://github.com/cosmos/cosmos-sdk/pull/8743) Add tracking module versions as per ADR-041 * (types) [\#8962](https://github.com/cosmos/cosmos-sdk/issues/8962) Add `Abs()` method to `sdk.Int`. * (x/bank) [\#8950](https://github.com/cosmos/cosmos-sdk/pull/8950) Improve efficiency on supply updates. -* (store) [\#8012](https://github.com/cosmos/cosmos-sdk/pull/8012) Implementation of ADR-038 WriteListener and listen.KVStore +* (store) [\#8811](https://github.com/cosmos/cosmos-sdk/pull/8811) store/cachekv: use typed `types/kv.List` instead of `container/list.List`. The change brings time spent on the time assertion cummulatively to 580ms down from 6.88s. +* (keyring) [\#8826](https://github.com/cosmos/cosmos-sdk/pull/8826) add trust to macOS Keychain for calling apps by default, avoiding repeating keychain popups that appears when dealing with keyring (key add, list, ...) operations. * (makefile) [\#7933](https://github.com/cosmos/cosmos-sdk/issues/7933) Use Docker to generate swagger files. +* (crypto/types) [\#9196](https://github.com/cosmos/cosmos-sdk/pull/9196) Fix negative index accesses in CompactUnmarshal,GetIndex,SetIndex +* (cli) [\#9201](https://github.com/cosmos/cosmos-sdk/pull/9201) Fix init --recover not working. +* (makefile) [\#9192](https://github.com/cosmos/cosmos-sdk/pull/9192) Reuse proto containers in proto related jobs. * [\#9205](https://github.com/cosmos/cosmos-sdk/pull/9205) Improve readability in `abci` handleQueryP2P * [\#9231](https://github.com/cosmos/cosmos-sdk/pull/9231) Remove redundant staking errors. * [\#9314](https://github.com/cosmos/cosmos-sdk/pull/9314) Update Rosetta SDK to upstream's latest release. @@ -175,21 +191,36 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/staking) [\#9423](https://github.com/cosmos/cosmos-sdk/pull/9423) Staking delegations now returns empty list instead of rpc error when no records found. * (x/auth) [\#9553](https://github.com/cosmos/cosmos-sdk/pull/9553) The `--multisig` flag now accepts both a name and address. * (baseapp) [\#9578](https://github.com/cosmos/cosmos-sdk/pull/9578) Return `Baseapp`'s `trace` value for logging error stack traces. +* [\#8549](https://github.com/cosmos/cosmos-sdk/pull/8549) Make gRPC requests go through tendermint Query +* [\#8093](https://github.com/cosmos/cosmos-sdk/pull/8093) Limit usage of context.background. +* [\#8460](https://github.com/cosmos/cosmos-sdk/pull/8460) Ensure b.ReportAllocs() in all the benchmarks +* [\#8461](https://github.com/cosmos/cosmos-sdk/pull/8461) Fix upgrade tx commands not showing up in CLI + ### Bug Fixes -* [\#9454](https://github.com/cosmos/cosmos-sdk/pull/9454) Fix testnet command with --node-dir-prefix accepts `-` and change `node-dir-prefix token` to `testtoken`. * (x/gov) [\#8813](https://github.com/cosmos/cosmos-sdk/pull/8813) fix `GET /cosmos/gov/v1beta1/proposals/{proposal_id}/deposits` to include initial deposit * (gRPC) [\#8945](https://github.com/cosmos/cosmos-sdk/pull/8945) gRPC reflection now works correctly. * (keyring) [#\8635](https://github.com/cosmos/cosmos-sdk/issues/8635) Remove hardcoded default passphrase value on `NewMnemonic` * (x/bank) [\#8434](https://github.com/cosmos/cosmos-sdk/pull/8434) Fix legacy REST API `GET /bank/total` and `GET /bank/total/{denom}` in swagger * (x/slashing) [\#8427](https://github.com/cosmos/cosmos-sdk/pull/8427) Fix query signing infos command +* (x/bank/types) [\#9112](https://github.com/cosmos/cosmos-sdk/pull/9112) fix AddressFromBalancesStore address length overflow * (x/bank) [\#9229](https://github.com/cosmos/cosmos-sdk/pull/9229) Now zero coin balances cannot be added to balances & supply stores. If any denom becomes zero corresponding key gets deleted from store. +* [\#9363](https://github.com/cosmos/cosmos-sdk/pull/9363) Check store key uniqueness in app wiring. * [\#9460](https://github.com/cosmos/cosmos-sdk/pull/9460) Fix lint error in `MigratePrefixAddress`. * [\#9480](https://github.com/cosmos/cosmos-sdk/pull/9480) Fix added keys when using `--dry-run`. * (types) [\#9511](https://github.com/cosmos/cosmos-sdk/pull/9511) Change `maxBitLen` of `sdk.Int` and `sdk.Dec` to handle max ERC20 value. +* [\#9454](https://github.com/cosmos/cosmos-sdk/pull/9454) Fix testnet command with --node-dir-prefix accepts `-` and change `node-dir-prefix token` to `testtoken`. * (keyring) [\#9562](https://github.com/cosmos/cosmos-sdk/pull/9563) fix keyring kwallet backend when using with empty wallet. * (keyring) [\#9583](https://github.com/cosmos/cosmos-sdk/pull/9583) Fix correct population of legacy `Vote.Option` field for votes with 1 VoteOption of weight 1. +* (x/distinction) [\#8918](https://github.com/cosmos/cosmos-sdk/pull/8918) Fix module's parameters validation. +* (x/gov/types) [\#8586](https://github.com/cosmos/cosmos-sdk/pull/8586) Fix bug caused by NewProposal that unnecessarily creates a Proposal object that’s discarded on any error. +* [\#8580](https://github.com/cosmos/cosmos-sdk/pull/8580) Use more cheaper method from the math/big package that provides a way to trivially check if a value is zero with .BitLen() == 0 +* [\#8567](https://github.com/cosmos/cosmos-sdk/pull/8567) Fix bug by introducing pagination to GetValidatorSetByHeight response +* (x/bank) [\#8531](https://github.com/cosmos/cosmos-sdk/pull/8531) Fix bug caused by ignoring errors returned by Balance.GetAddress() +* (server) [\#8399](https://github.com/cosmos/cosmos-sdk/pull/8399) fix gRPC-web flag default value +* [\#8282](https://github.com/cosmos/cosmos-sdk/pull/8282) fix zero time checks + ### Deprecated @@ -263,7 +294,7 @@ This release fixes a security vulnerability identified in x/bank. ### Bug Fixes * (crypto) [\#8841](https://github.com/cosmos/cosmos-sdk/pull/8841) Fix legacy multisig amino marshaling, allowing migrations to work between v0.39 and v0.40+. -* (cli) [\#8873](https://github.com/cosmos/cosmos-sdk/pull/8873) add --output-document to multisign-batch. +* (cli tx) [\8873](https://github.com/cosmos/cosmos-sdk/pull/8873) add missing `--output-document` option to `app tx multisign-batch`. ## [v0.42.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.1) - 2021-03-10 @@ -343,6 +374,7 @@ he Cosmos Hub) should not use this release or any release in the v0.41.x series. * (x/ibc) [\#8404](https://github.com/cosmos/cosmos-sdk/pull/8404) Reorder IBC `ChanOpenAck` and `ChanOpenConfirm` handler execution to perform core handler first, followed by application callbacks. + ### Bug Fixes * (simapp) [\#8418](https://github.com/cosmos/cosmos-sdk/pull/8418) Add balance coin to supply when adding a new genesis account