Skip to content

Commit

Permalink
migrate staking (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
alchemist-ti authored May 31, 2023
1 parent 5ea15cb commit 301b9c4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions app/testing/test_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ func genesisStateWithValSet(t *testing.T,
defaultStParams.MaxEntries,
defaultStParams.HistoricalEntries,
appparams.BondDenom,
defaultStParams.MinCommissionRate,
)

// set validators and delegations
Expand Down
7 changes: 6 additions & 1 deletion app/upgrades/v4/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,21 @@ import (
"github.com/classic-terra/core/app/upgrades"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/staking/keeper"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

func CreateV4UpgradeHandler(
mm *module.Manager,
cfg module.Configurator,
_ upgrades.BaseAppParamManager,
_ *keepers.AppKeepers,
keepers *keepers.AppKeepers,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
// to run staking store migration
stakingKeeper := keepers.StakingKeeper
stkingMigrator := keeper.NewMigrator(stakingKeeper)
stkingMigrator.Migrate13to14(ctx)
// to run wasm store migration
return mm.RunMigrations(ctx, cfg, fromVM)
}
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module github.com/classic-terra/core
require (
github.com/CosmWasm/wasmd v0.30.0
github.com/CosmWasm/wasmvm v1.1.1
github.com/cosmos/cosmos-sdk v0.45.13
github.com/cosmos/cosmos-sdk v0.45.14
github.com/cosmos/gogoproto v1.4.4
github.com/cosmos/ibc-go/v4 v4.3.1
github.com/gogo/protobuf v1.3.3
Expand Down Expand Up @@ -132,7 +132,7 @@ replace (
github.com/CosmWasm/wasmd => github.com/classic-terra/wasmd v0.30.0-terra.1
github.com/aws/aws-sdk-go v1.25.48 => github.com/aws/aws-sdk-go v1.33.0
github.com/aws/aws-sdk-go v1.27.0 => github.com/aws/aws-sdk-go v1.33.0
github.com/cosmos/cosmos-sdk => github.com/classic-terra/cosmos-sdk v0.45.13-classic
github.com/cosmos/cosmos-sdk => github.com/classic-terra/cosmos-sdk v0.45.14-classic
github.com/cosmos/ledger-cosmos-go => github.com/terra-money/ledger-terra-go v0.11.2
github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf => github.com/docker/docker v1.6.1
github.com/ethereum/go-ethereum v1.9.25 => github.com/ethereum/go-ethereum v1.10.9
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag=
github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I=
github.com/classic-terra/cosmos-sdk v0.45.13-classic h1:gJ1waM0wDVoa4XpJqTn/AvtUOcjJUohnwiG9haiAIuE=
github.com/classic-terra/cosmos-sdk v0.45.13-classic/go.mod h1:KaUwQKijD7mOiKnPa/7JOJoGfDt4Mq+1CGlODMHPmfM=
github.com/classic-terra/cosmos-sdk v0.45.14-classic h1:R3WBEoqnBDGef3LCCq0uTWEqFO8pwwqkIv3nQWv5Z+E=
github.com/classic-terra/cosmos-sdk v0.45.14-classic/go.mod h1:KaUwQKijD7mOiKnPa/7JOJoGfDt4Mq+1CGlODMHPmfM=
github.com/classic-terra/tendermint v0.34.24-terra.0 h1:ZGaJpmKfxjlmmLO80t03jlK2SBQfJKlLsF+ItDbXtko=
github.com/classic-terra/tendermint v0.34.24-terra.0/go.mod h1:rXVrl4OYzmIa1I91av3iLv2HS0fGSiucyW9J4aMTpKI=
github.com/classic-terra/wasmd v0.30.0-terra.1 h1:Qc3zlrMpzFUd/wUAQ4fceiVbV+uCXRyT3QhUt/wMPKM=
Expand Down
5 changes: 4 additions & 1 deletion scripts/run-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ BINARY=$1
# check DENOM is set. If not, set to uluna
DENOM=${2:-uluna}

COMMISSION_RATE=0.01
COMMISSION_MAX_RATE=0.02

SED_BINARY=sed
# check if this is OS X
if [[ "$OSTYPE" == "darwin"* ]]; then
Expand Down Expand Up @@ -61,7 +64,7 @@ $SED_BINARY -i '0,/enable = false/s//enable = true/' $HOME/config/app.toml
$SED_BINARY -i 's/swagger = false/swagger = true/' $HOME/config/app.toml

# Sign genesis transaction
$BINARY gentx $KEY "1000000${DENOM}" --keyring-backend $KEYRING --chain-id $CHAIN_ID --home $HOME
$BINARY gentx $KEY "1000000${DENOM}" --commission-rate=$COMMISSION_RATE --commission-max-rate=$COMMISSION_MAX_RATE --keyring-backend $KEYRING --chain-id $CHAIN_ID --home $HOME

# Collect genesis tx
$BINARY collect-gentxs --home $HOME
Expand Down

0 comments on commit 301b9c4

Please sign in to comment.