Skip to content

Commit

Permalink
naming to v2 on core (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
nghuyenthevinh2000 authored Jun 1, 2023
1 parent d616e24 commit c8a1f7f
Show file tree
Hide file tree
Showing 263 changed files with 1,689 additions and 2,286 deletions.
24 changes: 12 additions & 12 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,24 @@ import (
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

"github.com/classic-terra/core/app/keepers"
terraappparams "github.com/classic-terra/core/app/params"
"github.com/classic-terra/core/v2/app/keepers"
terraappparams "github.com/classic-terra/core/v2/app/params"

// upgrades
"github.com/classic-terra/core/app/upgrades"
v2 "github.com/classic-terra/core/app/upgrades/v2"
v3 "github.com/classic-terra/core/app/upgrades/v3"
v4 "github.com/classic-terra/core/app/upgrades/v4"
"github.com/classic-terra/core/v2/app/upgrades"
v2 "github.com/classic-terra/core/v2/app/upgrades/v2"
v3 "github.com/classic-terra/core/v2/app/upgrades/v3"
v4 "github.com/classic-terra/core/v2/app/upgrades/v4"

customante "github.com/classic-terra/core/custom/auth/ante"
customauthrest "github.com/classic-terra/core/custom/auth/client/rest"
customauthtx "github.com/classic-terra/core/custom/auth/tx"
core "github.com/classic-terra/core/types"
customante "github.com/classic-terra/core/v2/custom/auth/ante"
customauthrest "github.com/classic-terra/core/v2/custom/auth/client/rest"
customauthtx "github.com/classic-terra/core/v2/custom/auth/tx"
core "github.com/classic-terra/core/v2/types"

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

// unnamed import of statik for swagger UI support
_ "github.com/classic-terra/core/client/docs/statik"
_ "github.com/classic-terra/core/v2/client/docs/statik"
)

const appName = "TerraApp"
Expand Down Expand Up @@ -303,7 +303,7 @@ func (app *TerraApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abc
panic(err)
}
if ctx.ChainID() == core.ColumbusChainID {
panic("Must use v1.0.x for importing the columbus genesis (https://github.com/classic-terra/core/releases/)")
panic("Must use v1.0.x for importing the columbus genesis (https://github.com/classic-terra/core/v2/releases/)")
}
app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap())
return app.mm.InitGenesis(ctx, app.appCodec, genesisState)
Expand Down
2 changes: 1 addition & 1 deletion app/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"github.com/cosmos/cosmos-sdk/codec/legacy"
"github.com/cosmos/cosmos-sdk/std"

"github.com/classic-terra/core/app/params"
"github.com/classic-terra/core/v2/app/params"
)

var legacyCodecRegistered = false
Expand Down
2 changes: 1 addition & 1 deletion app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/staking"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

oracletypes "github.com/classic-terra/core/x/oracle/types"
oracletypes "github.com/classic-terra/core/v2/x/oracle/types"
)

// ExportAppStateAndValidators exports the state of the application for a genesis
Expand Down
22 changes: 11 additions & 11 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ import (

"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
customwasmkeeper "github.com/classic-terra/core/custom/wasm/keeper"
terrawasm "github.com/classic-terra/core/wasmbinding"

feesharekeeper "github.com/classic-terra/core/x/feeshare/keeper"
feesharetypes "github.com/classic-terra/core/x/feeshare/types"
marketkeeper "github.com/classic-terra/core/x/market/keeper"
markettypes "github.com/classic-terra/core/x/market/types"
oraclekeeper "github.com/classic-terra/core/x/oracle/keeper"
oracletypes "github.com/classic-terra/core/x/oracle/types"
treasurykeeper "github.com/classic-terra/core/x/treasury/keeper"
treasurytypes "github.com/classic-terra/core/x/treasury/types"
customwasmkeeper "github.com/classic-terra/core/v2/custom/wasm/keeper"
terrawasm "github.com/classic-terra/core/v2/wasmbinding"

feesharekeeper "github.com/classic-terra/core/v2/x/feeshare/keeper"
feesharetypes "github.com/classic-terra/core/v2/x/feeshare/types"
marketkeeper "github.com/classic-terra/core/v2/x/market/keeper"
markettypes "github.com/classic-terra/core/v2/x/market/types"
oraclekeeper "github.com/classic-terra/core/v2/x/oracle/keeper"
oracletypes "github.com/classic-terra/core/v2/x/oracle/types"
treasurykeeper "github.com/classic-terra/core/v2/x/treasury/keeper"
treasurytypes "github.com/classic-terra/core/v2/x/treasury/types"
)

type AppKeepers struct {
Expand Down
8 changes: 4 additions & 4 deletions app/keepers/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

wasm "github.com/CosmWasm/wasmd/x/wasm"
feesharetypes "github.com/classic-terra/core/x/feeshare/types"
markettypes "github.com/classic-terra/core/x/market/types"
oracletypes "github.com/classic-terra/core/x/oracle/types"
treasurytypes "github.com/classic-terra/core/x/treasury/types"
feesharetypes "github.com/classic-terra/core/v2/x/feeshare/types"
markettypes "github.com/classic-terra/core/v2/x/market/types"
oracletypes "github.com/classic-terra/core/v2/x/oracle/types"
treasurytypes "github.com/classic-terra/core/v2/x/treasury/types"
)

func (appKeepers *AppKeepers) GenerateKeys() {
Expand Down
4 changes: 2 additions & 2 deletions app/keepers/routers.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"
porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types"

"github.com/classic-terra/core/x/treasury"
treasurytypes "github.com/classic-terra/core/x/treasury/types"
"github.com/classic-terra/core/v2/x/treasury"
treasurytypes "github.com/classic-terra/core/v2/x/treasury/types"
distr "github.com/cosmos/cosmos-sdk/x/distribution"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
Expand Down
4 changes: 2 additions & 2 deletions app/legacy/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
"github.com/cosmos/cosmos-sdk/x/genutil/types"
staking "github.com/cosmos/cosmos-sdk/x/staking/types"

legacy05 "github.com/classic-terra/core/app/legacy/v05"
oracletypes "github.com/classic-terra/core/x/oracle/types"
legacy05 "github.com/classic-terra/core/v2/app/legacy/v05"
oracletypes "github.com/classic-terra/core/v2/x/oracle/types"
)

const (
Expand Down
32 changes: 16 additions & 16 deletions app/legacy/v05/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ import (
v038staking "github.com/cosmos/cosmos-sdk/x/staking/legacy/v038"
v040staking "github.com/cosmos/cosmos-sdk/x/staking/legacy/v040"

v039authcustom "github.com/classic-terra/core/custom/auth/legacy/v039"
v040authcustom "github.com/classic-terra/core/custom/auth/legacy/v040"
v036distrcustom "github.com/classic-terra/core/custom/distribution/legacy/v036"
v036govcustom "github.com/classic-terra/core/custom/gov/legacy/v036"
v043govcustom "github.com/classic-terra/core/custom/gov/legacy/v043"
v036paramscustom "github.com/classic-terra/core/custom/params/legacy/v036"
v038upgradecustom "github.com/classic-terra/core/custom/upgrade/legacy/v038"

v043authz "github.com/classic-terra/core/custom/authz/legacy/v043"
v04market "github.com/classic-terra/core/x/market/legacy/v04"
v05market "github.com/classic-terra/core/x/market/legacy/v05"
v04msgauth "github.com/classic-terra/core/x/msgauth/legacy/v04"
v04oracle "github.com/classic-terra/core/x/oracle/legacy/v04"
v05oracle "github.com/classic-terra/core/x/oracle/legacy/v05"
v04treasury "github.com/classic-terra/core/x/treasury/legacy/v04"
v05treasury "github.com/classic-terra/core/x/treasury/legacy/v05"
v039authcustom "github.com/classic-terra/core/v2/custom/auth/legacy/v039"
v040authcustom "github.com/classic-terra/core/v2/custom/auth/legacy/v040"
v036distrcustom "github.com/classic-terra/core/v2/custom/distribution/legacy/v036"
v036govcustom "github.com/classic-terra/core/v2/custom/gov/legacy/v036"
v043govcustom "github.com/classic-terra/core/v2/custom/gov/legacy/v043"
v036paramscustom "github.com/classic-terra/core/v2/custom/params/legacy/v036"
v038upgradecustom "github.com/classic-terra/core/v2/custom/upgrade/legacy/v038"

v043authz "github.com/classic-terra/core/v2/custom/authz/legacy/v043"
v04market "github.com/classic-terra/core/v2/x/market/legacy/v04"
v05market "github.com/classic-terra/core/v2/x/market/legacy/v05"
v04msgauth "github.com/classic-terra/core/v2/x/msgauth/legacy/v04"
v04oracle "github.com/classic-terra/core/v2/x/oracle/legacy/v04"
v05oracle "github.com/classic-terra/core/v2/x/oracle/legacy/v05"
v04treasury "github.com/classic-terra/core/v2/x/treasury/legacy/v04"
v05treasury "github.com/classic-terra/core/v2/x/treasury/legacy/v05"
)

func migrateGenutil(oldGenState v039genutil.GenesisState) *types.GenesisState {
Expand Down
54 changes: 27 additions & 27 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,39 +44,39 @@ import (
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

terraappparams "github.com/classic-terra/core/app/params"
terraappparams "github.com/classic-terra/core/v2/app/params"

customauth "github.com/classic-terra/core/custom/auth"
customauthsim "github.com/classic-terra/core/custom/auth/simulation"
customauthz "github.com/classic-terra/core/custom/authz"
custombank "github.com/classic-terra/core/custom/bank"
customcrisis "github.com/classic-terra/core/custom/crisis"
customdistr "github.com/classic-terra/core/custom/distribution"
customevidence "github.com/classic-terra/core/custom/evidence"
customfeegrant "github.com/classic-terra/core/custom/feegrant"
customgov "github.com/classic-terra/core/custom/gov"
custommint "github.com/classic-terra/core/custom/mint"
customparams "github.com/classic-terra/core/custom/params"
customslashing "github.com/classic-terra/core/custom/slashing"
customstaking "github.com/classic-terra/core/custom/staking"
customupgrade "github.com/classic-terra/core/custom/upgrade"
customwasm "github.com/classic-terra/core/custom/wasm"
customauth "github.com/classic-terra/core/v2/custom/auth"
customauthsim "github.com/classic-terra/core/v2/custom/auth/simulation"
customauthz "github.com/classic-terra/core/v2/custom/authz"
custombank "github.com/classic-terra/core/v2/custom/bank"
customcrisis "github.com/classic-terra/core/v2/custom/crisis"
customdistr "github.com/classic-terra/core/v2/custom/distribution"
customevidence "github.com/classic-terra/core/v2/custom/evidence"
customfeegrant "github.com/classic-terra/core/v2/custom/feegrant"
customgov "github.com/classic-terra/core/v2/custom/gov"
custommint "github.com/classic-terra/core/v2/custom/mint"
customparams "github.com/classic-terra/core/v2/custom/params"
customslashing "github.com/classic-terra/core/v2/custom/slashing"
customstaking "github.com/classic-terra/core/v2/custom/staking"
customupgrade "github.com/classic-terra/core/v2/custom/upgrade"
customwasm "github.com/classic-terra/core/v2/custom/wasm"

wasmclient "github.com/CosmWasm/wasmd/x/wasm/client"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/classic-terra/core/x/feeshare"
feesharetypes "github.com/classic-terra/core/x/feeshare/types"
"github.com/classic-terra/core/x/market"
markettypes "github.com/classic-terra/core/x/market/types"
"github.com/classic-terra/core/x/oracle"
oracletypes "github.com/classic-terra/core/x/oracle/types"
"github.com/classic-terra/core/x/treasury"
treasuryclient "github.com/classic-terra/core/x/treasury/client"
treasurytypes "github.com/classic-terra/core/x/treasury/types"
"github.com/classic-terra/core/x/vesting"
"github.com/classic-terra/core/v2/x/feeshare"
feesharetypes "github.com/classic-terra/core/v2/x/feeshare/types"
"github.com/classic-terra/core/v2/x/market"
markettypes "github.com/classic-terra/core/v2/x/market/types"
"github.com/classic-terra/core/v2/x/oracle"
oracletypes "github.com/classic-terra/core/v2/x/oracle/types"
"github.com/classic-terra/core/v2/x/treasury"
treasuryclient "github.com/classic-terra/core/v2/x/treasury/client"
treasurytypes "github.com/classic-terra/core/v2/x/treasury/types"
"github.com/classic-terra/core/v2/x/vesting"

// unnamed import of statik for swagger UI support
_ "github.com/classic-terra/core/client/docs/statik"
_ "github.com/classic-terra/core/v2/client/docs/statik"

"github.com/CosmWasm/wasmd/x/wasm"
)
Expand Down
4 changes: 2 additions & 2 deletions app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"time"

"github.com/CosmWasm/wasmd/x/wasm"
terraapp "github.com/classic-terra/core/app"
helpers "github.com/classic-terra/core/app/testing"
terraapp "github.com/classic-terra/core/v2/app"
helpers "github.com/classic-terra/core/v2/app/testing"
"github.com/cosmos/cosmos-sdk/codec"

"github.com/stretchr/testify/require"
Expand Down
4 changes: 2 additions & 2 deletions app/testing/test_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"time"

"github.com/CosmWasm/wasmd/x/wasm"
"github.com/classic-terra/core/app"
appparams "github.com/classic-terra/core/app/params"
"github.com/classic-terra/core/v2/app"
appparams "github.com/classic-terra/core/v2/app/params"
"github.com/cosmos/cosmos-sdk/baseapp"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
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 (
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
abci "github.com/tendermint/tendermint/abci/types"

"github.com/classic-terra/core/app/keepers"
"github.com/classic-terra/core/v2/app/keepers"
)

// BaseAppParamManager defines an interrace that BaseApp is expected to fullfil
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v2/constants.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package v2

import (
"github.com/classic-terra/core/app/upgrades"
"github.com/classic-terra/core/v2/app/upgrades"
store "github.com/cosmos/cosmos-sdk/store/types"
)

Expand Down
6 changes: 3 additions & 3 deletions app/upgrades/v2/upgrades.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package v2

import (
"github.com/classic-terra/core/app/keepers"
"github.com/classic-terra/core/app/upgrades"
"github.com/classic-terra/core/v2/app/keepers"
"github.com/classic-terra/core/v2/app/upgrades"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

feesharetypes "github.com/classic-terra/core/x/feeshare/types"
feesharetypes "github.com/classic-terra/core/v2/x/feeshare/types"
)

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

import (
"github.com/classic-terra/core/app/upgrades"
"github.com/classic-terra/core/v2/app/upgrades"
store "github.com/cosmos/cosmos-sdk/store/types"
)

Expand Down
4 changes: 2 additions & 2 deletions app/upgrades/v3/upgrades.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package v3

import (
"github.com/classic-terra/core/app/keepers"
"github.com/classic-terra/core/app/upgrades"
"github.com/classic-terra/core/v2/app/keepers"
"github.com/classic-terra/core/v2/app/upgrades"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
Expand Down
4 changes: 2 additions & 2 deletions app/upgrades/v4/constants.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package v3

import (
"github.com/classic-terra/core/app/upgrades"
feesharetypes "github.com/classic-terra/core/x/feeshare/types"
"github.com/classic-terra/core/v2/app/upgrades"
feesharetypes "github.com/classic-terra/core/v2/x/feeshare/types"
store "github.com/cosmos/cosmos-sdk/store/types"
icahosttypes "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/host/types"
)
Expand Down
4 changes: 2 additions & 2 deletions app/upgrades/v4/upgrades.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package v3

import (
"github.com/classic-terra/core/app/keepers"
"github.com/classic-terra/core/app/upgrades"
"github.com/classic-terra/core/v2/app/keepers"
"github.com/classic-terra/core/v2/app/upgrades"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/staking/keeper"
Expand Down
2 changes: 1 addition & 1 deletion cmd/terrad/genaccounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/genutil"
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"

vestingtypes "github.com/classic-terra/core/x/vesting/types"
vestingtypes "github.com/classic-terra/core/v2/x/vesting/types"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cmd/terrad/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/cosmos/cosmos-sdk/server"
svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"

terraapp "github.com/classic-terra/core/app"
terraapp "github.com/classic-terra/core/v2/app"
)

func main() {
Expand Down
10 changes: 5 additions & 5 deletions cmd/terrad/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ import (
"github.com/cosmos/cosmos-sdk/x/crisis"
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"

terraapp "github.com/classic-terra/core/app"
terralegacy "github.com/classic-terra/core/app/legacy"
"github.com/classic-terra/core/app/params"
authcustomcli "github.com/classic-terra/core/custom/auth/client/cli"
core "github.com/classic-terra/core/types"
terraapp "github.com/classic-terra/core/v2/app"
terralegacy "github.com/classic-terra/core/v2/app/legacy"
"github.com/classic-terra/core/v2/app/params"
authcustomcli "github.com/classic-terra/core/v2/custom/auth/client/cli"
core "github.com/classic-terra/core/v2/types"

"github.com/CosmWasm/wasmd/x/wasm"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
Expand Down
2 changes: 1 addition & 1 deletion cmd/terrad/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

core "github.com/classic-terra/core/types"
core "github.com/classic-terra/core/v2/types"
)

var (
Expand Down
3 changes: 2 additions & 1 deletion contrib/updates/prepare_cosmovisor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
# These fields should be fetched automatically in the future
# Need to do more upgrade to see upgrade patterns
OLD_VERSION=v2.0.1
SOFTWARE_UPGRADE_NAME=$(ls -td -- ./app/upgrades/* | head -n 1 | cut -d'/' -f4)
# this command will retrieve the folder with the largest number in format v<number>
SOFTWARE_UPGRADE_NAME=$(ls -d -- ./app/upgrades/v* | sort -Vr | head -n 1 | xargs basename)
BUILDDIR=$1
TESTNET_NVAL=$2
TESTNET_CHAINID=$3
Expand Down
4 changes: 2 additions & 2 deletions contrib/updates/upgrade-test.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

# should make this auto fetch upgrade name from app upgrades once many upgrades have been done
# this command will fetch the latest upgrade folder by time modified. So, there could be case that v1 is later modified than v2 which will cause error
SOFTWARE_UPGRADE_NAME=$(ls -td -- ./app/upgrades/*/ | head -n 1 | xargs basename)
# this command will retrieve the folder with the largest number in format v<number>
SOFTWARE_UPGRADE_NAME=$(ls -d -- ./app/upgrades/v* | sort -Vr | head -n 1 | xargs basename)
NODE1_HOME=node1/terrad
BINARY_OLD="docker exec terradnode1 ./old/terrad"
TESTNET_NVAL=${1:-7}
Expand Down
Loading

0 comments on commit c8a1f7f

Please sign in to comment.