diff --git a/tests/integration/genutil/gentx_test.go b/tests/integration/genutil/gentx_test.go index 9a1c4811d1..61cf7dcebe 100644 --- a/tests/integration/genutil/gentx_test.go +++ b/tests/integration/genutil/gentx_test.go @@ -9,6 +9,7 @@ import ( "time" "cosmossdk.io/math" + "github.com/cometbft/cometbft/crypto/tmhash" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/crypto/keys/eth/ethsecp256k1" @@ -86,17 +87,21 @@ func (suite *GenTxTestSuite) SetupTest() { amount := sdk.NewInt64Coin(sdk.DefaultBondDenom, 50) one := math.OneInt() blsSecretKey1, _ := bls.RandKey() + blsProofBuf := blsSecretKey1.Sign(tmhash.Sum(blsSecretKey1.PublicKey().Marshal())) + blsProof1 := hex.EncodeToString(blsProofBuf.Marshal()) blsPk1 := hex.EncodeToString(blsSecretKey1.PublicKey().Marshal()) suite.msg1, err = stakingtypes.NewMsgCreateValidator( - sdk.AccAddress(pk1.Address()), pk1, amount, desc, comm, one, sdk.AccAddress(pk1.Address()), sdk.AccAddress(pk1.Address()), sdk.AccAddress(pk1.Address()), sdk.AccAddress(pk1.Address()), blsPk1) + sdk.AccAddress(pk1.Address()), pk1, amount, desc, comm, one, sdk.AccAddress(pk1.Address()), sdk.AccAddress(pk1.Address()), sdk.AccAddress(pk1.Address()), sdk.AccAddress(pk1.Address()), blsPk1, blsProof1) suite.NoError(err) blsSecretKey2, _ := bls.RandKey() blsPk2 := hex.EncodeToString(blsSecretKey2.PublicKey().Marshal()) + blsProofBuf = blsSecretKey2.Sign(tmhash.Sum(blsSecretKey2.PublicKey().Marshal())) + blsProof2 := hex.EncodeToString(blsProofBuf.Marshal()) suite.msg2, err = stakingtypes.NewMsgCreateValidator( - sdk.AccAddress(pk2.Address()), pk1, amount, desc, comm, one, sdk.AccAddress(pk2.Address()), sdk.AccAddress(pk2.Address()), sdk.AccAddress(pk2.Address()), sdk.AccAddress(pk2.Address()), blsPk2) + sdk.AccAddress(pk2.Address()), pk1, amount, desc, comm, one, sdk.AccAddress(pk2.Address()), sdk.AccAddress(pk2.Address()), sdk.AccAddress(pk2.Address()), sdk.AccAddress(pk2.Address()), blsPk2, blsProof2) suite.NoError(err) } diff --git a/x/staking/testutil/helpers.go b/x/staking/testutil/helpers.go index 51cd002d1a..b0b2861968 100644 --- a/x/staking/testutil/helpers.go +++ b/x/staking/testutil/helpers.go @@ -37,7 +37,7 @@ func NewHelper(t *testing.T, ctx sdk.Context, k *keeper.Keeper) *Helper { } // CreateValidator calls staking module `MsgServer/CreateValidator` to create a new validator -func (sh *Helper) CreateValidator(addr sdk.AccAddress, pk cryptotypes.PubKey, pv cryptotypes.PrivKey, stakeAmount math.Int, ok bool) { +func (sh *Helper) CreateValidator(addr sdk.AccAddress, pk cryptotypes.PubKey, stakeAmount math.Int, ok bool) { coin := sdk.NewCoin(sh.Denom, stakeAmount) sh.createValidator(addr, pk, coin, ok) } diff --git a/x/staking/types/msg_test.go b/x/staking/types/msg_test.go index f3334d7f9f..521c0cf935 100644 --- a/x/staking/types/msg_test.go +++ b/x/staking/types/msg_test.go @@ -17,7 +17,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - "github.com/cosmos/cosmos-sdk/crypto/keys/eth/ethsecp256k1" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -41,7 +41,7 @@ func TestMsgDecode(t *testing.T) { var pkUnmarshaled cryptotypes.PubKey err = cdc.UnmarshalInterface(pk1bz, &pkUnmarshaled) require.NoError(t, err) - require.True(t, pk1.Equals(pkUnmarshaled.(*ethsecp256k1.PubKey))) + require.True(t, pk1.Equals(pkUnmarshaled.(*ed25519.PubKey))) // now let's try to serialize the whole message blsSecretKey, _ := bls.RandKey()