Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.

Commit 7c1812e

Browse files
likhita-809tsenart
authored andcommitted
refactor: x/upgrade to standalone module (cosmos#14764)
1 parent ad778c5 commit 7c1812e

64 files changed

Lines changed: 1945 additions & 171 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,10 @@ updates:
165165
labels:
166166
- "A:automerge"
167167
- dependencies
168+
- package-ecosystem: gomod
169+
directory: "x/upgrade"
170+
schedule:
171+
interval: weekly
172+
labels:
173+
- "A:automerge"
174+
- dependencies

.github/workflows/test.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,3 +768,32 @@ jobs:
768768
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
769769
with:
770770
projectBaseDir: x/evidence/
771+
test-x-upgrade:
772+
runs-on: ubuntu-latest
773+
steps:
774+
- uses: actions/checkout@v3
775+
- uses: actions/setup-go@v3
776+
with:
777+
go-version: 1.19.4
778+
cache: true
779+
cache-dependency-path: x/upgrade/go.sum
780+
- uses: technote-space/get-diff-action@v6.1.2
781+
id: git_diff
782+
with:
783+
PATTERNS: |
784+
x/upgrade/**/*.go
785+
x/upgrade/go.mod
786+
x/upgrade/go.sum
787+
- name: tests
788+
if: env.GIT_DIFF
789+
run: |
790+
cd x/upgrade
791+
go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
792+
- name: sonarcloud
793+
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }}
794+
uses: SonarSource/sonarcloud-github-action@master
795+
env:
796+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
797+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
798+
with:
799+
projectBaseDir: x/upgrade/

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
168168

169169
### API Breaking Changes
170170

171+
* (x/upgrade) [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 to be a standalone module.
171172
* (x/gov) [#14782](https://github.com/cosmos/cosmos-sdk/pull/14782) Move the `metadata` argument in `govv1.NewProposal` alongside `title` and `summary`.
172173
* (store) [#14746](https://github.com/cosmos/cosmos-sdk/pull/14746) Extract Store in its own go.mod and rename the package to `cosmossdk.io/store`.
173174
* (x/simulation) [#14751](https://github.com/cosmos/cosmos-sdk/pull/14751) Remove the `MsgType` field from `simulation.OperationInput` struct.

UPGRADING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ The `x/nft` module is extracted to have a separate go.mod file which allows it t
8888
The `x/feegrant` module is extracted to have a separate go.mod file which allows it to be a standalone module.
8989
All the feegrant imports are now renamed to use `cosmossdk.io/x/feegrant` instead of `github.com/cosmos/cosmos-sdk/x/feegrant` across the SDK.
9090

91+
#### `x/upgrade`
92+
93+
##### Extract upgrade to a standalone module
94+
95+
The `x/upgrade` module is extracted to have a separate go.mod file which allows it to be a standalone module.
96+
All the upgrade imports are now renamed to use `cosmossdk.io/x/upgrade` instead of `github.com/cosmos/cosmos-sdk/x/upgrade` across the SDK.
97+
9198
## [v0.47.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.0)
9299

93100
### Simulation

api/cosmos/upgrade/module/v1/module.pulsar.go

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ require (
99
cosmossdk.io/depinject v1.0.0-alpha.3
1010
cosmossdk.io/errors v1.0.0-beta.7
1111
cosmossdk.io/math v1.0.0-beta.4
12-
cosmossdk.io/store v0.1.0
12+
cosmossdk.io/store v0.0.0-20230126202154-be9bd7a8c1b4
1313
cosmossdk.io/x/tx v0.1.0
14+
cosmossdk.io/x/upgrade v0.0.0-20230127052425-54c8e1568335
1415
github.com/99designs/keyring v1.2.1
1516
github.com/armon/go-metrics v0.4.1
1617
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816
@@ -32,7 +33,6 @@ require (
3233
github.com/gorilla/mux v1.8.0
3334
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
3435
github.com/grpc-ecosystem/grpc-gateway v1.16.0
35-
github.com/hashicorp/go-getter v1.6.2
3636
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d
3737
github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3
3838
github.com/huandu/skiplist v1.2.0
@@ -120,6 +120,7 @@ require (
120120
github.com/gtank/ristretto255 v0.1.2 // indirect
121121
github.com/hashicorp/errwrap v1.1.0 // indirect
122122
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
123+
github.com/hashicorp/go-getter v1.6.2 // indirect
123124
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
124125
github.com/hashicorp/go-multierror v1.1.1 // indirect
125126
github.com/hashicorp/go-safetemp v1.0.0 // indirect
@@ -177,7 +178,6 @@ require (
177178

178179
replace (
179180
cosmossdk.io/collections => ./collections
180-
cosmossdk.io/store => ./store
181181
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0
182182

183183
// dgrijalva/jwt-go is deprecated and doesn't receive security updates.

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,12 @@ cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w
5656
cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE=
5757
cosmossdk.io/math v1.0.0-beta.4 h1:JtKedVLGzA0vv84xjYmZ75RKG35Kf2WwcFu8IjRkIIw=
5858
cosmossdk.io/math v1.0.0-beta.4/go.mod h1:An0MllWJY6PxibUpnwGk8jOm+a/qIxlKmL5Zyp9NnaM=
59+
cosmossdk.io/store v0.0.0-20230126202154-be9bd7a8c1b4 h1:m7oRquCtYL8OuLWogjMzTVDIxeu5toJz6sSUU01Canw=
60+
cosmossdk.io/store v0.0.0-20230126202154-be9bd7a8c1b4/go.mod h1:NFKdO50vvtoZBnJXlWRstqq5dxhku7sRKc/5tLsFerI=
5961
cosmossdk.io/x/tx v0.1.0 h1:uyyYVjG22B+jf54N803Z99Y1uPvfuNP3K1YShoCHYL8=
6062
cosmossdk.io/x/tx v0.1.0/go.mod h1:qsDv7e1fSftkF16kpSAk+7ROOojyj+SC0Mz3ukI52EQ=
63+
cosmossdk.io/x/upgrade v0.0.0-20230127052425-54c8e1568335 h1:Ke74O79cHxXhPiVWk9D+TkXsgSbjuXwunDwddj1XlsY=
64+
cosmossdk.io/x/upgrade v0.0.0-20230127052425-54c8e1568335/go.mod h1:H+VCBqiCBedKNSYuUEhIeq0lgRQunTOHmGa0u+DLLDY=
6165
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
6266
filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU=
6367
filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=

go.work.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ use (
2222
./x/circuit
2323
./x/feegrant
2424
./x/evidence
25+
./x/upgrade
2526
)

proto/cosmos/upgrade/module/v1/module.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import "cosmos/app/v1alpha1/module.proto";
77
// Module is the config object of the upgrade module.
88
message Module {
99
option (cosmos.app.v1alpha1.module) = {
10-
go_import: "github.com/cosmos/cosmos-sdk/x/upgrade"
10+
go_import: "cosmossdk.io/x/upgrade"
1111
};
1212

1313
// authority defines the custom module authority. If not set, defaults to the governance module.

proto/cosmos/upgrade/v1beta1/query.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package cosmos.upgrade.v1beta1;
44
import "google/api/annotations.proto";
55
import "cosmos/upgrade/v1beta1/upgrade.proto";
66

7-
option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types";
7+
option go_package = "cosmossdk.io/x/upgrade/types";
88

99
// Query defines the gRPC upgrade querier service.
1010
service Query {

0 commit comments

Comments
 (0)