Skip to content

Commit

Permalink
weird
Browse files Browse the repository at this point in the history
  • Loading branch information
shaspitz committed Dec 9, 2022
1 parent a759c07 commit 01b13d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions x/ccv/provider/keeper/proposal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"time"

_go "github.com/confio/ics23/go"
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
sdk "github.com/cosmos/cosmos-sdk/types"
clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"
ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types"
Expand All @@ -16,6 +15,7 @@ import (

"github.com/stretchr/testify/require"

cryptoutil "github.com/cosmos/interchain-security/testutil/crypto"
testkeeper "github.com/cosmos/interchain-security/testutil/keeper"
consumertypes "github.com/cosmos/interchain-security/x/ccv/consumer/types"
providerkeeper "github.com/cosmos/interchain-security/x/ccv/provider/keeper"
Expand Down Expand Up @@ -428,7 +428,8 @@ func TestStopConsumerChain(t *testing.T) {
testkeeper.SetupForStoppingConsumerChain(t, ctx, providerKeeper, mocks)

providerKeeper.QueuePendingSlashPacketEntry(ctx, providertypes.NewSlashPacketEntry(
ctx.BlockTime(), "chainID", 1, ed25519.GenPrivKey().PubKey().Address()))
ctx.BlockTime(), "chainID", 1, cryptoutil.NewCryptoIdentityFromIntSeed(90).SDKConsAddress()))

providerKeeper.QueuePendingSlashPacketData(ctx, "chainID", 1, testkeeper.GetNewSlashPacketData())
providerKeeper.QueuePendingVSCMaturedPacketData(ctx, "chainID", 2, testkeeper.GetNewVSCMaturedPacketData())
},
Expand Down
9 changes: 5 additions & 4 deletions x/ccv/provider/keeper/throttle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -726,18 +726,19 @@ func TestDeletePendingSlashPacketEntriesForConsumer(t *testing.T) {
// Queue 2 global entries for a consumer chain ID
providerKeeper.QueuePendingSlashPacketEntry(ctx,
providertypes.NewSlashPacketEntry(time.Now().Add(time.Hour), "chain-78", 1,
ed25519.GenPrivKey().PubKey().Address()))
cryptoutil.NewCryptoIdentityFromIntSeed(78).SDKConsAddress()))
providerKeeper.QueuePendingSlashPacketEntry(ctx,
providertypes.NewSlashPacketEntry(time.Now().Add(time.Hour), "chain-78", 2,
ed25519.GenPrivKey().PubKey().Address()))
cryptoutil.NewCryptoIdentityFromIntSeed(79).SDKConsAddress()))

// Queue 1 global entry for two other consumer chain IDs
providerKeeper.QueuePendingSlashPacketEntry(ctx,
providertypes.NewSlashPacketEntry(time.Now().Add(2*time.Hour), "chain-79", 1,
ed25519.GenPrivKey().PubKey().Address()))
cryptoutil.NewCryptoIdentityFromIntSeed(80).SDKConsAddress()))

providerKeeper.QueuePendingSlashPacketEntry(ctx,
providertypes.NewSlashPacketEntry(time.Now().Add(3*time.Hour), "chain-80", 1,
ed25519.GenPrivKey().PubKey().Address()))
cryptoutil.NewCryptoIdentityFromIntSeed(81).SDKConsAddress()))

// Delete entries for chain-78, confirm those are deleted, and the other two remain
providerKeeper.DeletePendingSlashPacketEntriesForConsumer(ctx, "chain-78")
Expand Down

0 comments on commit 01b13d3

Please sign in to comment.