refactor(staking): add missing msgServer tests and move ValidateBasic() logic to msgServer (#15820)

This commit is contained in:
Likhita Polavarapu
2023-04-14 14:54:29 +00:00
committed by GitHub
parent d7c8353989
commit 7132a7624e
13 changed files with 1152 additions and 496 deletions
+2 -5
View File
@@ -7,6 +7,7 @@ import (
"time"
cmttypes "github.com/cometbft/cometbft/types"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
@@ -110,12 +111,8 @@ func (b *GenesisBuilder) GenTx(privVal secp256k1.PrivKey, val cmttypes.GenesisVa
if err != nil {
panic(err)
}
_, err = sdk.ValAddressFromBech32(msg.ValidatorAddress)
if err != nil {
panic(err)
}
if err := msg.ValidateBasic(); err != nil {
if err := msg.Validate(); err != nil {
panic(err)
}