Skip to content

Commit

Permalink
fix staking test affected by other test
Browse files Browse the repository at this point in the history
  • Loading branch information
jstr1121 committed Aug 7, 2023
1 parent 1869b86 commit 243afe6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/e2e/e2e_staking_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ func (s *IntegrationTestSuite) testStaking() {

fees := sdk.NewCoin(uatomDenom, sdk.NewInt(1))

existingDelegation := sdk.ZeroDec()
res, err := queryDelegation(chainEndpoint, validatorAddressA, delegatorAddress)
if err == nil {
existingDelegation = res.GetDelegationResponse().GetDelegation().GetShares()
}

delegationAmount := sdk.NewInt(500000000)
delegation := sdk.NewCoin(uatomDenom, delegationAmount) // 500 atom

Expand All @@ -35,7 +41,7 @@ func (s *IntegrationTestSuite) testStaking() {
amt := res.GetDelegationResponse().GetDelegation().GetShares()
s.Require().NoError(err)

return amt.Equal(sdk.NewDecFromInt(delegationAmount))
return amt.Equal(existingDelegation.Add(sdk.NewDecFromInt(delegationAmount)))
},
20*time.Second,
5*time.Second,
Expand Down

0 comments on commit 243afe6

Please sign in to comment.