Skip to content

Commit

Permalink
fix: wasm ibc transaction panic (#1816)
Browse files Browse the repository at this point in the history
* fix wasm ibc transaction panic
  • Loading branch information
jgimeno committed Mar 5, 2024
1 parent 740f161 commit 0fd5a86
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [v1.0.3](https://github.com/NibiruChain/nibiru/releases/tag/v1.0.1) - To be defined

### Fix

- [#1816](https://github.com/NibiruChain/nibiru/pull/1816) - fix(ibc): fix ibc transaction from wasm contract


## [v1.0.1](https://github.com/NibiruChain/nibiru/releases/tag/v1.0.1) - 2024-02-09

### Dependencies
Expand Down
29 changes: 14 additions & 15 deletions app/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,18 @@ func (app *NibiruApp) InitKeepers(
app.BankKeeper,
)

app.ibcTransferKeeper = ibctransferkeeper.NewKeeper(
appCodec,
keys[ibctransfertypes.StoreKey],
/* paramSubspace */ app.GetSubspace(ibctransfertypes.ModuleName),
/* ibctransfertypes.ICS4Wrapper */ app.ibcFeeKeeper,
/* ibctransfertypes.ChannelKeeper */ app.ibcKeeper.ChannelKeeper,
/* ibctransfertypes.PortKeeper */ &app.ibcKeeper.PortKeeper,
app.AccountKeeper,
app.BankKeeper,
app.ScopedTransferKeeper,
)

app.ScopedWasmKeeper = app.capabilityKeeper.ScopeToModule(wasmtypes.ModuleName)

wasmDir := filepath.Join(homePath, "data")
Expand Down Expand Up @@ -441,21 +453,6 @@ func (app *NibiruApp) InitKeepers(
app.slashingKeeper,
)

/* Create IBC module and a static IBC router */
ibcRouter := porttypes.NewRouter()

app.ibcTransferKeeper = ibctransferkeeper.NewKeeper(
appCodec,
keys[ibctransfertypes.StoreKey],
/* paramSubspace */ app.GetSubspace(ibctransfertypes.ModuleName),
/* ibctransfertypes.ICS4Wrapper */ app.ibcFeeKeeper,
/* ibctransfertypes.ChannelKeeper */ app.ibcKeeper.ChannelKeeper,
/* ibctransfertypes.PortKeeper */ &app.ibcKeeper.PortKeeper,
app.AccountKeeper,
app.BankKeeper,
app.ScopedTransferKeeper,
)

// Mock Module setup for testing IBC and also acts as the interchain accounts authentication module
// NOTE: the IBC mock keeper and application module is used only for testing core IBC. Do
// not replicate if you do not need to test core IBC or light clients.
Expand All @@ -472,6 +469,8 @@ func (app *NibiruApp) InitKeepers(
// - IBC Fee Middleware
// - Transfer

ibcRouter := porttypes.NewRouter()

// create IBC module from bottom to top of stack
var transferStack porttypes.IBCModule
transferStack = ibctransfer.NewIBCModule(app.ibcTransferKeeper)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/cosmos/cosmos-sdk v0.47.10
github.com/cosmos/go-bip39 v1.0.0
github.com/cosmos/gogoproto v1.4.10
github.com/cosmos/ibc-go/v7 v7.3.1
github.com/cosmos/ibc-go/v7 v7.3.2
github.com/gogo/protobuf v1.3.3
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,8 @@ github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoK
github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek=
github.com/cosmos/iavl v0.20.0 h1:fTVznVlepH0KK8NyKq8w+U7c2L6jofa27aFX6YGlm38=
github.com/cosmos/iavl v0.20.0/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A=
github.com/cosmos/ibc-go/v7 v7.3.1 h1:bil1IjnHdyWDASFYKfwdRiNtFP6WK3osW7QFEAgU4I8=
github.com/cosmos/ibc-go/v7 v7.3.1/go.mod h1:wvx4pPBofe5ZdMNV3OFRxSI4auEP5Qfqf8JXLLNV04g=
github.com/cosmos/ibc-go/v7 v7.3.2 h1:FeUDcBX7VYY0e0iRmcVkPPUjYfAqIc//QuHXo8JHz9c=
github.com/cosmos/ibc-go/v7 v7.3.2/go.mod h1:IMeOXb7gwpZ+/nOG5BuUkdW4weM1ezvN4PQPws4uzOI=
github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM=
github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0=
github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw=
Expand Down

0 comments on commit 0fd5a86

Please sign in to comment.