Skip to content

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
sainoe committed Sep 20, 2023
1 parent 891e4d1 commit cc67a8c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
8 changes: 3 additions & 5 deletions tests/e2e/e2e_exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +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
func (s *IntegrationTestSuite) execDelegate(c *chain, valIdx int, amount, valOperAddress, delegatorAddr, home, delegateFees string) { //nolint:unparam

ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
Expand Down Expand Up @@ -545,11 +544,10 @@ func (s *IntegrationTestSuite) execCancelUnbondingDelegation(c *chain, valIdx in
}

s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx))
s.T().Logf("%s successfully undelegated %s to %s", delegatorAddr, amount, valOperAddress)
s.T().Logf("%s successfully canceled unbonding %s to %s", delegatorAddr, amount, valOperAddress)
}

// TODO rename to execRedelegate for consistency
func (s *IntegrationTestSuite) executeRedelegate(c *chain, valIdx int, amount, originalValOperAddress,
func (s *IntegrationTestSuite) execRedelegate(c *chain, valIdx int, amount, originalValOperAddress,
newValOperAddress, delegatorAddr, home, delegateFees string,
) {
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/e2e_staking_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (s *IntegrationTestSuite) testStaking() {
delegation := sdk.NewCoin(uatomDenom, delegationAmount) // 500 atom

// Alice delegate uatom to Validator A
s.executeDelegate(s.chainA, 0, delegation.String(), validatorAddressA, delegatorAddress.String(), gaiaHomePath, fees.String())
s.execDelegate(s.chainA, 0, delegation.String(), validatorAddressA, delegatorAddress.String(), gaiaHomePath, fees.String())

// Validate delegation successful
s.Require().Eventually(
Expand All @@ -48,7 +48,7 @@ func (s *IntegrationTestSuite) testStaking() {
redelegation := sdk.NewCoin(uatomDenom, redelegationAmount) // 250 atom

// Alice re-delegate half of her uatom delegation from Validator A to Validator B
s.executeRedelegate(s.chainA, 0, redelegation.String(), validatorAddressA, validatorAddressB, delegatorAddress.String(), gaiaHomePath, fees.String())
s.execRedelegate(s.chainA, 0, redelegation.String(), validatorAddressA, validatorAddressB, delegatorAddress.String(), gaiaHomePath, fees.String())

// Validate re-delegation successful
s.Require().Eventually(
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/e2e_vesting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (s *IntegrationTestSuite) testDelayedVestingAccount(api string) {
s.Require().Equal(vestingBalance.AmountOf(uatomDenom), balance.Amount)

// Delegate coins should succeed
s.executeDelegate(chain, valIdx, vestingDelegationAmount.String(), valOpAddr,
s.execDelegate(chain, valIdx, vestingDelegationAmount.String(), valOpAddr,
vestingDelayedAcc.String(), gaiaHomePath, vestingDelegationFees.String())

// Validate delegation successful
Expand Down Expand Up @@ -128,7 +128,7 @@ func (s *IntegrationTestSuite) testContinuousVestingAccount(api string) {
s.Require().Equal(vestingBalance.AmountOf(uatomDenom), balance.Amount)

// Delegate coins should succeed
s.executeDelegate(chain, valIdx, vestingDelegationAmount.String(),
s.execDelegate(chain, valIdx, vestingDelegationAmount.String(),
valOpAddr, continuousVestingAcc.String(), gaiaHomePath, vestingDelegationFees.String())

// Validate delegation successful
Expand Down Expand Up @@ -267,7 +267,7 @@ func (s *IntegrationTestSuite) testPeriodicVestingAccount(api string) { //nolint
}

// Delegate coins should succeed
s.executeDelegate(chain, valIdx, vestingDelegationAmount.String(), valOpAddr,
s.execDelegate(chain, valIdx, vestingDelegationAmount.String(), valOpAddr,
periodicVestingAddr, gaiaHomePath, vestingDelegationFees.String())

// Validate delegation successful
Expand Down

0 comments on commit cc67a8c

Please sign in to comment.