Skip to content

Commit

Permalink
add debug call
Browse files Browse the repository at this point in the history
  • Loading branch information
sainoe committed Oct 17, 2023
1 parent 88978cf commit c41f526
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/integration/double_vote.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package integration

import (
"fmt"

cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
testutil "github.com/cosmos/interchain-security/v2/testutil/crypto"
Expand Down Expand Up @@ -294,6 +296,9 @@ func (s *CCVTestSuite) TestHandleConsumerDoubleVotingSlashesUndelegations() {
_, shares, _ = delegateByIdx(s, delAddr, sdk.NewInt(50000000), idx)
_ = undelegate(s, delAddr, valAddr, shares)

ubds, _ := s.providerApp.GetTestStakingKeeper().GetUnbondingDelegation(s.providerCtx(), delAddr, validator.GetOperator())
fmt.Println(ubds.String())

err = s.providerApp.GetProviderKeeper().HandleConsumerDoubleVoting(
s.providerCtx(),
evidence,
Expand All @@ -305,7 +310,9 @@ func (s *CCVTestSuite) TestHandleConsumerDoubleVotingSlashesUndelegations() {
slashFraction := s.providerApp.GetTestSlashingKeeper().SlashFractionDoubleSign(s.providerCtx())

// check undelegations are slashed
ubds, _ := s.providerApp.GetTestStakingKeeper().GetUnbondingDelegation(s.providerCtx(), delAddr, validator.GetOperator())
ubds, _ = s.providerApp.GetTestStakingKeeper().GetUnbondingDelegation(s.providerCtx(), delAddr, validator.GetOperator())
fmt.Println(ubds.String())

s.Require().True(len(ubds.Entries) > 0)
for _, unb := range ubds.Entries {
initialBalance := unb.InitialBalance.ToDec()
Expand Down
4 changes: 4 additions & 0 deletions testutil/integration/debug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,3 +280,7 @@ func TestCheckMisbehaviour(t *testing.T) {
func TestHandleConsumerDoubleVoting(t *testing.T) {
runCCVTestByName(t, "TestHandleConsumerDoubleVoting")
}

func TestHandleConsumerDoubleVotingSlashesUndelegations(t *testing.T) {
runCCVTestByName(t, "TestHandleConsumerDoubleVotingSlashesUndelegations")
}

0 comments on commit c41f526

Please sign in to comment.