From a8be83e96274657d57d41c96e329c0ebf398327b Mon Sep 17 00:00:00 2001 From: Vladyslav Budichenko Date: Wed, 13 Nov 2024 10:06:03 -0500 Subject: [PATCH] wip: add logging --- tests/e2e-ibc/erc20_test.go | 30 +++++++++++++++--------------- tests/e2e/testutil/account.go | 7 ++++--- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/tests/e2e-ibc/erc20_test.go b/tests/e2e-ibc/erc20_test.go index 45c9d4bf7..e5a25fcf5 100644 --- a/tests/e2e-ibc/erc20_test.go +++ b/tests/e2e-ibc/erc20_test.go @@ -167,10 +167,8 @@ func TestInterchainErc20(t *testing.T) { //} else { // panic("containerLifecycle is not valid") //} - hostPorts, err := ictKava.FullNodes[0].ContainerLifecycle.GetHostPorts(ctx, "8545/tcp") - fmt.Println("hostPorts: ", hostPorts) - fmt.Println("ictKava.FullNodes[0]: ", ictKava.FullNodes[0]) - fmt.Println("ictKava.FullNodes[0].ContainerLifecycle: ", ictKava.FullNodes[0].ContainerLifecycle) + hostPorts, err := ictKava.Validators[0].ContainerLifecycle.GetHostPorts(ctx, "8545/tcp") + //hostPorts, err := ictKava.FullNodes[0].ContainerLifecycle.GetHostPorts(ctx, "8545/tcp") //hostPorts, err := containerLifecycle.GetHostPorts(ctx, "8545/tcp") require.NoError(t, err, "failed to find evm URL") evmUrl = "http://" + hostPorts[0] @@ -243,11 +241,12 @@ func TestInterchainErc20(t *testing.T) { Value: rawCps, }, }, - Deposit: "10000000ukava", + Deposit: "1000000000ukava", } fmt.Println("kavaUser", kavaUser.KeyName()) - _, err = legacyParamChangeProposal(ictKava.FullNodes[0], ctx, kavaUser.KeyName(), ¶mChange) + fmt.Println("full node 0", ictKava.Validators[0]) + _, err = legacyParamChangeProposal(ictKava.Validators[0], ctx, kavaUser.KeyName(), ¶mChange) require.NoError(t, err, "error submitting param change proposal tx") // TODO: query proposal id. assuming it is 1 here. @@ -264,8 +263,11 @@ func TestInterchainErc20(t *testing.T) { require.NoError(t, err, "proposal status did not change to passed in expected number of blocks") // fund a user & mint them some usdt - user := kava.NewFundedAccount("tether-user", sdk.NewCoins(sdk.NewCoin("ukava", math.NewInt(1e7)))) + //user := kava.NewFundedAccount("tether-user", sdk.NewCoins(sdk.NewCoin("ukava", math.NewInt(1e7)))) + user := kava.NewFundedAccount("tether-user", sdk.NewCoins(sdk.NewCoin("ukava", math.NewInt(1e9)))) erc20FundAmt := big.NewInt(100e6) + // 10000000 + //erc20FundAmt := big.NewInt(6_000_000_000) mintTx, err := usdt.Mint(deployer.EvmAuth, user.EvmAddress, erc20FundAmt) require.NoError(t, err) @@ -285,10 +287,12 @@ func TestInterchainErc20(t *testing.T) { amountToConvert, ) convertTx := util.KavaMsgRequest{ - Msgs: []sdk.Msg{&msg}, - GasLimit: 4e5, - FeeAmount: sdk.NewCoins(sdk.NewCoin("ukava", math.NewInt(400))), - Data: "converting sdk coin to erc20", + Msgs: []sdk.Msg{&msg}, + GasLimit: 4e5, + //FeeAmount: sdk.NewCoins(sdk.NewCoin("ukava", math.NewInt(400))), + FeeAmount: sdk.NewCoins(sdk.NewCoin("ukava", math.NewInt(40000000))), + // 40000000ukava: + Data: "converting sdk coin to erc20", } res := user.SignAndBroadcastKavaTx(convertTx) require.NoError(t, res.Err) @@ -343,10 +347,6 @@ func legacyParamChangeProposal(tn *cosmos.ChainNode, ctx context.Context, keyNam "gov", "submit-legacy-proposal", "param-change", proposalPath, - "--type", "text", - "--title", prop.Title, - "--description", prop.Description, - "--deposit", prop.Deposit, } fmt.Println("command: ", command) diff --git a/tests/e2e/testutil/account.go b/tests/e2e/testutil/account.go index 9ddfc5c96..845b61c1b 100644 --- a/tests/e2e/testutil/account.go +++ b/tests/e2e/testutil/account.go @@ -257,9 +257,10 @@ func (a *SigningAccount) NextNonce() (uint64, error) { func (a *SigningAccount) BankSend(to sdk.AccAddress, amount sdk.Coins) util.KavaMsgResponse { return a.SignAndBroadcastKavaTx( util.KavaMsgRequest{ - Msgs: []sdk.Msg{banktypes.NewMsgSend(a.SdkAddress, to, amount)}, - GasLimit: 2e5, // 200,000 gas - FeeAmount: sdk.NewCoins(sdk.NewCoin(a.gasDenom, sdkmath.NewInt(200))), // assume min gas price of .001ukava + Msgs: []sdk.Msg{banktypes.NewMsgSend(a.SdkAddress, to, amount)}, + GasLimit: 2e5, // 200,000 gas + //FeeAmount: sdk.NewCoins(sdk.NewCoin(a.gasDenom, sdkmath.NewInt(200))), // assume min gas price of .001ukava + FeeAmount: sdk.NewCoins(sdk.NewCoin(a.gasDenom, sdkmath.NewInt(20000000))), // assume min gas price of .001ukava Data: fmt.Sprintf("sending %s to %s", amount, to), }, )