Skip to content

Commit

Permalink
chore: update ibc and related dependencies (#1959)
Browse files Browse the repository at this point in the history
* feat: bump ibc-go to v6

* update methods

* add upgrade logic

* update tests

* use Transfer rpc

* update bech32-ibc

* bump gravity-bridge

* bump wasmd

* update app wiring for new cosmwams

* release notes update

* fix tests

* fix ics20 tests

* reset readme

* update imports

* lint

* fix experimental build config

* fix new test

* fix util tests
  • Loading branch information
robert-zaremba authored Mar 30, 2023
1 parent e3bd379 commit 073468e
Show file tree
Hide file tree
Showing 19 changed files with 173 additions and 195 deletions.
53 changes: 26 additions & 27 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,46 @@ Release Procedure is defined in the [CONTRIBUTING](CONTRIBUTING.md#release-proce

Highlights:

- IBC updated to `ibc-go v6.1`. That also triggered our wasmvm dependency update (see `libwasmvm` update in Validators section)
- ICA

### Upgrade instructions
See [CHANGELOG](https://github.com/umee-network/umee/blob/v4.3.0/CHANGELOG.md) for a full list of changes.

### Validators

### libwasmvm update

Our dependencies have been updated. Now the binary requires `libwasmvm v1.2.1`. When you build the binary from source on the server machine you probably don't need any change. However when you download a binary from GitHub, or from other source, make sure you update the `/usr/lib/libwasmvm.<cpu_arch>.so`. For example:

- copy from `$GOPATH/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.2.1/internal/api/libwasmvm.$(uname -m).so`
- or download from github `wget https://raw.githubusercontent.com/CosmWasm/wasmvm/v1.2.1/internal/api/libwasmvm.$(uname -m).so -O /lib/libwasmvm.$(uname -m).so`

You don't need to do anything if you are using our Docker image.

- Note: Skip this step if you build binary from source and are able to properly link libwasmvm.
### Min Gas Prices

- Download `libwasmvm`:
Same as with v4.2 release. We request all validators set a `minimum-gas-prices` setting (in app `config/app.toml` file, general settings). We recommend `0.1uumee` which is equal the current Keplr _average_ setting:

```bash
$ wget https://raw.githubusercontent.com/CosmWasm/wasmvm/v1.1.1/internal/api/libwasmvm.$(uname -m).so -O /lib/libwasmvm.$(uname -m).so
```
```
minimum-gas-prices = "0.1uumee"
```

You MUST also set the related parameter when starting Peggo `--cosmos-gas-prices="0.1uumee"`

### Upgrade instructions

- Download latest binary or build from source.
- Run the binary to make sure it works for you: `umeed --version`
- Make sure `libwasmvm.$(uname -m).so` is properly linked
- Run the binary to make sure it works for you: `umeed --version`
- Wait for software upgrade proposal to pass and trigger the chain upgrade.
- Swap binaries.
- Restart the chain.
- Ensure latest Peggo (v1.4.0) is running
- Ensure latest Price Feeder (v2.1.0) is running and check your price feeder config is up to date.
- Restart the chain.

You can use Cosmovisor → see [instructions](https://github.com/umee-network/umee/#cosmovisor).

NOTE: BEFORE the upgrade, make sure the binary is working and libwasmvm is in your system. You can test it by running `./umeed-v4.3.0 version`.
NOTE: BEFORE the upgrade, make sure the binary is working and libwasmvm is in your system. You can test it by running `./umeed-v4.3.0 --version`.

#### Docker

Expand All @@ -55,24 +72,6 @@ Other highlights:

See [CHANGELOG](https://github.com/umee-network/umee/blob/v4.2.0/CHANGELOG.md) for a full list of changes.

### Validators

Given recent spam transactions in Umee, we request all validators set a `minimum-gas-prices` setting (in app `config/app.toml` file, general settings). We recommend `0.1uumee` which is equal the current Keplr _average_ setting:

```
minimum-gas-prices = "0.1uumee"
```

In next release we will be enforcing the minimum setting.

#### Peggo

Related to min gas price updates, you MUST also set the related parameter when starting Peggo:

```
--cosmos-gas-prices="0.1uumee"
```

## v4.1.0

This release contains several fixes designed to make lending and borrowing more resilient during price outages. Short summary of changes is available in the [Changelog](./CHANGELOG.md)
Expand Down
4 changes: 2 additions & 2 deletions ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
cosmosante "github.com/cosmos/cosmos-sdk/x/auth/ante"
"github.com/cosmos/cosmos-sdk/x/auth/signing"
"github.com/cosmos/cosmos-sdk/x/auth/types"
ibcante "github.com/cosmos/ibc-go/v5/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v5/modules/core/keeper"
ibcante "github.com/cosmos/ibc-go/v6/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v6/modules/core/keeper"
)

type HandlerOptions struct {
Expand Down
47 changes: 29 additions & 18 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,17 @@ import (
gravity "github.com/Gravity-Bridge/Gravity-Bridge/module/x/gravity"
gravitykeeper "github.com/Gravity-Bridge/Gravity-Bridge/module/x/gravity/keeper"
gravitytypes "github.com/Gravity-Bridge/Gravity-Bridge/module/x/gravity/types"
ibctransfer "github.com/cosmos/ibc-go/v5/modules/apps/transfer"
ibctransferkeeper "github.com/cosmos/ibc-go/v5/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v5/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v5/modules/core"
ibcclient "github.com/cosmos/ibc-go/v5/modules/core/02-client"
ibcclientclient "github.com/cosmos/ibc-go/v5/modules/core/02-client/client"
ibcclienttypes "github.com/cosmos/ibc-go/v5/modules/core/02-client/types"
ibcporttypes "github.com/cosmos/ibc-go/v5/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v5/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v5/modules/core/keeper"
ibctesting "github.com/cosmos/ibc-go/v5/testing/types"
ibctransfer "github.com/cosmos/ibc-go/v6/modules/apps/transfer"
ibctransferkeeper "github.com/cosmos/ibc-go/v6/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v6/modules/core"
ibcclient "github.com/cosmos/ibc-go/v6/modules/core/02-client"
ibcclientclient "github.com/cosmos/ibc-go/v6/modules/core/02-client/client"
ibcclienttypes "github.com/cosmos/ibc-go/v6/modules/core/02-client/types"
ibcporttypes "github.com/cosmos/ibc-go/v6/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v6/modules/core/24-host"
ibckeeper "github.com/cosmos/ibc-go/v6/modules/core/keeper"
ibctesting "github.com/cosmos/ibc-go/v6/testing/types"
"github.com/osmosis-labs/bech32-ibc/x/bech32ibc"
bech32ibckeeper "github.com/osmosis-labs/bech32-ibc/x/bech32ibc/keeper"
bech32ibctypes "github.com/osmosis-labs/bech32-ibc/x/bech32ibc/types"
Expand Down Expand Up @@ -541,15 +541,26 @@ func New(
ibctransfer.NewIBCModule(ibcTransferKeeper),
app.UIBCTransferKeeper,
)

transferStack = uibcquota.NewIBCMiddleware(transferStack, app.UIbcQuotaKeeper, appCodec)

// Create IBC Router
// create static IBC router, add transfer route, then set and seal it
ibcRouter := ibcporttypes.NewRouter()
// Add transfer stack to IBC Router
ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferStack)
ibcRouter.AddRoute(wasm.ModuleName, wasm.NewIBCHandler(app.WasmKeeper, app.IBCKeeper.ChannelKeeper))
/*
Create fee enabled wasm ibc Stack
var wasmStack ibcporttypes.IBCModule
wasmStack = wasm.NewIBCHandler(app.WasmKeeper, app.IBCKeeper.ChannelKeeper, app.IBCFeeKeeper)
wasmStack = ibcfee.NewIBCMiddleware(wasmStack, app.IBCFeeKeeper)
*/

// Create static IBC router, add app routes, then set and seal it
ibcRouter := ibcporttypes.NewRouter().
AddRoute(ibctransfertypes.ModuleName, transferStack)
/*
// we will add cosmwasm IBC routing later
AddRoute(wasm.ModuleName, wasmStack).
// we don't integrate the controller now
AddRoute(intertxtypes.ModuleName, icaControllerStack).
AddRoute(icacontrollertypes.SubModuleName, icaControllerStack).
AddRoute(icahosttypes.SubModuleName, icaHostStack)
*/
app.IBCKeeper.SetRouter(ibcRouter)

app.bech32IbcKeeper = *bech32ibckeeper.NewKeeper(
Expand Down
5 changes: 2 additions & 3 deletions app/experimental_appconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,9 @@ func (app *UmeeApp) customKeepers(
app.DistrKeeper,
app.IBCKeeper.ChannelKeeper,
&app.IBCKeeper.PortKeeper,
app.ScopedWasmKeeper,
&app.UIBCTransferKeeper.Keeper,
app.ScopedWasmKeeper, // capabilities
&app.UIBCTransferKeeper.Keeper, // ICS20TransferPortSource
app.MsgServiceRouter(),
app.GRPCQueryRouter(),
wasmDir,
wasmConfig,
availableCapabilities,
Expand Down
15 changes: 8 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ go 1.19
require (
cosmossdk.io/errors v1.0.0-beta.7
cosmossdk.io/math v1.0.0
github.com/CosmWasm/wasmd v0.29.0
github.com/CosmWasm/wasmd v0.31.0
github.com/Gravity-Bridge/Gravity-Bridge/module v1.5.3
github.com/cosmos/cosmos-proto v1.0.0-beta.3
github.com/cosmos/cosmos-sdk v0.46.11
github.com/cosmos/go-bip39 v1.0.0
github.com/cosmos/ibc-go/v5 v5.2.0
github.com/cosmos/ibc-go/v6 v6.1.0
github.com/ethereum/go-ethereum v1.11.5
github.com/gogo/protobuf v1.3.3
github.com/golang/mock v1.6.0
Expand Down Expand Up @@ -55,7 +55,7 @@ require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/BurntSushi/toml v1.2.1 // indirect
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect
github.com/CosmWasm/wasmvm v1.1.1 // indirect
github.com/CosmWasm/wasmvm v1.2.1 // indirect
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect
github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
Expand Down Expand Up @@ -92,7 +92,7 @@ require (
github.com/confio/ics23/go v0.9.0 // indirect
github.com/containerd/continuity v0.3.0 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/gogoproto v1.4.3 // indirect
github.com/cosmos/gogoproto v1.4.6 // indirect
github.com/cosmos/gorocksdb v1.2.0 // indirect
github.com/cosmos/iavl v0.19.5 // indirect
github.com/cosmos/ledger-cosmos-go v0.12.2 // indirect
Expand All @@ -109,6 +109,7 @@ require (
github.com/dgraph-io/ristretto v0.1.0 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/docker/cli v20.10.17+incompatible // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/docker v20.10.19+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
Expand Down Expand Up @@ -334,12 +335,12 @@ require (
)

replace (
github.com/CosmWasm/wasmd => github.com/notional-labs/wasmd v0.29.0-sdk46
github.com/Gravity-Bridge/Gravity-Bridge/module => github.com/umee-network/Gravity-Bridge/module v1.5.3-umee-4
github.com/CosmWasm/wasmd => github.com/notional-labs/wasmd v0.30.1-0.20230320091624-f5072b9b04a6
github.com/Gravity-Bridge/Gravity-Bridge/module => github.com/umee-network/Gravity-Bridge/module v1.5.3-umee-5
github.com/cosmos/cosmos-sdk => github.com/umee-network/cosmos-sdk v0.46.11-umee
// dgrijalva/jwt-go is deprecated and doesn't receive security updates.
github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
github.com/osmosis-labs/bech32-ibc => github.com/umee-network/bech32-ibc v0.3.2
github.com/osmosis-labs/bech32-ibc => github.com/umee-network/bech32-ibc v0.3.3
github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.27
)
28 changes: 15 additions & 13 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbi
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg=
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4=
github.com/CosmWasm/wasmvm v1.1.1 h1:0xtdrmmsP9fibe+x42WcMkp5aQ738BICgcH3FNVLzm4=
github.com/CosmWasm/wasmvm v1.1.1/go.mod h1:ei0xpvomwSdONsxDuONzV7bL1jSET1M8brEx0FCXc+A=
github.com/CosmWasm/wasmvm v1.2.1 h1:si0tRsRDdUShV0k51Wn6zRKlmj3/WWP9Yr4cLmDTf+8=
github.com/CosmWasm/wasmvm v1.2.1/go.mod h1:vW/E3h8j9xBQs9bCoijDuawKo9kCtxOaS8N8J7KFtkc=
github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw=
Expand Down Expand Up @@ -432,15 +432,15 @@ github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960Bvc
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
github.com/cosmos/gogoproto v1.4.3 h1:RP3yyVREh9snv/lsOvmsAPQt8f44LgL281X0IOIhhcI=
github.com/cosmos/gogoproto v1.4.3/go.mod h1:0hLIG5TR7IvV1fme1HCFKjfzW9X2x0Mo+RooWXCnOWU=
github.com/cosmos/gogoproto v1.4.6 h1:Ee7z15dWJaGlgM2rWrK8N2IX7PQcuccu8oG68jp5RL4=
github.com/cosmos/gogoproto v1.4.6/go.mod h1:VS/ASYmPgv6zkPKLjR9EB91lwbLHOzaGCirmKKhncfI=
github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y=
github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw=
github.com/cosmos/iavl v0.19.5 h1:rGA3hOrgNxgRM5wYcSCxgQBap7fW82WZgY78V9po/iY=
github.com/cosmos/iavl v0.19.5/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw=
github.com/cosmos/ibc-go/v5 v5.2.0 h1:LxwttRQqdUJpQ3/Gc3XPg5lkRo3pcbzx65dxFIY6ONE=
github.com/cosmos/ibc-go/v5 v5.2.0/go.mod h1:MhDUMDVSboK5JW2pEWHNcw0wJHaHqKV/vwwP7awGhzI=
github.com/cosmos/interchain-accounts v0.3.2 h1:7S5rSndahpjkzUvG00kKZrTZsEuVHuVC9a7p0qDVcF8=
github.com/cosmos/ibc-go/v6 v6.1.0 h1:o7oXws2vKkKfOFzJI+oNylRn44PCNt5wzHd/zKQKbvQ=
github.com/cosmos/ibc-go/v6 v6.1.0/go.mod h1:CY3zh2HLfetRiW8LY6kVHMATe90Wj/UOoY8T6cuB0is=
github.com/cosmos/interchain-accounts v0.4.3 h1:WedxEa/Hj/2GY7AF6CafkEPJ/Z9rhl3rT1mRwNHsdts=
github.com/cosmos/ledger-cosmos-go v0.12.2 h1:/XYaBlE2BJxtvpkHiBm97gFGSGmYGKunKyF3nNqAXZA=
github.com/cosmos/ledger-cosmos-go v0.12.2/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI=
github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk=
Expand Down Expand Up @@ -497,6 +497,8 @@ github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/
github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ=
github.com/docker/cli v20.10.17+incompatible h1:eO2KS7ZFeov5UJeaDmIs1NFEDRf32PaqRpvoEkKBy5M=
github.com/docker/cli v20.10.17+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68=
github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v20.10.19+incompatible h1:lzEmjivyNHFHMNAFLXORMBXyGIhw/UP4DvJwvyKYq64=
github.com/docker/docker v20.10.19+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
Expand Down Expand Up @@ -1145,8 +1147,8 @@ github.com/nishanths/exhaustive v0.9.5 h1:TzssWan6orBiLYVqewCG8faud9qlFntJE30ACp
github.com/nishanths/exhaustive v0.9.5/go.mod h1:IbwrGdVMizvDcIxPYGVdQn5BqWJaOwpCvg4RGb8r/TA=
github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk=
github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c=
github.com/notional-labs/wasmd v0.29.0-sdk46 h1:KaGpIdDOdDbWoHp0ZUzIdSGgUqe03Mach4zpEAznXls=
github.com/notional-labs/wasmd v0.29.0-sdk46/go.mod h1:NbER19ksI5bZOJUta8lN4wrkVYBKD9VzOFjoCgL4P3o=
github.com/notional-labs/wasmd v0.30.1-0.20230320091624-f5072b9b04a6 h1:swpg4C8pm2h2UI/+c4cNziXKM2BcZ8X15qM7v+8bVUk=
github.com/notional-labs/wasmd v0.30.1-0.20230320091624-f5072b9b04a6/go.mod h1:RrLkOqtCy5//iZRlsPyvLN9I7l65P+yB7DKXUatKGsY=
github.com/nunnatsa/ginkgolinter v0.9.0 h1:Sm0zX5QfjJzkeCjEp+t6d3Ha0jwvoDjleP9XCsrEzOA=
github.com/nunnatsa/ginkgolinter v0.9.0/go.mod h1:FHaMLURXP7qImeH6bvxWJUpyH+2tuqe5j4rW1gxJRmI=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
Expand Down Expand Up @@ -1470,10 +1472,10 @@ github.com/ultraware/funlen v0.0.3 h1:5ylVWm8wsNwH5aWo9438pwvsK0QiqVuUrt9bn7S/iL
github.com/ultraware/funlen v0.0.3/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA=
github.com/ultraware/whitespace v0.0.5 h1:hh+/cpIcopyMYbZNVov9iSxvJU3OYQg78Sfaqzi/CzI=
github.com/ultraware/whitespace v0.0.5/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA=
github.com/umee-network/Gravity-Bridge/module v1.5.3-umee-4 h1:6uF05P2w+ueKvBNqAh2GdVt8WFeCakVPzZU/LNwnEAY=
github.com/umee-network/Gravity-Bridge/module v1.5.3-umee-4/go.mod h1:qf/p/AIVfuGzBg2bYx1yg4PbHhazGfdqnm6j1BKZ62M=
github.com/umee-network/bech32-ibc v0.3.2 h1:T2QgfMVktA9iAYLYmhmcukJr5qoaEJgRLDoUtHK8CzE=
github.com/umee-network/bech32-ibc v0.3.2/go.mod h1:kbT1K+mxxzDkvmcsHtBXgM2meNv6AXroxPdSeWAcZE0=
github.com/umee-network/Gravity-Bridge/module v1.5.3-umee-5 h1:V8qO1+IBI5IBtMzqjT3bpgqJsFYOKYW887SGF9SVwUg=
github.com/umee-network/Gravity-Bridge/module v1.5.3-umee-5/go.mod h1:UJ7hid9S/fX6EPPqu0iiwOlnRVPB4Awrkrf52f+MuRY=
github.com/umee-network/bech32-ibc v0.3.3 h1:wUX5uSYZl8yiFdttOvunfRihsE4miYmzl7pK2FEUs+U=
github.com/umee-network/bech32-ibc v0.3.3/go.mod h1:UbhzCKN+Z7RoUdCkAanmIy+wufwQ/aQJrDEoVORhC2Y=
github.com/umee-network/cosmos-sdk v0.46.11-umee h1:XzoK7WFw6FcqGJSQUrRYAyrU3lcuKry6A4W24Uv9cWc=
github.com/umee-network/cosmos-sdk v0.46.11-umee/go.mod h1:bG4AkW9bqc8ycrryyKGQEl3YV9BY2wr6HggGq8kvcgM=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
Expand Down
4 changes: 2 additions & 2 deletions tests/simulation/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"github.com/cosmos/cosmos-sdk/x/simulation"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
ibctransfertypes "github.com/cosmos/ibc-go/v5/modules/apps/transfer/types"
ibchost "github.com/cosmos/ibc-go/v5/modules/core/24-host"
ibctransfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"
ibchost "github.com/cosmos/ibc-go/v6/modules/core/24-host"
"github.com/rs/zerolog"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
Expand Down
7 changes: 3 additions & 4 deletions util/ibc/ibc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ import (

sdkmath "cosmossdk.io/math"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
transfertypes "github.com/cosmos/ibc-go/v5/modules/apps/transfer/types"
"github.com/cosmos/ibc-go/v5/modules/core/exported"
transfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"
)

// GetFundsFromPacket returns transfer amount and denom
func GetFundsFromPacket(packet exported.PacketI) (sdkmath.Int, string, error) {
func GetFundsFromPacket(data []byte) (sdkmath.Int, string, error) {
var packetData transfertypes.FungibleTokenPacketData
err := json.Unmarshal(packet.GetData(), &packetData)
err := json.Unmarshal(data, &packetData)
if err != nil {
return sdkmath.Int{}, "", err
}
Expand Down
19 changes: 3 additions & 16 deletions util/ibc/ibc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import (
"testing"

sdk "github.com/cosmos/cosmos-sdk/types"
ibctransfertypes "github.com/cosmos/ibc-go/v5/modules/apps/transfer/types"
clienttypes "github.com/cosmos/ibc-go/v5/modules/core/02-client/types"
channeltypes "github.com/cosmos/ibc-go/v5/modules/core/04-channel/types"
ibctransfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"
"github.com/tendermint/tendermint/crypto"
"gotest.tools/v3/assert"
)
Expand All @@ -26,21 +24,10 @@ func TestGetFundsFromPacket(t *testing.T) {
amount,
AddressFromString("a3"),
AddressFromString("a4"),
"memo",
)

packet := channeltypes.NewPacket(
data.GetBytes(),
uint64(1),
"transfer",
"channel-0",
"transfer",
"channel-0",
clienttypes.NewHeight(0, 100),
0,
)

famount, fdenom, err := GetFundsFromPacket(packet)

famount, fdenom, err := GetFundsFromPacket(data.GetBytes())
assert.NilError(t, err)
assert.Equal(t, denom, fdenom)
assert.Equal(t, famount.String(), amount)
Expand Down
8 changes: 4 additions & 4 deletions x/uibc/ics20/ibc_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package ics20
import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
ibctransfer "github.com/cosmos/ibc-go/v5/modules/apps/transfer"
ibctransfertypes "github.com/cosmos/ibc-go/v5/modules/apps/transfer/types"
channeltypes "github.com/cosmos/ibc-go/v5/modules/core/04-channel/types"
ibcexported "github.com/cosmos/ibc-go/v5/modules/core/exported"
ibctransfer "github.com/cosmos/ibc-go/v6/modules/apps/transfer"
ibctransfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"
channeltypes "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types"
ibcexported "github.com/cosmos/ibc-go/v6/modules/core/exported"

ltypes "github.com/umee-network/umee/v4/x/leverage/types"
"github.com/umee-network/umee/v4/x/uibc"
Expand Down
Loading

0 comments on commit 073468e

Please sign in to comment.