From cf69bd98b2e9e1dc4995798f60248a8b82baddce Mon Sep 17 00:00:00 2001 From: kienn6034 Date: Thu, 28 Dec 2023 10:24:50 +0700 Subject: [PATCH 1/3] chore: add terra core 2.5.0 package --- go.mod | 8 ++++++-- go.sum | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 6c0a4d12..925f51c7 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.21 require ( cosmossdk.io/math v1.2.0 cosmossdk.io/simapp v0.0.0-20230602123434-616841b9704d + cosmossdk.io/tools/rosetta v0.2.1 github.com/CosmWasm/wasmd v0.45.0 github.com/cometbft/cometbft v0.37.4 github.com/cometbft/cometbft-db v0.8.0 @@ -20,7 +21,7 @@ require ( github.com/strangelove-ventures/async-icq/v7 v7.0.0-20230413165143-a3b65ccdc897 github.com/strangelove-ventures/packet-forward-middleware/v7 v7.0.0-20230523193151-73dea436e53f github.com/stretchr/testify v1.8.4 - github.com/terra-money/alliance v0.2.2 + github.com/terra-money/alliance v0.3.2 ) require ( @@ -53,7 +54,6 @@ require ( cosmossdk.io/core v0.6.1 // indirect cosmossdk.io/depinject v1.0.0-alpha.4 // indirect cosmossdk.io/errors v1.0.0 // indirect - cosmossdk.io/tools/rosetta v0.2.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect @@ -197,6 +197,7 @@ replace ( // should be fixed after sdk 0.47.3 and gogoproto 1.4.10 // https://github.com/cosmos/gogoproto/issues/66 github.com/cosmos/gogoproto => github.com/cosmos/gogoproto v1.4.8 + // dgrijalva/jwt-go is deprecated and doesn't receive security updates. // TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134 github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 @@ -205,4 +206,7 @@ replace ( github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0 // Downgraded to avoid bugs in following commits which caused simulations to fail. github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 + + // use terra core 2.5.0 + github.com/terra-money/core/v2 => github.com/terra-money/core/v2 v2.5.0 ) diff --git a/go.sum b/go.sum index 59c9e7d9..53e5d93e 100644 --- a/go.sum +++ b/go.sum @@ -1214,8 +1214,8 @@ github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70 github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/terra-money/alliance v0.2.2 h1:uIszrik0OBk8/CP4BEp30pKtlUHXuRDj3bLZy+mKhsI= -github.com/terra-money/alliance v0.2.2/go.mod h1:MfZoYeS1+K31r2JNx+Cqk5q8d0bQFc6YSyTQN+WtMvw= +github.com/terra-money/alliance v0.3.2 h1:MuL3RBw+jXFv4io5PhaBn7jRUBvlJLUzgpD6gx4GCug= +github.com/terra-money/alliance v0.3.2/go.mod h1:HDiUexeXRUkLkLRw5jLQcHuVt1Sx43HfyVl0kfwW3JM= github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= From 6353822e00bcfb6ae52659c896210a6f177bc433 Mon Sep 17 00:00:00 2001 From: kienn6034 Date: Thu, 28 Dec 2023 10:31:07 +0700 Subject: [PATCH 2/3] feat: alliance to 0.3.2 --- app/app.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/app.go b/app/app.go index bce14aa8..0b6b475e 100644 --- a/app/app.go +++ b/app/app.go @@ -3,6 +3,12 @@ package app import ( "encoding/json" "fmt" + "io" + "net/http" + "os" + "path/filepath" + "sort" + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" @@ -41,11 +47,6 @@ import ( solomachine "github.com/cosmos/ibc-go/v7/modules/light-clients/06-solomachine" ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" icq "github.com/strangelove-ventures/async-icq/v7" - "io" - "net/http" - "os" - "path/filepath" - "sort" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" @@ -478,11 +479,12 @@ func NewMigalooApp( app.AllianceKeeper = alliancemodulekeeper.NewKeeper( appCodec, keys[alliancemoduletypes.StoreKey], - app.GetSubspace(alliancemoduletypes.ModuleName), app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.DistrKeeper, + authtypes.FeeCollectorName, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) // register the staking hooks @@ -748,7 +750,7 @@ func NewMigalooApp( transfer.NewAppModule(app.TransferKeeper), icaModule, icq.NewAppModule(app.ICQKeeper), - alliancemodule.NewAppModule(appCodec, app.AllianceKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), + alliancemodule.NewAppModule(appCodec, app.AllianceKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry, app.GetSubspace(alliancemoduletypes.ModuleName)), ibcfee.NewAppModule(app.IBCFeeKeeper), ica.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper), tokenfactory.NewAppModule(app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper), @@ -1144,7 +1146,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(icqtypes.ModuleName) paramsKeeper.Subspace(wasmtypes.ModuleName) paramsKeeper.Subspace(routertypes.ModuleName) - paramsKeeper.Subspace(alliancemoduletypes.ModuleName) + paramsKeeper.Subspace(alliancemoduletypes.ModuleName).WithKeyTable(alliancemoduletypes.ParamKeyTable()) return paramsKeeper } From cc5e0c37544c81beec5b2e52cddf9644693f8c4f Mon Sep 17 00:00:00 2001 From: kienn6034 Date: Thu, 28 Dec 2023 11:23:05 +0700 Subject: [PATCH 3/3] feat: update token factory --- app/app.go | 17 +++++++++-------- go.mod | 1 + go.sum | 6 ++++++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/app/app.go b/app/app.go index 0b6b475e..d582f5c8 100644 --- a/app/app.go +++ b/app/app.go @@ -113,8 +113,8 @@ import ( routerkeeper "github.com/strangelove-ventures/packet-forward-middleware/v7/router/keeper" routertypes "github.com/strangelove-ventures/packet-forward-middleware/v7/router/types" - bank "github.com/terra-money/alliance/custom/bank" - custombankkeeper "github.com/terra-money/alliance/custom/bank/keeper" + bank "github.com/terra-money/core/v2/custom/bank" + custombankkeeper "github.com/terra-money/core/v2/custom/bank/keeper" ibchooks "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7" ibchookskeeper "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7/keeper" @@ -125,10 +125,10 @@ import ( alliancemodulekeeper "github.com/terra-money/alliance/x/alliance/keeper" alliancemoduletypes "github.com/terra-money/alliance/x/alliance/types" - "github.com/CosmWasm/wasmd/x/tokenfactory" - bindings "github.com/CosmWasm/wasmd/x/tokenfactory/bindings" - tokenfactorykeeper "github.com/CosmWasm/wasmd/x/tokenfactory/keeper" - tokenfactorytypes "github.com/CosmWasm/wasmd/x/tokenfactory/types" + "github.com/terra-money/core/v2/x/tokenfactory" + bindings "github.com/terra-money/core/v2/x/tokenfactory/bindings" + tokenfactorykeeper "github.com/terra-money/core/v2/x/tokenfactory/keeper" + tokenfactorytypes "github.com/terra-money/core/v2/x/tokenfactory/types" // Note: please do your research before using this in production app, this is a demo and not an officially // supported IBC team implementation. It has no known issues, but do your own research before using it. @@ -453,10 +453,11 @@ func NewMigalooApp( app.TokenFactoryKeeper = tokenfactorykeeper.NewKeeper( keys[tokenfactorytypes.StoreKey], - app.GetSubspace(tokenfactorytypes.ModuleName), app.AccountKeeper, app.BankKeeper, app.DistrKeeper, + appCodec, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) app.CrisisKeeper = *crisiskeeper.NewKeeper( @@ -753,7 +754,7 @@ func NewMigalooApp( alliancemodule.NewAppModule(appCodec, app.AllianceKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry, app.GetSubspace(alliancemoduletypes.ModuleName)), ibcfee.NewAppModule(app.IBCFeeKeeper), ica.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper), - tokenfactory.NewAppModule(app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper), + tokenfactory.NewAppModule(app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(tokenfactorytypes.ModuleName)), router.NewAppModule(&app.RouterKeeper), crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), // always be last to make sure that it checks for all invariants and not only part of them ibchooks.NewAppModule(app.AccountKeeper), diff --git a/go.mod b/go.mod index 925f51c7..b8139786 100644 --- a/go.mod +++ b/go.mod @@ -22,6 +22,7 @@ require ( github.com/strangelove-ventures/packet-forward-middleware/v7 v7.0.0-20230523193151-73dea436e53f github.com/stretchr/testify v1.8.4 github.com/terra-money/alliance v0.3.2 + github.com/terra-money/core/v2 v2.0.0-00010101000000-000000000000 ) require ( diff --git a/go.sum b/go.sum index 53e5d93e..e261d352 100644 --- a/go.sum +++ b/go.sum @@ -562,6 +562,8 @@ github.com/cosmos/gogoproto v1.4.8 h1:BrHKc6WFZt8+jRV71vKSQE+JrfF+JAnzrKo2VP7wIZ github.com/cosmos/gogoproto v1.4.8/go.mod h1:hnb0DIEWTv+wdNzNcqus5xCQXq5+CXauq1FJuurRfVY= github.com/cosmos/iavl v0.20.1 h1:rM1kqeG3/HBT85vsZdoSNsehciqUQPWrR4BYmqE2+zg= github.com/cosmos/iavl v0.20.1/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.0.0 h1:i9esYyZ5ExpZOgxrLMQhY2jDTVYiaD8yUeqXN9QBgbk= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.0.0/go.mod h1:fctjEnz9xaBFOlmYYPdKL8Hs1Y3GUKilSwsJdqBb5QU= github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20230906222317-d88d4028e5c9 h1:Ji2ch8iw8qLh0xG/NY+RVsQ0tqiy+tViQxiaOHKpsw0= github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20230906222317-d88d4028e5c9/go.mod h1:JwHFbo1oX/ht4fPpnPvmhZr+dCkYK1Vihw+vZE9umR4= github.com/cosmos/ibc-go/v7 v7.3.0 h1:QtGeVMi/3JeLWuvEuC60sBHpAF40Oenx/y+bP8+wRRw= @@ -1154,6 +1156,8 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/skip-mev/pob v1.0.4 h1:Degz+Pdm9pCom16bbLawZhXi6PbYPiiJe6cGjBE5g30= +github.com/skip-mev/pob v1.0.4/go.mod h1:tpZivmkiDgCO6O79qBnK4eJQjuJeR9yUzc1jPlGaE1s= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= @@ -1216,6 +1220,8 @@ github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2l github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/terra-money/alliance v0.3.2 h1:MuL3RBw+jXFv4io5PhaBn7jRUBvlJLUzgpD6gx4GCug= github.com/terra-money/alliance v0.3.2/go.mod h1:HDiUexeXRUkLkLRw5jLQcHuVt1Sx43HfyVl0kfwW3JM= +github.com/terra-money/core/v2 v2.5.0 h1:oBmUks1xR/aQIAqoLYBK6FtINrph0RcldVpCnjEQ82Q= +github.com/terra-money/core/v2 v2.5.0/go.mod h1:kO0zDgFva90DlFTLv5W2wvnwwXABFvEsQQ59EJctjgg= github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg= github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=