From 849143fbd92908ff9ef4d4fd1f26395b06967c37 Mon Sep 17 00:00:00 2001 From: ThanhNhann Date: Fri, 13 Dec 2024 10:47:23 +0700 Subject: [PATCH] minor --- tests/eibc_ack_error_test.go | 45 -------------------------------- tests/erc20_ibc_transfer_test.go | 38 +++++++++++++-------------- 2 files changed, 19 insertions(+), 64 deletions(-) diff --git a/tests/eibc_ack_error_test.go b/tests/eibc_ack_error_test.go index 67216408..0982e0d0 100644 --- a/tests/eibc_ack_error_test.go +++ b/tests/eibc_ack_error_test.go @@ -8,8 +8,6 @@ import ( "strconv" "testing" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "cosmossdk.io/math" "github.com/cosmos/cosmos-sdk/x/params/client/utils" transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" @@ -1275,49 +1273,6 @@ func TestEIBC_AckError_3rd_Party_Token_EVM(t *testing.T) { var options ibc.TransferOptions - // register ibc denom on rollapp1 - metadata := banktypes.Metadata{ - Description: "IBC token from rollapp 2", - DenomUnits: []*banktypes.DenomUnit{ - { - Denom: thirdPartyIBCDenomOnRA, - Exponent: 0, - Aliases: []string{"urax"}, - }, - { - Denom: "urax", - Exponent: 6, - }, - }, - // Setting base as IBC hash denom since bank keepers's SetDenomMetadata uses - // Base as key path and the IBC hash is what gives this token uniqueness - // on the executing chain - Base: thirdPartyIBCDenomOnRA, - Display: "urax", - Name: "urax", - Symbol: "urax", - } - - data := map[string][]banktypes.Metadata{ - "metadata": {metadata}, - } - - contentFile, err := json.Marshal(data) - require.NoError(t, err) - rollapp1.GetNode().WriteFile(ctx, contentFile, "./ibcmetadata.json") - deposit := "500000000000" + rollapp1.Config().Denom - rollapp1.GetNode().HostName() - _, err = rollapp1.GetNode().RegisterIBCTokenDenomProposal(ctx, rollapp1UserAddr, deposit, rollapp1.GetNode().HomeDir()+"/ibcmetadata.json") - require.NoError(t, err) - - err = rollapp1.VoteOnProposalAllValidators(ctx, "1", cosmos.ProposalVoteYes) - require.NoError(t, err, "failed to submit votes") - - height, err := rollapp1.Height(ctx) - require.NoError(t, err, "error fetching height") - _, err = cosmos.PollForProposalStatus(ctx, rollapp1.CosmosChain, height, height+30, "1", cosmos.ProposalStatusPassed) - require.NoError(t, err, "proposal status did not change to passed") - t.Run("Demand order is created upon AckError for rollapp token", func(t *testing.T) { transferData := ibc.WalletData{ Address: marketMakerAddr, diff --git a/tests/erc20_ibc_transfer_test.go b/tests/erc20_ibc_transfer_test.go index 50955290..5a2b45ff 100644 --- a/tests/erc20_ibc_transfer_test.go +++ b/tests/erc20_ibc_transfer_test.go @@ -523,34 +523,34 @@ func TestERC20RollAppToHubNewRegister_EVM(t *testing.T) { // // Assert balance was updated on the hub // testutil.AssertBalance(t, ctx, dymension, dymensionUserAddr, dymension.Config().Denom, walletAmount.Sub(transferData.Amount)) // // Check fund was set to erc20 module account on rollapp - erc20MAcc, err := rollapp1.Validators[0].QueryModuleAccount(ctx, "erc20") - require.NoError(t, err) - erc20MAccAddr := erc20MAcc.Account.BaseAccount.Address - rollappErc20MaccBalance, err := rollapp1.GetBalance(ctx, erc20MAccAddr, dymensionIBCDenom) - require.NoError(t, err) + // erc20MAcc, err := rollapp1.Validators[0].QueryModuleAccount(ctx, "erc20") + // require.NoError(t, err) + // erc20MAccAddr := erc20MAcc.Account.BaseAccount.Address + // rollappErc20MaccBalance, err := rollapp1.GetBalance(ctx, erc20MAccAddr, dymensionIBCDenom) + // require.NoError(t, err) - require.True(t, rollappErc20MaccBalance.Equal(transferAmount)) - require.NoError(t, err) + // require.True(t, rollappErc20MaccBalance.Equal(transferAmount)) + // require.NoError(t, err) - tokenPair, err := rollapp1.GetNode().QueryErc20TokenPair(ctx, dymensionIBCDenom) - require.NoError(t, err) - require.NotNil(t, tokenPair) + // tokenPair, err := rollapp1.GetNode().QueryErc20TokenPair(ctx, dymensionIBCDenom) + // require.NoError(t, err) + // require.NotNil(t, tokenPair) - // convert erc20 - _, err = rollapp1.GetNode().ConvertErc20(ctx, rollappUser.KeyName(), tokenPair.Erc20Address, transferAmount.String(), rollappUserAddr, rollappUserAddr, rollapp1.Config().ChainID) - require.NoError(t, err, "can not convert erc20 to cosmos coin") + // // convert erc20 + // _, err = rollapp1.GetNode().ConvertErc20(ctx, rollappUser.KeyName(), tokenPair.Erc20Address, transferAmount.String(), rollappUserAddr, rollappUserAddr, rollapp1.Config().ChainID) + // require.NoError(t, err, "can not convert erc20 to cosmos coin") - err = testutil.WaitForBlocks(ctx, 5, dymension, rollapp1) - require.NoError(t, err) - testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, dymensionIBCDenom, transferAmount) + // err = testutil.WaitForBlocks(ctx, 5, dymension, rollapp1) + // require.NoError(t, err) + // testutil.AssertBalance(t, ctx, rollapp1, rollappUserAddr, dymensionIBCDenom, transferAmount) rollappAdrrHex := common.BytesToAddress(rollappUser.Address()) - _, err = rollapp1.GetNode().ConvertCoin(ctx, rollappUser.KeyName(), fmt.Sprintf("%v%s", transferAmount, dymensionIBCDenom), rollappAdrrHex.String()) + _, err = rollapp1.GetNode().ConvertCoin(ctx, rollappUser.KeyName(), fmt.Sprintf("%v%s", transferAmount, rollapp1.Config().Denom), rollappAdrrHex.String()) require.NoError(t, err) // register erc20 erc20 - _, err = rollapp1.GetNode().RegisterERC20AsToken(ctx, rollappUser.KeyName(), tokenPair.Erc20Address) - require.NoError(t, err, "can not register erc20 to cosmos coin") + // _, err = rollapp1.GetNode().RegisterERC20AsToken(ctx, rollappUser.KeyName(), tokenPair.Erc20Address) + // require.NoError(t, err, "can not register erc20 to cosmos coin") err = testutil.WaitForBlocks(ctx, 5, dymension, rollapp1) require.NoError(t, err)