Skip to content

Commit

Permalink
test: use correct key types when creating validators (#19255)
Browse files Browse the repository at this point in the history
  • Loading branch information
PoisonPhang authored Jan 25, 2024
1 parent 8120a86 commit 927ac38
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/integration/staking/simulation/operations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (s *SimTestSuite) SetupTest() {

// create validator set with single validator
account := accounts[0]
cmtPk, err := cryptocodec.ToCmtPubKeyInterface(account.PubKey)
cmtPk, err := cryptocodec.ToCmtPubKeyInterface(account.ConsKey.PubKey())
require.NoError(s.T(), err)
validator := cmttypes.NewValidator(cmtPk, 1)

Expand Down Expand Up @@ -277,7 +277,7 @@ func (s *SimTestSuite) TestSimulateMsgDelegate() {
require.Equal("cosmos1p8wcgrjr4pjju90xg6u9cgq55dxwq8j7u4x9a0", msg.DelegatorAddress)
require.Equal("stake", msg.Amount.Denom)
require.Equal(sdk.MsgTypeURL(&types.MsgDelegate{}), sdk.MsgTypeURL(&msg))
require.Equal("cosmosvaloper1tnh2q55v8wyygtt9srz5safamzdengsn9dsd7z", msg.ValidatorAddress)
require.Equal("cosmosvaloper122js6qry7nlgp63gcse8muknspuxur77vj3kkr", msg.ValidatorAddress)
require.Len(futureOperations, 0)
}

Expand Down
2 changes: 1 addition & 1 deletion tests/sims/slashing/operations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (suite *SimTestSuite) SetupTest() {
// create validator (non random as using a seed)
createValidator := func() (*cmttypes.ValidatorSet, error) {
account := accounts[0]
cmtPk, err := cryptocodec.ToCmtPubKeyInterface(account.PubKey)
cmtPk, err := cryptocodec.ToCmtPubKeyInterface(account.ConsKey.PubKey())
if err != nil {
return nil, fmt.Errorf("failed to create pubkey: %w", err)
}
Expand Down

0 comments on commit 927ac38

Please sign in to comment.