Skip to content

Commit

Permalink
Merge PR #3797: Have MsgCreateValidator.UnmarshalJSON return an error…
Browse files Browse the repository at this point in the history
… rather than panic.
  • Loading branch information
smoelius authored and cwgoes committed Mar 4, 2019
1 parent 05529f9 commit c7f6a3e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion x/staking/types/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ func (msg *MsgCreateValidator) UnmarshalJSON(bz []byte) error {
msg.Commission = msgCreateValJSON.Commission
msg.DelegatorAddress = msgCreateValJSON.DelegatorAddress
msg.ValidatorAddress = msgCreateValJSON.ValidatorAddress
msg.PubKey = sdk.MustGetConsPubKeyBech32(msgCreateValJSON.PubKey)
var err error
msg.PubKey, err = sdk.GetConsPubKeyBech32(msgCreateValJSON.PubKey)
if err != nil {
return err
}
msg.Value = msgCreateValJSON.Value
msg.MinSelfDelegation = msgCreateValJSON.MinSelfDelegation

Expand Down

0 comments on commit c7f6a3e

Please sign in to comment.