Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Improve gentx validation & error messages #11500

Merged
merged 14 commits into from
Mar 31, 2022
Prev Previous commit
Next Next commit
Update x/genutil/types/genesis_state.go
Co-authored-by: Aleksandr Bezobchuk <[email protected]>
  • Loading branch information
anilcse and alexanderbez authored Mar 30, 2022
commit 7662bab0b7c42761a9b2aec468a8b731e20efe8c
3 changes: 1 addition & 2 deletions x/genutil/types/genesis_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ func ValidateAndGetGenTx(genTx json.RawMessage, txJSONDecoder sdk.TxDecoder) (sd

// TODO: abstract back to staking
if _, ok := msgs[0].(*stakingtypes.MsgCreateValidator); !ok {
return tx, fmt.Errorf(
"genesis transaction %v does not contain a MsgCreateValidator", tx)
return tx, fmt.Errorf("unexpected GenTx message type; expected: MsgCreateValidator, got: %T", msgs[0])
}

if err := msgs[0].ValidateBasic(); err != nil {
Expand Down