Skip to content

Commit

Permalink
bump link checker
Browse files Browse the repository at this point in the history
  • Loading branch information
sainoe committed May 8, 2023
1 parent c3af86f commit e779b34
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linkchecker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: gaurav-nelson/[email protected].13
- uses: gaurav-nelson/[email protected].15
with:
folder-path: "docs"
27 changes: 12 additions & 15 deletions tests/e2e/e2e_bypassminfee_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package e2e

import (
"fmt"

"cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
)
Expand Down Expand Up @@ -44,27 +42,26 @@ func (s *IntegrationTestSuite) testByPassMinFeeWithdrawReward(endpoint string) {
rewards, err := queryDelegatorTotalRewards(endpoint, payee.String())
s.Require().NoError(err)

// get delegator stake balance
stakeBalance, err := getSpecificBalance(endpoint, payee.String(), stakeDenom)
// get current delegator stake balance
oldBalance, err := getSpecificBalance(endpoint, payee.String(), stakeDenom)
s.Require().NoError(err)
fmt.Println(stakeBalance)

// withdraw rewards
s.Run(tc.name, func() {
s.execWithdrawAllRewards(s.chainA, 0, payee.String(), tc.fee, tc.expErr)
})

// get updated balance
newStakeBalance, err := getSpecificBalance(endpoint, payee.String(), stakeDenom)
s.Require().NoError(err)
if !tc.expErr {
// get updated balance
balance, err := getSpecificBalance(endpoint, payee.String(), stakeDenom)
s.Require().NoError(err)

// check that the update balance was increased by at least the amount of stake tokens in the reward
total := rewards.GetTotal().Add(sdk.NewDecCoinFromCoin(stakeBalance)).Sort()
fmt.Println("total", total.String())
fmt.Println("rewards", rewards.String())
s.Require().Equal(total[0].Denom, stakeDenom)
// compute sum of old balance and rewards
oldBalancePlusRewards := rewards.GetTotal().Add(sdk.NewDecCoinFromCoin(oldBalance))
s.Require().Equal(oldBalancePlusRewards[0].Denom, stakeDenom)

fmt.Println(sdk.NewDecCoinFromCoin(newStakeBalance).String(), total[0].String())
s.Require().True(sdk.NewDecCoinFromCoin(newStakeBalance).IsGTE(total[0]))
// check that the updated balance is GTE than the sum of old balance and rewards
s.Require().True(sdk.NewDecCoinFromCoin(balance).IsGTE(oldBalancePlusRewards[0]))
}
}
}

0 comments on commit e779b34

Please sign in to comment.