Skip to content

Commit

Permalink
chore: bump version to v21 (#3367)
Browse files Browse the repository at this point in the history
* replace gaia/v20 with gaia/v21

* add v21 upgrade handler

* update tests

* appease linters

---------

Co-authored-by: MSalopek <[email protected]>
  • Loading branch information
mpoke and MSalopek authored Oct 2, 2024
1 parent abbace9 commit c501b43
Show file tree
Hide file tree
Showing 45 changed files with 111 additions and 65 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ jobs:
# the old gaiad binary version is hardcoded, need to be updated each major release.
- name: Install Old Gaiad
run: |
curl -LO https://github.com/cosmos/gaia/releases/download/v19.1.0/gaiad-v19.1.0-linux-amd64
chmod a+x gaiad-v19.1.0-linux-amd64
curl -LO https://github.com/cosmos/gaia/releases/download/v20.0.0/gaiad-v20.0.0-linux-amd64
chmod a+x gaiad-v20.0.0-linux-amd64
mkdir build
mv ./gaiad-v19.1.0-linux-amd64 ./build/gaiadold
mv ./gaiad-v20.0.0-linux-amd64 ./build/gaiadold
if: env.GIT_DIFF
- name: Install New Gaiad
run: |
Expand Down
2 changes: 1 addition & 1 deletion ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"

gaiaerrors "github.com/cosmos/gaia/v20/types/errors"
gaiaerrors "github.com/cosmos/gaia/v21/types/errors"
)

// UseFeeMarketDecorator to make the integration testing easier: we can switch off its ante and post decorators with this flag
Expand Down
2 changes: 1 addition & 1 deletion ante/gov_expedited_ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"

gaiaerrors "github.com/cosmos/gaia/v20/types/errors"
gaiaerrors "github.com/cosmos/gaia/v21/types/errors"
)

var expeditedPropDecoratorEnabled = true
Expand Down
4 changes: 2 additions & 2 deletions ante/gov_expedited_ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"

"github.com/cosmos/gaia/v20/ante"
"github.com/cosmos/gaia/v20/app/helpers"
"github.com/cosmos/gaia/v21/ante"
"github.com/cosmos/gaia/v21/app/helpers"
)

func TestGovExpeditedProposalsDecorator(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion ante/gov_vote_ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

gaiaerrors "github.com/cosmos/gaia/v20/types/errors"
gaiaerrors "github.com/cosmos/gaia/v21/types/errors"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions ante/gov_vote_ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

"github.com/cosmos/gaia/v20/ante"
"github.com/cosmos/gaia/v20/app/helpers"
"github.com/cosmos/gaia/v21/ante"
"github.com/cosmos/gaia/v21/app/helpers"
)

// Test that the GovVoteDecorator rejects v1beta1 vote messages from accounts with less than 1 atom staked
Expand Down
10 changes: 5 additions & 5 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,17 @@ import (
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"

gaiaante "github.com/cosmos/gaia/v20/ante"
"github.com/cosmos/gaia/v20/app/keepers"
"github.com/cosmos/gaia/v20/app/upgrades"
v20 "github.com/cosmos/gaia/v20/app/upgrades/v20"
gaiaante "github.com/cosmos/gaia/v21/ante"
"github.com/cosmos/gaia/v21/app/keepers"
"github.com/cosmos/gaia/v21/app/upgrades"
v21 "github.com/cosmos/gaia/v21/app/upgrades/v21"
)

var (
// DefaultNodeHome default home directories for the application daemon
DefaultNodeHome string

Upgrades = []upgrades.Upgrade{v20.Upgrade}
Upgrades = []upgrades.Upgrade{v21.Upgrade}
)

var (
Expand Down
4 changes: 2 additions & 2 deletions app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (

wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"

gaia "github.com/cosmos/gaia/v20/app"
gaiahelpers "github.com/cosmos/gaia/v20/app/helpers"
gaia "github.com/cosmos/gaia/v21/app"
gaiahelpers "github.com/cosmos/gaia/v21/app/helpers"
)

type EmptyAppOptions struct{}
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (

wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"

gaiaapp "github.com/cosmos/gaia/v20/app"
gaiaapp "github.com/cosmos/gaia/v21/app"
)

// SimAppChainID hardcoded chainID for simulation
Expand Down
4 changes: 2 additions & 2 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ import (
wasm "github.com/CosmWasm/wasmd/x/wasm"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"

"github.com/cosmos/gaia/v20/x/metaprotocols"
metaprotocolstypes "github.com/cosmos/gaia/v20/x/metaprotocols/types"
"github.com/cosmos/gaia/v21/x/metaprotocols"
metaprotocolstypes "github.com/cosmos/gaia/v21/x/metaprotocols/types"
)

var maccPerms = map[string][]string{
Expand Down
2 changes: 1 addition & 1 deletion app/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"

"github.com/cosmos/gaia/v20/ante"
"github.com/cosmos/gaia/v21/ante"
)

// PostHandlerOptions are the options required for constructing a FeeMarket PostHandler.
Expand Down
2 changes: 1 addition & 1 deletion app/sim/sim_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

gaia "github.com/cosmos/gaia/v20/app"
gaia "github.com/cosmos/gaia/v21/app"
)

// Simulation parameter constants
Expand Down
2 changes: 1 addition & 1 deletion app/sim/sim_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/cosmos/cosmos-sdk/types/module"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"

gaia "github.com/cosmos/gaia/v20/app"
gaia "github.com/cosmos/gaia/v21/app"
)

// SimulationOperations retrieves the simulation params from the provided file path
Expand Down
4 changes: 2 additions & 2 deletions app/sim_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"github.com/cosmos/cosmos-sdk/x/simulation"
simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli"

gaia "github.com/cosmos/gaia/v20/app"
"github.com/cosmos/gaia/v20/app/sim"
gaia "github.com/cosmos/gaia/v21/app"
"github.com/cosmos/gaia/v21/app/sim"
)

// Profile with:
Expand Down
6 changes: 3 additions & 3 deletions app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import (
"github.com/cosmos/cosmos-sdk/x/simulation"
simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli"

"github.com/cosmos/gaia/v20/ante"
gaia "github.com/cosmos/gaia/v20/app"
"github.com/cosmos/gaia/v21/ante"
gaia "github.com/cosmos/gaia/v21/app"
// "github.com/cosmos/gaia/v11/app/helpers"
// "github.com/cosmos/gaia/v11/app/params"
"github.com/cosmos/gaia/v20/app/sim"
"github.com/cosmos/gaia/v21/app/sim"
)

// AppChainID hardcoded chainID for simulation
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"

"github.com/cosmos/gaia/v20/app/keepers"
"github.com/cosmos/gaia/v21/app/keepers"
)

// Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v19/constants.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package v19

import (
"github.com/cosmos/gaia/v20/app/upgrades"
"github.com/cosmos/gaia/v21/app/upgrades"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v19/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"

"github.com/cosmos/gaia/v20/app/keepers"
"github.com/cosmos/gaia/v21/app/keepers"
)

func CreateUpgradeHandler(
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v20/constants.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package v20

import (
"github.com/cosmos/gaia/v20/app/upgrades"
"github.com/cosmos/gaia/v21/app/upgrades"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v20/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"

"github.com/cosmos/gaia/v20/app/keepers"
"github.com/cosmos/gaia/v21/app/keepers"
)

// Constants for the new parameters in the v20 upgrade.
Expand Down
4 changes: 2 additions & 2 deletions app/upgrades/v20/upgrades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"

"github.com/cosmos/gaia/v20/app/helpers"
v20 "github.com/cosmos/gaia/v20/app/upgrades/v20"
"github.com/cosmos/gaia/v21/app/helpers"
v20 "github.com/cosmos/gaia/v21/app/upgrades/v20"
)

func GetTestMsgConsumerAddition() providertypes.MsgConsumerAddition { //nolint:staticcheck
Expand Down
15 changes: 15 additions & 0 deletions app/upgrades/v21/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package v21

import (
"github.com/cosmos/gaia/v21/app/upgrades"
)

const (
// UpgradeName defines the on-chain upgrade name.
UpgradeName = "v21"
)

var Upgrade = upgrades.Upgrade{
UpgradeName: UpgradeName,
CreateUpgradeHandler: CreateUpgradeHandler,
}
31 changes: 31 additions & 0 deletions app/upgrades/v21/upgrades.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package v21

import (
"context"

upgradetypes "cosmossdk.io/x/upgrade/types"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"

"github.com/cosmos/gaia/v21/app/keepers"
)

func CreateUpgradeHandler(
mm *module.Manager,
configurator module.Configurator,
keepers *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(c context.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
ctx := sdk.UnwrapSDKContext(c)
ctx.Logger().Info("Starting module migrations...")

vm, err := mm.RunMigrations(ctx, configurator, vm)
if err != nil {
return vm, err
}

ctx.Logger().Info("Upgrade v21 complete")
return vm, nil
}
}
2 changes: 1 addition & 1 deletion cmd/gaiad/cmd/bech32_convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/spf13/cobra"

addressutil "github.com/cosmos/gaia/v20/pkg/address"
addressutil "github.com/cosmos/gaia/v21/pkg/address"
)

var flagBech32Prefix = "prefix"
Expand Down
2 changes: 1 addition & 1 deletion cmd/gaiad/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import (
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"

gaia "github.com/cosmos/gaia/v20/app"
gaia "github.com/cosmos/gaia/v21/app"
)

// NewRootCmd creates a new root command for simd. It is called once in the
Expand Down
4 changes: 2 additions & 2 deletions cmd/gaiad/cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"

app "github.com/cosmos/gaia/v20/app"
"github.com/cosmos/gaia/v20/cmd/gaiad/cmd"
app "github.com/cosmos/gaia/v21/app"
"github.com/cosmos/gaia/v21/cmd/gaiad/cmd"
)

func TestRootCmdConfig(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/gaiad/cmd/testnet_set_local_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
"github.com/cosmos/cosmos-sdk/server"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
gaia "github.com/cosmos/gaia/v20/app"
gaia "github.com/cosmos/gaia/v21/app"
"github.com/spf13/cast"
"github.com/spf13/cobra"

Expand Down
4 changes: 2 additions & 2 deletions cmd/gaiad/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"

app "github.com/cosmos/gaia/v20/app"
"github.com/cosmos/gaia/v20/cmd/gaiad/cmd"
app "github.com/cosmos/gaia/v21/app"
"github.com/cosmos/gaia/v21/cmd/gaiad/cmd"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/cosmos/gaia/v20
module github.com/cosmos/gaia/v21

go 1.22.6

Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import (
paramsproptypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

gaia "github.com/cosmos/gaia/v20/app"
gaiaparams "github.com/cosmos/gaia/v20/app/params"
metaprotocoltypes "github.com/cosmos/gaia/v20/x/metaprotocols/types"
gaia "github.com/cosmos/gaia/v21/app"
gaiaparams "github.com/cosmos/gaia/v21/app/params"
metaprotocoltypes "github.com/cosmos/gaia/v21/x/metaprotocols/types"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/e2e_bank_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
authTx "github.com/cosmos/cosmos-sdk/x/auth/tx"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"

extensiontypes "github.com/cosmos/gaia/v20/x/metaprotocols/types"
extensiontypes "github.com/cosmos/gaia/v21/x/metaprotocols/types"
)

func (s *IntegrationTestSuite) testBankTokenTransfer() {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/e2e_setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import (
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

"github.com/cosmos/gaia/v20/types"
"github.com/cosmos/gaia/v21/types"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/feemarket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"

"github.com/cosmos/gaia/v20/ante"
gaiaApp "github.com/cosmos/gaia/v20/app"
"github.com/cosmos/gaia/v21/ante"
gaiaApp "github.com/cosmos/gaia/v21/app"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/ibcfee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/cosmos/gaia/v20/ante"
gaiaApp "github.com/cosmos/gaia/v20/app"
"github.com/cosmos/gaia/v21/ante"
gaiaApp "github.com/cosmos/gaia/v21/app"
)

// These integration tests were modified to work with the GaiaApp
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/interchain_security_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
crysistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

"github.com/cosmos/gaia/v20/ante"
gaiaApp "github.com/cosmos/gaia/v20/app"
"github.com/cosmos/gaia/v21/ante"
gaiaApp "github.com/cosmos/gaia/v21/app"
)

var ccvSuite *integration.CCVTestSuite
Expand Down
Loading

0 comments on commit c501b43

Please sign in to comment.