From cc5e0c37544c81beec5b2e52cddf9644693f8c4f Mon Sep 17 00:00:00 2001 From: kienn6034 Date: Thu, 28 Dec 2023 11:23:05 +0700 Subject: [PATCH] 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=