Merge PR #5168: Add missing description field to MsgCreateValidator YAML output

This commit is contained in:
Rahul Dwivedi 2019-10-13 08:33:31 +05:30 committed by Alexander Bezobchuk
parent bb6bed4ed3
commit 92ea174ea6
2 changed files with 8 additions and 0 deletions

View File

@ -116,6 +116,7 @@ func (msg *MsgCreateValidator) UnmarshalJSON(bz []byte) error {
// custom marshal yaml function due to consensus pubkey
func (msg MsgCreateValidator) MarshalYAML() (interface{}, error) {
bs, err := yaml.Marshal(struct {
Description Description
Commission CommissionRates
MinSelfDelegation sdk.Int
DelegatorAddress sdk.AccAddress
@ -123,6 +124,7 @@ func (msg MsgCreateValidator) MarshalYAML() (interface{}, error) {
PubKey string
Value sdk.Coin
}{
Description: msg.Description,
Commission: msg.Commission,
MinSelfDelegation: msg.MinSelfDelegation,
DelegatorAddress: msg.DelegatorAddress,

View File

@ -179,6 +179,12 @@ func TestMsgMarshalYAML(t *testing.T) {
require.NoError(t, err)
want := fmt.Sprintf(`|
description:
moniker: a
identity: b
website: c
security_contact: d
details: e
commission:
rate: "0.000000000000000000"
max_rate: "0.000000000000000000"