Testcase/linter fixes

This commit is contained in:
Christopher Goes 2018-06-08 00:35:13 +02:00
parent a6c0db71e5
commit b166cc237f
No known key found for this signature in database
GPG Key ID: E828D98232D328D3
2 changed files with 3 additions and 6 deletions

View File

@ -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"`

View File

@ -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))
}