Skip to content

Commit

Permalink
feat(upgrade): autocli query support (backport #16903) (#16921)
Browse files Browse the repository at this point in the history
Co-authored-by: Julien Robert <[email protected]>
  • Loading branch information
mergify[bot] and julienrbrt authored Jul 11, 2023
1 parent 5ca5039 commit 3cc94a2
Show file tree
Hide file tree
Showing 21 changed files with 101 additions and 527 deletions.
8 changes: 4 additions & 4 deletions simapp/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ require (
cosmossdk.io/tools/confix v0.0.0-20230630152705-9f4a4e416f85
cosmossdk.io/tools/rosetta v0.2.1-0.20230614114324-f368ed5c62bc
cosmossdk.io/x/circuit v0.0.0-20230710134821-641c6a79f97c
cosmossdk.io/x/evidence v0.0.0-20230710135718-3bfd00f47bde
cosmossdk.io/x/feegrant v0.0.0-20230710134821-641c6a79f97c
cosmossdk.io/x/nft v0.0.0-20230710134821-641c6a79f97c
cosmossdk.io/x/evidence v0.0.0-20230711132404-6f85267b41ff
cosmossdk.io/x/feegrant v0.0.0-20230711132404-6f85267b41ff
cosmossdk.io/x/nft v0.0.0-20230711132404-6f85267b41ff
cosmossdk.io/x/tx v0.8.0
cosmossdk.io/x/upgrade v0.0.0-20230710134821-641c6a79f97c
cosmossdk.io/x/upgrade v0.0.0-20230711132404-6f85267b41ff
github.com/cometbft/cometbft v0.38.0-rc2
github.com/cosmos/cosmos-db v1.0.0
// this version is not used as it is always replaced by the latest Cosmos SDK version
Expand Down
16 changes: 8 additions & 8 deletions simapp/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,16 @@ cosmossdk.io/tools/rosetta v0.2.1-0.20230614114324-f368ed5c62bc h1:7gFe3tRGqaA3s
cosmossdk.io/tools/rosetta v0.2.1-0.20230614114324-f368ed5c62bc/go.mod h1:l5qTTiHcPXf1m3iz7WuACKFmHW2ewAuIW/+ZcWcUm4Q=
cosmossdk.io/x/circuit v0.0.0-20230710134821-641c6a79f97c h1:oXH8E67knESVPzLdNDglffB7Ti7/P02qL8iuiTda3fA=
cosmossdk.io/x/circuit v0.0.0-20230710134821-641c6a79f97c/go.mod h1:rUBiMrg2mukTuTJCyZEicbFMH9PLyQQJxgAsQLB3UwQ=
cosmossdk.io/x/evidence v0.0.0-20230710135718-3bfd00f47bde h1:TNx2sOZSH5N9FqmUwVP52iTJVqZKRUkJC65Ff0nqWpA=
cosmossdk.io/x/evidence v0.0.0-20230710135718-3bfd00f47bde/go.mod h1:cnxLSV33Lfru9og/l3mCQBi10NHi3PJqWsKY+tKh+xc=
cosmossdk.io/x/feegrant v0.0.0-20230710134821-641c6a79f97c h1:HzPM4vJMlFArXj7tmwpV87vPiVjyPpY88/pfZgNE4FU=
cosmossdk.io/x/feegrant v0.0.0-20230710134821-641c6a79f97c/go.mod h1:TlHm+UK7zPwcQ83f24ISDzejJf56/dadAdiJf4SPgeE=
cosmossdk.io/x/nft v0.0.0-20230710134821-641c6a79f97c h1:8SKwHSXNN5kCBlRaGV2YRwoYL1wxh1A4S8Nk8eTcx/s=
cosmossdk.io/x/nft v0.0.0-20230710134821-641c6a79f97c/go.mod h1:omqWFlLcCMXsOt67tUb8uqpNA9U6J2h5Z3QQ0BRPq1M=
cosmossdk.io/x/evidence v0.0.0-20230711132404-6f85267b41ff h1:jHaIT3j6t8op9msjsm9j9AJUnzPPCtqY7Q9/i3Crj8U=
cosmossdk.io/x/evidence v0.0.0-20230711132404-6f85267b41ff/go.mod h1:NHUBoDUMg6DGc0zlpTSwUXAQznlkoCA6EJcRTfMwOWo=
cosmossdk.io/x/feegrant v0.0.0-20230711132404-6f85267b41ff h1:VqTfKSFmqGfmrBP77c2jSOpTEpN/ARNXByRkmoNxSNs=
cosmossdk.io/x/feegrant v0.0.0-20230711132404-6f85267b41ff/go.mod h1:eRhe+cGE6iTL+68FgtVIdnmtU5gRZzGq3ojyr2eJjJM=
cosmossdk.io/x/nft v0.0.0-20230711132404-6f85267b41ff h1:IufjBZ9oKrcNVWKs4j5ekpOPiaW9TXw8WozWrttitgE=
cosmossdk.io/x/nft v0.0.0-20230711132404-6f85267b41ff/go.mod h1:I1Pg8Nv5qTUP4QSQD3L00aMq1LOuJvou7XJ6kvgmwZU=
cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU=
cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA=
cosmossdk.io/x/upgrade v0.0.0-20230710134821-641c6a79f97c h1:2TNjseXZhNKApzq6b+j0m3pnraYLG8zU356zkb6ycjM=
cosmossdk.io/x/upgrade v0.0.0-20230710134821-641c6a79f97c/go.mod h1:fQmHxVcavPTOAM0FH35txopwNhZflQ2kbSbKCKVQ/14=
cosmossdk.io/x/upgrade v0.0.0-20230711132404-6f85267b41ff h1:wPzYaNh/U6+tWjrVNQ4cGexGy9XDH4Bao24+yQa7zUA=
cosmossdk.io/x/upgrade v0.0.0-20230711132404-6f85267b41ff/go.mod h1:Td6clkz6yyD/c7gIZHKDJp8u7Ky9mbtH+l45qTXjJOk=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek=
filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=
Expand Down
26 changes: 0 additions & 26 deletions tests/e2e/upgrade/cli_test.go

This file was deleted.

115 changes: 0 additions & 115 deletions tests/e2e/upgrade/suite.go

This file was deleted.

8 changes: 4 additions & 4 deletions tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ require (
cosmossdk.io/math v1.0.1
cosmossdk.io/simapp v0.0.0-20230620040119-e078f1a49e8b
cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c
cosmossdk.io/x/evidence v0.0.0-20230710135718-3bfd00f47bde
cosmossdk.io/x/feegrant v0.0.0-20230710134821-641c6a79f97c
cosmossdk.io/x/nft v0.0.0-20230710134821-641c6a79f97c // indirect
cosmossdk.io/x/evidence v0.0.0-20230711132404-6f85267b41ff
cosmossdk.io/x/feegrant v0.0.0-20230711132404-6f85267b41ff
cosmossdk.io/x/nft v0.0.0-20230711132404-6f85267b41ff // indirect
cosmossdk.io/x/tx v0.8.0
cosmossdk.io/x/upgrade v0.0.0-20230710134821-641c6a79f97c
cosmossdk.io/x/upgrade v0.0.0-20230711132404-6f85267b41ff
github.com/cometbft/cometbft v0.38.0-rc2
github.com/cosmos/cosmos-db v1.0.0
github.com/cosmos/cosmos-proto v1.0.0-beta.3
Expand Down
16 changes: 8 additions & 8 deletions tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -208,16 +208,16 @@ cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c h1:A+FMPW9GtfcPB
cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c/go.mod h1:RbYGvXCbz8uNBCXrwS9Z8SyydeWi+W5x5MZ33muyzMw=
cosmossdk.io/x/circuit v0.0.0-20230710134821-641c6a79f97c h1:oXH8E67knESVPzLdNDglffB7Ti7/P02qL8iuiTda3fA=
cosmossdk.io/x/circuit v0.0.0-20230710134821-641c6a79f97c/go.mod h1:rUBiMrg2mukTuTJCyZEicbFMH9PLyQQJxgAsQLB3UwQ=
cosmossdk.io/x/evidence v0.0.0-20230710135718-3bfd00f47bde h1:TNx2sOZSH5N9FqmUwVP52iTJVqZKRUkJC65Ff0nqWpA=
cosmossdk.io/x/evidence v0.0.0-20230710135718-3bfd00f47bde/go.mod h1:cnxLSV33Lfru9og/l3mCQBi10NHi3PJqWsKY+tKh+xc=
cosmossdk.io/x/feegrant v0.0.0-20230710134821-641c6a79f97c h1:HzPM4vJMlFArXj7tmwpV87vPiVjyPpY88/pfZgNE4FU=
cosmossdk.io/x/feegrant v0.0.0-20230710134821-641c6a79f97c/go.mod h1:TlHm+UK7zPwcQ83f24ISDzejJf56/dadAdiJf4SPgeE=
cosmossdk.io/x/nft v0.0.0-20230710134821-641c6a79f97c h1:8SKwHSXNN5kCBlRaGV2YRwoYL1wxh1A4S8Nk8eTcx/s=
cosmossdk.io/x/nft v0.0.0-20230710134821-641c6a79f97c/go.mod h1:omqWFlLcCMXsOt67tUb8uqpNA9U6J2h5Z3QQ0BRPq1M=
cosmossdk.io/x/evidence v0.0.0-20230711132404-6f85267b41ff h1:jHaIT3j6t8op9msjsm9j9AJUnzPPCtqY7Q9/i3Crj8U=
cosmossdk.io/x/evidence v0.0.0-20230711132404-6f85267b41ff/go.mod h1:NHUBoDUMg6DGc0zlpTSwUXAQznlkoCA6EJcRTfMwOWo=
cosmossdk.io/x/feegrant v0.0.0-20230711132404-6f85267b41ff h1:VqTfKSFmqGfmrBP77c2jSOpTEpN/ARNXByRkmoNxSNs=
cosmossdk.io/x/feegrant v0.0.0-20230711132404-6f85267b41ff/go.mod h1:eRhe+cGE6iTL+68FgtVIdnmtU5gRZzGq3ojyr2eJjJM=
cosmossdk.io/x/nft v0.0.0-20230711132404-6f85267b41ff h1:IufjBZ9oKrcNVWKs4j5ekpOPiaW9TXw8WozWrttitgE=
cosmossdk.io/x/nft v0.0.0-20230711132404-6f85267b41ff/go.mod h1:I1Pg8Nv5qTUP4QSQD3L00aMq1LOuJvou7XJ6kvgmwZU=
cosmossdk.io/x/tx v0.8.0 h1:gLiGRL/Fy7fs6dd0IX8jOf0PrVr56/SG6XVMGQjyvJU=
cosmossdk.io/x/tx v0.8.0/go.mod h1:T9uEumGNgKU61gJYRv1t3uzQwLnASpJGmSE229HM3xA=
cosmossdk.io/x/upgrade v0.0.0-20230710134821-641c6a79f97c h1:2TNjseXZhNKApzq6b+j0m3pnraYLG8zU356zkb6ycjM=
cosmossdk.io/x/upgrade v0.0.0-20230710134821-641c6a79f97c/go.mod h1:fQmHxVcavPTOAM0FH35txopwNhZflQ2kbSbKCKVQ/14=
cosmossdk.io/x/upgrade v0.0.0-20230711132404-6f85267b41ff h1:wPzYaNh/U6+tWjrVNQ4cGexGy9XDH4Bao24+yQa7zUA=
cosmossdk.io/x/upgrade v0.0.0-20230711132404-6f85267b41ff/go.mod h1:Td6clkz6yyD/c7gIZHKDJp8u7Ky9mbtH+l45qTXjJOk=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek=
filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=
Expand Down
2 changes: 1 addition & 1 deletion x/evidence/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c
github.com/cometbft/cometbft v0.38.0-rc2
github.com/cosmos/cosmos-proto v1.0.0-beta.3
github.com/cosmos/cosmos-sdk v0.50.0-alpha.1.0.20230710133933-d4f661321afb
github.com/cosmos/cosmos-sdk v0.50.0-alpha.1.0.20230711130522-37cf56dff23c
github.com/cosmos/gogoproto v1.4.10
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.3
Expand Down
4 changes: 2 additions & 2 deletions x/evidence/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0
github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U=
github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o=
github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I=
github.com/cosmos/cosmos-sdk v0.50.0-alpha.1.0.20230710133933-d4f661321afb h1:8QuN6QiOvE03D8DYnlVIfgyy/fTjQHoEDMsDPtSeXVk=
github.com/cosmos/cosmos-sdk v0.50.0-alpha.1.0.20230710133933-d4f661321afb/go.mod h1:ipTpaQLbn9S35e+b6gWm6OB9Lwr1mYy/47cX+owKnE4=
github.com/cosmos/cosmos-sdk v0.50.0-alpha.1.0.20230711130522-37cf56dff23c h1:5Plp4fx0NKn/mSVxEc5G2QsXQ6O0q3n7P5nS2ETEAEI=
github.com/cosmos/cosmos-sdk v0.50.0-alpha.1.0.20230711130522-37cf56dff23c/go.mod h1:ipTpaQLbn9S35e+b6gWm6OB9Lwr1mYy/47cX+owKnE4=
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE=
Expand Down
2 changes: 1 addition & 1 deletion x/feegrant/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c
github.com/cometbft/cometbft v0.38.0-rc2
github.com/cosmos/cosmos-proto v1.0.0-beta.3
github.com/cosmos/cosmos-sdk v0.50.0-alpha.1.0.20230710133933-d4f661321afb
github.com/cosmos/cosmos-sdk v0.50.0-alpha.1.0.20230711130522-37cf56dff23c
github.com/cosmos/gogoproto v1.4.10
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.3
Expand Down
4 changes: 2 additions & 2 deletions x/feegrant/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0
github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U=
github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o=
github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I=
github.com/cosmos/cosmos-sdk v0.50.0-alpha.1.0.20230710133933-d4f661321afb h1:8QuN6QiOvE03D8DYnlVIfgyy/fTjQHoEDMsDPtSeXVk=
github.com/cosmos/cosmos-sdk v0.50.0-alpha.1.0.20230710133933-d4f661321afb/go.mod h1:ipTpaQLbn9S35e+b6gWm6OB9Lwr1mYy/47cX+owKnE4=
github.com/cosmos/cosmos-sdk v0.50.0-alpha.1.0.20230711130522-37cf56dff23c h1:5Plp4fx0NKn/mSVxEc5G2QsXQ6O0q3n7P5nS2ETEAEI=
github.com/cosmos/cosmos-sdk v0.50.0-alpha.1.0.20230711130522-37cf56dff23c/go.mod h1:ipTpaQLbn9S35e+b6gWm6OB9Lwr1mYy/47cX+owKnE4=
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE=
Expand Down
2 changes: 1 addition & 1 deletion x/nft/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
cosmossdk.io/store v0.1.0-alpha.1.0.20230606190835-3e18f4088b2c
github.com/cometbft/cometbft v0.38.0-rc2
github.com/cosmos/cosmos-proto v1.0.0-beta.3
github.com/cosmos/cosmos-sdk v0.50.0-alpha.1.0.20230710133933-d4f661321afb
github.com/cosmos/cosmos-sdk v0.50.0-alpha.1.0.20230711130522-37cf56dff23c
github.com/cosmos/gogoproto v1.4.10
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.3
Expand Down
4 changes: 2 additions & 2 deletions x/nft/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0
github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U=
github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o=
github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I=
github.com/cosmos/cosmos-sdk v0.50.0-alpha.1.0.20230710133933-d4f661321afb h1:8QuN6QiOvE03D8DYnlVIfgyy/fTjQHoEDMsDPtSeXVk=
github.com/cosmos/cosmos-sdk v0.50.0-alpha.1.0.20230710133933-d4f661321afb/go.mod h1:ipTpaQLbn9S35e+b6gWm6OB9Lwr1mYy/47cX+owKnE4=
github.com/cosmos/cosmos-sdk v0.50.0-alpha.1.0.20230711130522-37cf56dff23c h1:5Plp4fx0NKn/mSVxEc5G2QsXQ6O0q3n7P5nS2ETEAEI=
github.com/cosmos/cosmos-sdk v0.50.0-alpha.1.0.20230711130522-37cf56dff23c/go.mod h1:ipTpaQLbn9S35e+b6gWm6OB9Lwr1mYy/47cX+owKnE4=
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE=
Expand Down
4 changes: 4 additions & 0 deletions x/upgrade/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
* [#14880](https://github.com/cosmos/cosmos-sdk/pull/14880) Switch from using gov v1beta1 to gov v1 in upgrade CLIs.
* [#14764](https://github.com/cosmos/cosmos-sdk/pull/14764) The `x/upgrade` module is extracted to have a separate go.mod file which allows it be a standalone module.

### Improvements

* [#16903](https://github.com/cosmos/cosmos-sdk/pull/16903) Use AutoCLI for upgrade querying commands.

### API Breaking Changes

* [#16845](https://github.com/cosmos/cosmos-sdk/pull/16845) Remove gov v1beta1 handler. Use gov v1 proposals directly, or replicate the handler in your app.
Expand Down
5 changes: 1 addition & 4 deletions x/upgrade/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"time"

"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"

"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/header"
Expand All @@ -31,8 +30,6 @@ import (
)

type TestSuite struct {
suite.Suite

module appmodule.HasBeginBlocker
keeper *keeper.Keeper
ctx sdk.Context
Expand Down Expand Up @@ -115,7 +112,7 @@ func setupTest(t *testing.T, height int64, skip map[int64]bool) *TestSuite {
s.encCfg = moduletestutil.MakeTestEncodingConfig(upgrade.AppModuleBasic{})
key := storetypes.NewKVStoreKey(types.StoreKey)
storeService := runtime.NewKVStoreService(key)
testCtx := testutil.DefaultContextWithDB(s.T(), key, storetypes.NewTransientStoreKey("transient_test"))
testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test"))

s.baseApp = baseapp.NewBaseApp(
"upgrade",
Expand Down
53 changes: 53 additions & 0 deletions x/upgrade/autocli.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package upgrade

import (
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
upgradev1beta1 "cosmossdk.io/api/cosmos/upgrade/v1beta1"
)

func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions {
return &autocliv1.ModuleOptions{
Query: &autocliv1.ServiceCommandDescriptor{
Service: upgradev1beta1.Query_ServiceDesc.ServiceName,
RpcCommandOptions: []*autocliv1.RpcCommandOptions{
{
RpcMethod: "CurrentPlan",
Use: "plan",
Short: "Query the upgrade plan (if one exists)",
Long: "Gets the currently scheduled upgrade plan, if one exists",
},
{
RpcMethod: "AppliedPlan",
Use: "applied [upgrade-name]",
Short: "Query the block header for height at which a completed upgrade was applied",
Long: "If upgrade-name was previously executed on the chain, this returns the header for the block at which it was applied. This helps a client determine which binary was valid over a given range of blocks, as well as more context to understand past migrations.",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "name"},
},
},
{
RpcMethod: "ModuleVersions",
Use: "module-versions [optional module_name]",
Alias: []string{"module_versions"},
Short: "Query the list of module versions",
Long: "Gets a list of module names and their respective consensus versions. Following the command with a specific module name will return only that module's information.",
PositionalArgs: []*autocliv1.PositionalArgDescriptor{
{ProtoField: "module_name", Optional: true},
},
},
{
RpcMethod: "Authority",
Use: "authority",
Short: "Get the upgrade authority address",
},
{
RpcMethod: "UpgradedConsensusState",
Skip: true, // Skipping this command as the query is deprecated.
},
},
},
Tx: &autocliv1.ServiceCommandDescriptor{
Service: upgradev1beta1.Query_ServiceDesc.ServiceName,
},
}
}
Loading

0 comments on commit 3cc94a2

Please sign in to comment.