Skip to content

Commit

Permalink
Fix staking & distribution e2e test with LSM (#2687)
Browse files Browse the repository at this point in the history
* lsm e2e test work - wip

* Add validator bond functionality on lsm happy path

* add tokenize share check on lsm test & redeemShare utility function

* add bank send lsm tokens test

* Add test for transfer reward ownership, and redeem shares

* Add staking param query utility & LSM params update process on LSM e2e test

* Add IBC transfer test on LSM share tokens & Resolve e2e tests by updating gas configs and result checker

* resolve github action bot comments

* bring all e2e test items back to enabled

* Update tests/e2e/e2e_lsm_test.go

Co-authored-by: sampocs <[email protected]>

* resolve comments

* reenable tokenize share record module account balance check

* fix staking test affected by other test

---------

Co-authored-by: jstr1121 <[email protected]>
Co-authored-by: jstr1121 <[email protected]>
  • Loading branch information
3 people authored Aug 7, 2023
1 parent 7b1e69b commit 80ccd20
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 80ccd20

Please sign in to comment.