From 97b6b38240b2b234ed2fda9137f5c1d8001199b1 Mon Sep 17 00:00:00 2001 From: Michael Tsitrin <114929630+mtsitrin@users.noreply.github.com> Date: Wed, 9 Oct 2024 18:24:35 +0300 Subject: [PATCH] feat(genesis_bridge): update to use new genesis bridge (#143) --- app/app.go | 15 ++++++++++----- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/app/app.go b/app/app.go index 8ef159a..e5f01c5 100644 --- a/app/app.go +++ b/app/app.go @@ -508,6 +508,8 @@ func NewRollapp( keys[hubgentypes.StoreKey], app.GetSubspace(hubgentypes.ModuleName), app.AccountKeeper, + app.BankKeeper, + app.MintKeeper, ) app.HubKeeper = hubkeeper.NewKeeper( @@ -515,21 +517,24 @@ func NewRollapp( keys[hubtypes.StoreKey], ) - denomMetadataMiddleware := denommetadata.NewICS4Wrapper( + var ics4Wrapper ibcporttypes.ICS4Wrapper + // The IBC tranfer submit is wrapped with the following middlewares: + // - denom metadata middleware + ics4Wrapper = denommetadata.NewICS4Wrapper( app.IBCKeeper.ChannelKeeper, app.HubKeeper, app.BankKeeper, app.HubGenesisKeeper.GetState, ) - - genesisTransfersBlocker := hubgenkeeper.NewICS4Wrapper(denomMetadataMiddleware, app.HubGenesisKeeper) // ICS4 Wrapper: claims IBC middleware + // - genesis bridge - IBC transfer disabled until genesis bridge protocol completes + ics4Wrapper = hubgenkeeper.NewICS4Wrapper(ics4Wrapper, app.HubGenesisKeeper) // Create Transfer Keepers app.TransferKeeper = ibctransferkeeper.NewKeeper( appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName), - genesisTransfersBlocker, + ics4Wrapper, app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, app.AccountKeeper, @@ -551,9 +556,9 @@ func NewRollapp( transferStack = hubgenkeeper.NewIBCModule( transferStack, - app.TransferKeeper, app.HubGenesisKeeper, app.BankKeeper, + app.IBCKeeper.ChannelKeeper, ) app.CallbackKeeper = callbackKeeper.NewKeeper( diff --git a/go.mod b/go.mod index 78ce6a5..717daf7 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/cosmos/gogoproto v1.5.0 github.com/cosmos/ibc-go/v6 v6.3.0 github.com/dvsekhvalnov/jose2go v1.5.0 - github.com/dymensionxyz/dymension-rdk v1.6.1-0.20240930130421-82c4d5f8c093 + github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241009122948-623826e0daa4 github.com/dymensionxyz/dymint v1.2.0-rc01.0.20240919105350-66f9b353655d github.com/ethereum/go-ethereum v1.12.0 github.com/evmos/evmos/v12 v12.1.6 diff --git a/go.sum b/go.sum index 4a3dafb..d4a419a 100644 --- a/go.sum +++ b/go.sum @@ -570,8 +570,8 @@ github.com/dymensionxyz/cometbft v0.34.29-0.20240906143736-1e3959c2826e h1:A5FIv github.com/dymensionxyz/cometbft v0.34.29-0.20240906143736-1e3959c2826e/go.mod h1:L9shMfbkZ8B+7JlwANEr+NZbBcn+hBpwdbeYvA5rLCw= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20240821081230-b4018b2bac13 h1:u5yeve5jZR6TdRjjR+vYT/8PWKbhwCZxUmAu+/Tnxyg= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20240821081230-b4018b2bac13/go.mod h1:jabDQYXrccscSE0fXkh7eQFYPWJCRiuWKonFGObVq6s= -github.com/dymensionxyz/dymension-rdk v1.6.1-0.20240930130421-82c4d5f8c093 h1:qIEM9vKVBPfBkNTDEI0aKXzNdJ/LC9m0P5jiNM7SqU4= -github.com/dymensionxyz/dymension-rdk v1.6.1-0.20240930130421-82c4d5f8c093/go.mod h1:lMDz6B2DeH5SJeUAtFwxNeD8g1sj0cJGiDJf4rOz5tg= +github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241009122948-623826e0daa4 h1:NZdp1MgtkMOdTmJmS4gslWZz+ko3s7ykHc7UZroUYEA= +github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241009122948-623826e0daa4/go.mod h1:lMDz6B2DeH5SJeUAtFwxNeD8g1sj0cJGiDJf4rOz5tg= github.com/dymensionxyz/dymint v1.2.0-rc01.0.20240919105350-66f9b353655d h1:YZ49Dd17SA//VBTKVncav7DhV5VE6M9n4a9Slm/hQeM= github.com/dymensionxyz/dymint v1.2.0-rc01.0.20240919105350-66f9b353655d/go.mod h1:eEUBqDHi7EiO3CK1Fqct5joa5UeNzcEDJnXzvXuP5oA= github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.4.2 h1:aVP3off7u2vsvRH7lHAUPTLdf9/AfnzC/rvvi0wC/co=