diff --git a/x/bank/msgs.go b/x/bank/msgs.go index e0d73bf08a..48e62d8350 100644 --- a/x/bank/msgs.go +++ b/x/bank/msgs.go @@ -150,6 +150,7 @@ type Input struct { Coins sdk.Coins `json:"coins"` } +// Return bytes to sign for Input func (in Input) GetSignBytes() []byte { bin, err := msgCdc.MarshalJSON(struct { Address string `json:"address"` @@ -196,6 +197,7 @@ type Output struct { Coins sdk.Coins `json:"coins"` } +// Return bytes to sign for Output func (out Output) GetSignBytes() []byte { bin, err := msgCdc.MarshalJSON(struct { Address string `json:"address"` diff --git a/x/bank/msgs_test.go b/x/bank/msgs_test.go index 06adad1ef7..90b4869db0 100644 --- a/x/bank/msgs_test.go +++ b/x/bank/msgs_test.go @@ -257,12 +257,7 @@ func TestMsgIssueGetSignBytes(t *testing.T) { } res := msg.GetSignBytes() - unmarshaledMsg := &MsgIssue{} - msgCdc.UnmarshalJSON(res, unmarshaledMsg) - assert.Equal(t, &msg, unmarshaledMsg) - - // TODO bad results - expected := `{"type":"72E617C06ABAD0","value":{"banker":"696E707574","outputs":[{"address":"6C6F616E2D66726F6D2D62616E6B","coins":[{"denom":"atom","amount":10}]}]}}` + expected := `{"banker":"cosmosaccaddr1d9h8qat5e4ehc5","outputs":[{"address":"cosmosaccaddr1d3hkzm3dveex7mfdvfsku6cwsauqd","coins":[{"denom":"atom","amount":10}]}]}` assert.Equal(t, expected, string(res)) }