test: use correct key types when creating validators (#19255)

This commit is contained in:
Connor Davis 2024-01-25 14:59:40 -06:00 committed by GitHub
parent 8120a86eaa
commit 927ac38dc7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -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)
@ -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)
}

View File

@ -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)
}