Skip to content

Commit

Permalink
chore: correct typos in test (#793)
Browse files Browse the repository at this point in the history
  • Loading branch information
zakir-code authored Oct 30, 2024
1 parent 8349b0e commit 2443723
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions x/staking/precompile/delegate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ func (suite *PrecompileTestSuite) TestDelegateV2() {

delAfter := suite.GetDelegation(delAddr.Bytes(), operator)

vaAfter := suite.GetValidator(operator)
valAfter := suite.GetValidator(operator)

if !delFound {
delBefore = stakingtypes.Delegation{Shares: sdkmath.LegacyZeroDec()}
}
suite.Require().Equal(delAfter.GetShares().Sub(delBefore.GetShares()), vaAfter.GetDelegatorShares().Sub(valBefore.GetDelegatorShares()))
suite.Require().Equal(delAmount, vaAfter.GetTokens().Sub(valBefore.GetTokens()))
suite.Require().Equal(delAfter.GetShares().Sub(delBefore.GetShares()), valAfter.GetDelegatorShares().Sub(valBefore.GetDelegatorShares()))
suite.Require().Equal(delAmount, valAfter.GetTokens().Sub(valBefore.GetTokens()))

existLog := false
for _, log := range res.Logs {
Expand Down
4 changes: 2 additions & 2 deletions x/staking/precompile/undelegate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (suite *PrecompileTestSuite) TestUndelegate() {
suite.CheckUndelegateLogs(res.Logs, delAddr, operator.String(), delegation.Shares.TruncateInt().BigInt(),
undelegations[0].Entries[0].Balance.BigInt(), undelegations[0].Entries[0].CompletionTime)

suite.CheckUndeledateEvents(suite.Ctx, operator.String(), undelegations[0].Entries[0].Balance.BigInt(),
suite.CheckUndelegateEvents(suite.Ctx, operator.String(), undelegations[0].Entries[0].Balance.BigInt(),
undelegations[0].Entries[0].CompletionTime)
}
})
Expand All @@ -138,7 +138,7 @@ func (suite *PrecompileTestSuite) CheckUndelegateLogs(logs []*evmtypes.Log, delA
suite.Require().True(existLog)
}

func (suite *PrecompileTestSuite) CheckUndeledateEvents(ctx sdk.Context, valAddr string, amount *big.Int, completionTime time.Time) {
func (suite *PrecompileTestSuite) CheckUndelegateEvents(ctx sdk.Context, valAddr string, amount *big.Int, completionTime time.Time) {
existEvent := false
for _, event := range ctx.EventManager().Events() {
if event.Type == stakingtypes.EventTypeUnbond {
Expand Down

0 comments on commit 2443723

Please sign in to comment.