Skip to content

Commit

Permalink
Merge branch 'main' into robert/loadall
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-zaremba authored Jun 22, 2023
2 parents e09de4b + 5c40f6f commit a947d32
Show file tree
Hide file tree
Showing 27 changed files with 1,345 additions and 619 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Features

- [2192](https://github.com/umee-network/umee/pull/2102) Add `MsgFastLiquidate` to `x/leverage`
- [2085](https://github.com/umee-network/umee/pull/2085) Add `inspect` query to leverage module, which msut be enabled on a node by running with `-l` liquidator query flag.
- [1952](https://github.com/umee-network/umee/pull/1952) Add `x/incentive` module.
- [2015](https://github.com/umee-network/umee/pull/2015), [2050](https://github.com/umee-network/umee/pull/2050) Add `x/ugov` module.
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ See [Release procedure](CONTRIBUTING.md#release-procedure) for more information
| v4.2.x || v0.46.10+ | v5.2.x | v1.3.x+ | umee/v2.1.1 | umee/v4 v1.5.3-umee-4 | v1.1.1 |
| v4.3.x || v0.46.11+ | v6.1.x | v1.3.x+ | umee/v2.1.1 | umee/v4 v1.5.3-umee-6 | v1.2.1 |
| v4.4.x || v0.46.11+ | v6.1.x | v1.3.x+ | umee/v2.1.4+ | umee/v4 v1.5.3-umee-6 | v1.2.3 |
| v5.0.x || v0.46.11+ | v6.1.x | v1.3.x+ | umee/v2.1.4+ | umee/v4 v1.5.3-umee-8 | v1.2.3 |
| v5.0.x || v0.46.13+ | v6.1.x | v1.3.x+ | umee/v2.1.4+ | umee/v4 v1.5.3-umee-8 | v1.2.4 |
| v5.1.x || v0.46.13+ | v6.1.x | v1.3.x+ | umee/v2.1.4+ | umee/v4 v1.5.3-umee-9 | v1.2.4 |

#### Price Feeder

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ require (
github.com/tendermint/tendermint v0.34.28
github.com/tendermint/tm-db v0.6.7
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1
google.golang.org/grpc v1.56.0
google.golang.org/grpc v1.56.1
google.golang.org/protobuf v1.30.0
gopkg.in/yaml.v3 v3.0.1
gotest.tools/v3 v3.4.0
Expand Down Expand Up @@ -339,7 +339,7 @@ require (

replace (
github.com/CosmWasm/wasmd => github.com/notional-labs/wasmd v0.31.0-umee.46
github.com/Gravity-Bridge/Gravity-Bridge/module => github.com/umee-network/Gravity-Bridge/module v1.5.3-umee-8
github.com/Gravity-Bridge/Gravity-Bridge/module => github.com/umee-network/Gravity-Bridge/module v1.5.3-umee-9
github.com/cosmos/cosmos-sdk => github.com/umee-network/cosmos-sdk v0.46.13-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
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1480,8 +1480,8 @@ 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-8 h1:wTu1bGrlgGtBKoWT4+K3Snr9X1x0b/ydyBwF1rtPl04=
github.com/umee-network/Gravity-Bridge/module v1.5.3-umee-8/go.mod h1:NR6UwQPZUoLckpOtCxgROWNEDzepe2JhxQ2u9cL+pbo=
github.com/umee-network/Gravity-Bridge/module v1.5.3-umee-9 h1:uo8+3gFo/EhQtjbiP7AfN0Pqx6ddFf9iWcvlfeChNsY=
github.com/umee-network/Gravity-Bridge/module v1.5.3-umee-9/go.mod h1:NR6UwQPZUoLckpOtCxgROWNEDzepe2JhxQ2u9cL+pbo=
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.13-umee h1:EeSalZHGoWdkKkCNhNd80jzRMNEQWLyDPUU5aUJQpIs=
Expand Down Expand Up @@ -2236,8 +2236,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu
google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
google.golang.org/grpc v1.56.0 h1:+y7Bs8rtMd07LeXmL3NxcTLn7mUkbKZqEpPhMNkwJEE=
google.golang.org/grpc v1.56.0/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
google.golang.org/grpc v1.56.1 h1:z0dNfjIl0VpaZ9iSVjA6daGatAYwPGstTjt5vkRMFkQ=
google.golang.org/grpc v1.56.1/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
Expand Down
35 changes: 35 additions & 0 deletions proto/umee/leverage/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ service Msg {
// of the target's collateral.
rpc Liquidate(MsgLiquidate) returns (MsgLiquidateResponse);

// FastLiquidate allows a user to repay a different user's borrowed coins in exchange for some
// of the target's collateral. For flash liquidations, the tokens to repay are borrowed instead of
// being taken from the liquidator's wallet, and the reward is immediately collateralized. Borrow
// limit checks for the liquidator are deferred until after the reward is collateralized, allowing
// this initial borrow to exceed the liquidator's borrow limit as long as it is healthy by the end
// of the transaction. Repay amount is calculated automatically, so the liquidator only specifies
// repay and reward token denoms.
rpc FastLiquidate(MsgFastLiquidate) returns (MsgFastLiquidateResponse);

// SupplyCollateral combines the Supply and Collateralize actions.
rpc SupplyCollateral(MsgSupplyCollateral) returns (MsgSupplyCollateralResponse);

Expand Down Expand Up @@ -140,6 +149,22 @@ message MsgLiquidate {
string reward_denom = 4;
}

// MsgFastLiquidate is the request structure for the FastLiquidate RPC.
message MsgFastLiquidate {
// Liquidator is the account address performing a liquidation and the signer
// of the message.
string liquidator = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// Borrower is the account whose borrow is being repaid, and collateral consumed,
// by the liquidation. It does not sign the message.
string borrower = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// RepayDenom is the base token that the liquidator will borrow and repay on behalf of
// the borrower.
string repay_denom = 3;
// RewardDenom is the uToken denom that the liquidator will receive as a liquidation reward
// and immediately collateralize.
string reward_denom = 4;
}

// MsgSupplyCollateral represents a user's request to supply and collateralize assets to the module.
message MsgSupplyCollateral {
// Supplier is the account address supplying assets and the signer of the message.
Expand Down Expand Up @@ -201,6 +226,16 @@ message MsgLiquidateResponse {
cosmos.base.v1beta1.Coin reward = 3 [(gogoproto.nullable) = false];
}

// MsgFastLiquidateResponse defines the Msg/FastLiquidate response type.
message MsgFastLiquidateResponse {
// Repaid is the amount of base tokens that the liquidator borrowed and repaid
// to the module on behalf of the borrower.
cosmos.base.v1beta1.Coin repaid = 1 [(gogoproto.nullable) = false];
// Reward is the amount of collateral that the liquidator gained
// as reward for the liquidation.
cosmos.base.v1beta1.Coin reward = 2 [(gogoproto.nullable) = false];
}

// MsgSupplyCollateralResponse defines the Msg/SupplyCollateral response type.
message MsgSupplyCollateralResponse {
// Collateralized is the amount of uTokens collateralized.
Expand Down
10 changes: 4 additions & 6 deletions tests/e2e/cw_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package e2e

import "github.com/umee-network/umee/v5/tests/util"

type TestCosmwasm struct {
IntegrationTestSuite
util.Cosmwasm
}
// type TestCosmwasm struct {
// IntegrationTestSuite
// util.Cosmwasm
// }

/*
// TODO : needs to setup live network with dockernet
Expand Down
67 changes: 34 additions & 33 deletions tests/e2e/e2e_ibc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"

appparams "github.com/umee-network/umee/v5/app/params"
setup "github.com/umee-network/umee/v5/tests/e2e/setup"
"github.com/umee-network/umee/v5/tests/grpc"
"github.com/umee-network/umee/v5/x/uibc"
)

var powerReduction = sdk.MustNewDecFromStr("10").Power(6)

func (s *IntegrationTestSuite) checkOutflowByPercentage(endpoint, excDenom string, outflow, amount, perDiff sdk.Dec) {
func (s *E2ETest) checkOutflowByPercentage(endpoint, excDenom string, outflow, amount, perDiff sdk.Dec) {
// get historic average price for denom (SYMBOL_DENOM)
histoAvgPrice, err := queryHistAvgPrice(endpoint, excDenom)
histoAvgPrice, err := s.QueryHistAvgPrice(endpoint, excDenom)
s.Require().NoError(err)
totalPrice := amount.Quo(powerReduction).Mul(histoAvgPrice)
s.T().Log("exchangeRate total price ", totalPrice.String(), "outflow value", outflow.String())
Expand All @@ -25,10 +26,10 @@ func (s *IntegrationTestSuite) checkOutflowByPercentage(endpoint, excDenom strin
s.Require().True(outflow.GTE(totalPrice.Sub(percentageDiff)) || totalPrice.GTE(outflow.Sub(percentageDiff)))
}

func (s *IntegrationTestSuite) checkOutflows(umeeAPIEndpoint, denom string, checkWithExcRate bool, amount sdk.Dec, excDenom string) {
func (s *E2ETest) checkOutflows(umeeAPIEndpoint, denom string, checkWithExcRate bool, amount sdk.Dec, excDenom string) {
s.Require().Eventually(
func() bool {
a, err := queryOutflows(umeeAPIEndpoint, denom)
a, err := s.QueryOutflows(umeeAPIEndpoint, denom)
s.Require().NoError(err)
if checkWithExcRate {
s.checkOutflowByPercentage(umeeAPIEndpoint, excDenom, a, amount, sdk.MustNewDecFromStr("0.01"))
Expand All @@ -40,10 +41,10 @@ func (s *IntegrationTestSuite) checkOutflows(umeeAPIEndpoint, denom string, chec
)
}

func (s *IntegrationTestSuite) checkSupply(endpoint, ibcDenom string, amount math.Int) {
func (s *E2ETest) checkSupply(endpoint, ibcDenom string, amount math.Int) {
s.Require().Eventually(
func() bool {
supply, err := queryTotalSupply(endpoint)
supply, err := s.QueryTotalSupply(endpoint)
s.Require().NoError(err)
s.Require().Equal(supply.AmountOf(ibcDenom).Int64(), amount.Int64())
return supply.AmountOf(ibcDenom).Equal(amount)
Expand All @@ -53,14 +54,14 @@ func (s *IntegrationTestSuite) checkSupply(endpoint, ibcDenom string, amount mat
)
}

func (s *IntegrationTestSuite) TestIBCTokenTransfer() {
func (s *E2ETest) TestIBCTokenTransfer() {
// s.T().Parallel()
var ibcStakeDenom string

s.Run("ibc_transfer_quota", func() {
// require the recipient account receives the IBC tokens (IBC packets ACKd)
gaiaAPIEndpoint := s.gaiaREST()
umeeAPIEndpoint := s.umeeREST()
gaiaAPIEndpoint := s.GaiaREST()
umeeAPIEndpoint := s.UmeeREST()
atomSymbol := "ATOM"
umeeSymbol := "UMEE"
totalQuota := math.NewInt(120)
Expand All @@ -72,23 +73,23 @@ func (s *IntegrationTestSuite) TestIBCTokenTransfer() {

// send uatom from gaia to umee
// Note : gaia -> umee (ibc_quota will not check token limit)
atomPrice, err := queryHistAvgPrice(umeeAPIEndpoint, atomSymbol)
atomPrice, err := s.QueryHistAvgPrice(umeeAPIEndpoint, atomSymbol)
s.Require().NoError(err)
emOfAtom := sdk.NewDecFromInt(totalQuota).Quo(atomPrice)
c := sdk.NewInt64Coin("uatom", emOfAtom.Mul(powerReduction).RoundInt64())
s.Require().True(atomPrice.GT(sdk.OneDec()), "price should be non zero, and expecting higher than 1, got: %s", atomPrice)
s.Require().True(c.Amount.GT(sdk.NewInt(2_000_000)), "amount should be non zero, and expecting much higher than 2 atom = 2e6 uatom, got: %s", c.Amount)

s.sendIBC(gaiaChainID, s.chain.id, "", c)
s.SendIBC(setup.GaiaChainID, s.Chain.ID, "", c)
s.checkSupply(umeeAPIEndpoint, uatomIBCHash, c.Amount)

// sending more tokens than token_quota limit of umee (token_quota is 100$)
histoAvgPriceOfUmee, err := queryHistAvgPrice(umeeAPIEndpoint, umeeSymbol)
histoAvgPriceOfUmee, err := s.QueryHistAvgPrice(umeeAPIEndpoint, umeeSymbol)
s.Require().NoError(err)
exceedAmountOfUmee := sdk.NewDecFromInt(totalQuota).Quo(histoAvgPriceOfUmee)
s.T().Logf("sending %s amount %s more than %s", umeeSymbol, exceedAmountOfUmee.String(), totalQuota.String())
exceedAmountCoin := sdk.NewInt64Coin(appparams.BondDenom, exceedAmountOfUmee.Mul(powerReduction).RoundInt64())
s.sendIBC(s.chain.id, gaiaChainID, "", exceedAmountCoin)
s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", exceedAmountCoin)
// check the ibc (umee) quota after ibc txs
s.checkSupply(gaiaAPIEndpoint, umeeIBCHash, math.ZeroInt())

Expand All @@ -99,14 +100,14 @@ func (s *IntegrationTestSuite) TestIBCTokenTransfer() {
belowTokenQuota := sdk.NewDecFromInt(umeeInitialQuota).Quo(histoAvgPriceOfUmee)
s.T().Logf("sending %s amount %s less than token quota %s", "UMEE", belowTokenQuota.String(), tokenQuota.String())
token := sdk.NewInt64Coin(appparams.BondDenom, belowTokenQuota.Mul(powerReduction).RoundInt64())
s.sendIBC(s.chain.id, gaiaChainID, "", token)
s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", token)
s.checkOutflows(umeeAPIEndpoint, appparams.BondDenom, true, sdk.NewDecFromInt(token.Amount), appparams.Name)
s.checkSupply(gaiaAPIEndpoint, umeeIBCHash, token.Amount)

// send uatom (ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2) from umee to gaia
uatomIBCToken := sdk.NewInt64Coin(uatomIBCHash, c.Amount.Int64())
// supply will be not be decreased because sending uatomIBCToken amount is more than token quota so it will fail
s.sendIBC(s.chain.id, gaiaChainID, "", uatomIBCToken)
s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", uatomIBCToken)
s.checkSupply(umeeAPIEndpoint, uatomIBCHash, uatomIBCToken.Amount)

// send uatom below the token quota
Expand All @@ -117,37 +118,37 @@ func (s *IntegrationTestSuite) TestIBCTokenTransfer() {
*/
belowTokenQuotabutNotBelowTotalQuota := sdk.NewDecFromInt(math.NewInt(90)).Quo(atomPrice)
uatomIBCToken.Amount = math.NewInt(belowTokenQuotabutNotBelowTotalQuota.Mul(powerReduction).RoundInt64())
s.sendIBC(s.chain.id, gaiaChainID, "", uatomIBCToken)
s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", uatomIBCToken)
// supply will be not be decreased because sending more than total quota from umee to gaia
s.checkSupply(umeeAPIEndpoint, uatomIBCHash, c.Amount)
// making sure below the total quota
belowTokenQuotaInUSD := totalQuota.Sub(umeeInitialQuota).Sub(math.NewInt(2))
belowTokenQuotaforAtom := sdk.NewDecFromInt(belowTokenQuotaInUSD).Quo(atomPrice)
uatomIBCToken.Amount = math.NewInt(belowTokenQuotaforAtom.Mul(powerReduction).RoundInt64())
s.sendIBC(s.chain.id, gaiaChainID, "", uatomIBCToken)
s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", uatomIBCToken)
// remaing supply still exists for uatom in umee
s.checkSupply(umeeAPIEndpoint, uatomIBCHash, c.Amount.Sub(uatomIBCToken.Amount))
s.checkOutflows(umeeAPIEndpoint, uatomIBCHash, true, sdk.NewDecFromInt(uatomIBCToken.Amount), atomSymbol)

// sending more tokens then token_quota limit of umee
s.sendIBC(s.chain.id, gaiaChainID, "", exceedAmountCoin)
s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", exceedAmountCoin)
// check the ibc (umee) supply after ibc txs, it will same as previous because it will fail because to quota limit exceed
s.checkSupply(gaiaAPIEndpoint, umeeIBCHash, token.Amount)

/* sending back some amount from receiver to sender (ibc/XXX)
gaia -> umee
*/
s.sendIBC(gaiaChainID, s.chain.id, "", sdk.NewInt64Coin(umeeIBCHash, 1000))
s.SendIBC(setup.GaiaChainID, s.Chain.ID, "", sdk.NewInt64Coin(umeeIBCHash, 1000))
s.checkSupply(gaiaAPIEndpoint, umeeIBCHash, token.Amount.Sub(math.NewInt(1000)))
// sending back remaining ibc amount from receiver to sender (ibc/XXX)
s.sendIBC(gaiaChainID, s.chain.id, "", sdk.NewInt64Coin(umeeIBCHash, token.Amount.Sub(math.NewInt(1000)).Int64()))
s.SendIBC(setup.GaiaChainID, s.Chain.ID, "", sdk.NewInt64Coin(umeeIBCHash, token.Amount.Sub(math.NewInt(1000)).Int64()))
s.checkSupply(gaiaAPIEndpoint, umeeIBCHash, math.ZeroInt())

// reset the outflows
s.T().Logf("waiting until quota reset, basically it will take around 300 seconds to do quota reset")
s.Require().Eventually(
func() bool {
amount, err := queryOutflows(umeeAPIEndpoint, appparams.BondDenom)
amount, err := s.QueryOutflows(umeeAPIEndpoint, appparams.BondDenom)
s.Require().NoError(err)
if amount.IsZero() {
s.T().Logf("quota is reset : %s is 0", appparams.BondDenom)
Expand All @@ -165,30 +166,30 @@ func (s *IntegrationTestSuite) TestIBCTokenTransfer() {
***/
// Make gov proposal to disable the quota check on ibc-transfer
err = grpc.UIBCIBCTransferSatusUpdate(
s.umee,
s.Umee,
uibc.IBCTransferStatus_IBC_TRANSFER_STATUS_QUOTA_DISABLED,
)
s.Require().NoError(err)
// Get the uibc params for quota checking
uibcParams, err := s.umee.QueryUIBCParams()
uibcParams, err := s.Umee.QueryUIBCParams()
s.Require().NoError(err)
s.Require().Equal(uibcParams.IbcStatus, uibc.IBCTransferStatus_IBC_TRANSFER_STATUS_QUOTA_DISABLED)
token = sdk.NewInt64Coin("uumee", 100000000) // 100 Umee
// sending the umee tokens
s.sendIBC(s.chain.id, gaiaChainID, "", token)
s.SendIBC(s.Chain.ID, setup.GaiaChainID, "", token)
// Check the outflows
s.checkSupply(gaiaAPIEndpoint, umeeIBCHash, token.Amount)
s.Require().Eventually(
func() bool {
a, err := queryOutflows(umeeAPIEndpoint, appparams.BondDenom)
a, err := s.QueryOutflows(umeeAPIEndpoint, appparams.BondDenom)
s.Require().NoError(err)
return a.Equal(sdk.ZeroDec())
},
time.Minute,
5*time.Second,
)
// resend the umee token from gaia to umee
s.sendIBC(gaiaChainID, s.chain.id, "", sdk.NewInt64Coin(umeeIBCHash, token.Amount.Int64()))
s.SendIBC(setup.GaiaChainID, s.Chain.ID, "", sdk.NewInt64Coin(umeeIBCHash, token.Amount.Int64()))
s.checkSupply(gaiaAPIEndpoint, umeeIBCHash, sdk.ZeroInt())

})
Expand All @@ -203,17 +204,17 @@ func (s *IntegrationTestSuite) TestIBCTokenTransfer() {
)

stakeIBCHash := "ibc/C053D637CCA2A2BA030E2C5EE1B28A16F71CCB0E45E8BE52766DC1B241B77878"
umeeAPIEndpoint := s.umeeREST()
umeeAPIEndpoint := s.UmeeREST()

valAddr, err := s.chain.validators[0].keyInfo.GetAddress()
valAddr, err := s.Chain.Validators[0].KeyInfo.GetAddress()
s.Require().NoError(err)
recipient := valAddr.String()
token := sdk.NewInt64Coin("stake", 3300000000) // 3300stake
s.sendIBC(gaiaChainID, s.chain.id, recipient, token)
s.SendIBC(setup.GaiaChainID, s.Chain.ID, recipient, token)

s.Require().Eventually(
func() bool {
balances, err = queryUmeeAllBalances(umeeAPIEndpoint, recipient)
balances, err = s.QueryUmeeAllBalances(umeeAPIEndpoint, recipient)
s.Require().NoError(err)
// uncomment whene we re-enable inflow limit
// return math.ZeroInt().Equal(balances.AmountOf(stakeIBCHash))
Expand All @@ -230,7 +231,7 @@ func (s *IntegrationTestSuite) TestIBCTokenTransfer() {
s.Run("deploy_stake_erc20 ibcStakeERC20Addr", func() {
s.T().Skip("paused due to Ethereum PoS migration and PoW fork")
s.Require().NotEmpty(ibcStakeDenom)
ibcStakeERC20Addr = s.deployERC20Token(ibcStakeDenom)
ibcStakeERC20Addr = s.DeployERC20Token(ibcStakeDenom)
})

// send 300 stake tokens from Umee to Ethereum
Expand All @@ -242,7 +243,7 @@ func (s *IntegrationTestSuite) TestIBCTokenTransfer() {
umeeFee := sdk.NewCoin(appparams.BondDenom, math.NewInt(10000))
gravityFee := sdk.NewCoin(ibcStakeDenom, math.NewInt(7))

s.sendFromUmeeToEthCheck(umeeValIdxSender, orchestratorIdxReceiver, ibcStakeERC20Addr, amount, umeeFee, gravityFee)
s.SendFromUmeeToEthCheck(umeeValIdxSender, orchestratorIdxReceiver, ibcStakeERC20Addr, amount, umeeFee, gravityFee)
})

// send 300 stake tokens from Ethereum back to Umee
Expand All @@ -252,6 +253,6 @@ func (s *IntegrationTestSuite) TestIBCTokenTransfer() {
orchestratorIdxSender := 1
amount := uint64(300)

s.sendFromEthToUmeeCheck(orchestratorIdxSender, umeeValIdxReceiver, ibcStakeERC20Addr, ibcStakeDenom, amount)
s.SendFromEthToUmeeCheck(orchestratorIdxSender, umeeValIdxReceiver, ibcStakeERC20Addr, ibcStakeDenom, amount)
})
}
Loading

0 comments on commit a947d32

Please sign in to comment.