From bdd6dce4bb47c3405b69fda336b3ad5e0c08bb6a Mon Sep 17 00:00:00 2001 From: Simon Noetzlin Date: Tue, 19 Sep 2023 16:25:15 +0200 Subject: [PATCH] nits --- tests/e2e/e2e_bank_test.go | 4 ++-- tests/e2e/e2e_exec_test.go | 11 +++-------- tests/e2e/e2e_staking_test.go | 2 +- tests/e2e/query.go | 5 ----- 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/tests/e2e/e2e_bank_test.go b/tests/e2e/e2e_bank_test.go index a8be02ad023..1b0b4357a67 100644 --- a/tests/e2e/e2e_bank_test.go +++ b/tests/e2e/e2e_bank_test.go @@ -44,7 +44,7 @@ func (s *IntegrationTestSuite) testBankTokenTransfer() { 5*time.Second, ) - // alice sends token to bob + // alice sends tokens to bob s.execBankSend(s.chainA, 0, alice.String(), bob.String(), tokenAmount.String(), standardFees.String(), false) s.Require().Eventually( @@ -64,7 +64,7 @@ func (s *IntegrationTestSuite) testBankTokenTransfer() { 5*time.Second, ) - // save the current account balances of alice and bob + // save the updated account balances of alice and bob beforeAliceUAtomBalance, beforeBobUAtomBalance = afterAliceUAtomBalance, afterBobUAtomBalance // alice sends tokens to bob and charlie, at once diff --git a/tests/e2e/e2e_exec_test.go b/tests/e2e/e2e_exec_test.go index 789883d232c..aa7b6fec5e1 100644 --- a/tests/e2e/e2e_exec_test.go +++ b/tests/e2e/e2e_exec_test.go @@ -466,6 +466,7 @@ func (s *IntegrationTestSuite) runGovExec(c *chain, valIdx int, submitterAddr, g // }) // } +// TODO rename to execDelegate for consistency func (s *IntegrationTestSuite) executeDelegate(c *chain, valIdx int, amount, valOperAddress, delegatorAddr, home, delegateFees string) { //nolint:unparam ctx, cancel := context.WithTimeout(context.Background(), time.Minute) @@ -493,8 +494,7 @@ func (s *IntegrationTestSuite) executeDelegate(c *chain, valIdx int, amount, val s.T().Logf("%s successfully delegated %s to %s", delegatorAddr, amount, valOperAddress) } -func (s *IntegrationTestSuite) executeUnbondDelegation(c *chain, valIdx int, amount, valOperAddress, delegatorAddr, home, delegateFees string) { //nolint:unparam - +func (s *IntegrationTestSuite) execUnbondDelegation(c *chain, valIdx int, amount, valOperAddress, delegatorAddr, home, delegateFees string) { //nolint:unparam ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() @@ -548,8 +548,8 @@ func (s *IntegrationTestSuite) executeCancelUnbondingDelegation(c *chain, valIdx s.T().Logf("%s successfully undelegated %s to %s", delegatorAddr, amount, valOperAddress) } +// TODO rename to execDelegate for consistency func (s *IntegrationTestSuite) executeRedelegate(c *chain, valIdx int, amount, originalValOperAddress, - newValOperAddress, delegatorAddr, home, delegateFees string, ) { ctx, cancel := context.WithTimeout(context.Background(), time.Minute) @@ -698,8 +698,6 @@ func (s *IntegrationTestSuite) executeGaiaTxCommand(ctx context.Context, c *chai }) s.Require().NoError(err) - fmt.Println(gaiaCommand) - err = s.dkrPool.Client.StartExec(exec.ID, docker.StartExecOptions{ Context: ctx, Detach: false, @@ -711,9 +709,6 @@ func (s *IntegrationTestSuite) executeGaiaTxCommand(ctx context.Context, c *chai stdOut := outBuf.Bytes() stdErr := errBuf.Bytes() - fmt.Println("stdOut", string(stdOut)) - fmt.Println("stdErr", string(stdErr)) - if !validation(stdOut, stdErr) { s.Require().FailNowf("Exec validation failed", "stdout: %s, stderr: %s", string(stdOut), string(stdErr)) diff --git a/tests/e2e/e2e_staking_test.go b/tests/e2e/e2e_staking_test.go index c3c667a06bc..7bcdbcedb68 100644 --- a/tests/e2e/e2e_staking_test.go +++ b/tests/e2e/e2e_staking_test.go @@ -85,7 +85,7 @@ func (s *IntegrationTestSuite) testStaking() { ) // Alice unbonds all her uatom delegation from Validator A - s.executeUnbondDelegation(s.chainA, 0, currDelegation.String(), validatorAddressA, delegatorAddress.String(), gaiaHomePath, fees.String()) + s.execUnbondDelegation(s.chainA, 0, currDelegation.String(), validatorAddressA, delegatorAddress.String(), gaiaHomePath, fees.String()) var ( ubdDelegationEntry types.UnbondingDelegationEntry diff --git a/tests/e2e/query.go b/tests/e2e/query.go index 9e6728e2b1a..73b0375b06d 100644 --- a/tests/e2e/query.go +++ b/tests/e2e/query.go @@ -22,9 +22,6 @@ import ( ) func queryGaiaTx(endpoint, txHash string) error { - - fmt.Println(fmt.Sprintf("%s/cosmos/tx/v1beta1/txs/%s", endpoint, txHash)) - resp, err := http.Get(fmt.Sprintf("%s/cosmos/tx/v1beta1/txs/%s", endpoint, txHash)) if err != nil { return fmt.Errorf("failed to execute HTTP request: %w", err) @@ -129,8 +126,6 @@ func queryDelegation(endpoint string, validatorAddr string, delegatorAddr string func queryUnbondingDelegation(endpoint string, validatorAddr string, delegatorAddr string) (stakingtypes.QueryUnbondingDelegationResponse, error) { var res stakingtypes.QueryUnbondingDelegationResponse - - fmt.Println(fmt.Sprintf(fmt.Sprintf("%s/cosmos/staking/v1beta1/validators/%s/delegations/%s/unbonding_delegation", endpoint, validatorAddr, delegatorAddr))) body, err := httpGet(fmt.Sprintf("%s/cosmos/staking/v1beta1/validators/%s/delegations/%s/unbonding_delegation", endpoint, validatorAddr, delegatorAddr)) if err != nil { return res, err