diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d65416915..e34a1468b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog BREAKING CHANGES +* msg.GetSignBytes() now returns bech32-encoded addresses in all cases FEATURES diff --git a/x/auth/stdtx.go b/x/auth/stdtx.go index 4858ae0b43..e08f77ee48 100644 --- a/x/auth/stdtx.go +++ b/x/auth/stdtx.go @@ -1,6 +1,8 @@ package auth import ( + "encoding/json" + sdk "github.com/cosmos/cosmos-sdk/types" crypto "github.com/tendermint/go-crypto" ) @@ -83,11 +85,11 @@ func (fee StdFee) Bytes() []byte { // and the Sequence numbers for each signature (prevent // inchain replay and enforce tx ordering per account). type StdSignDoc struct { - ChainID string `json:"chain_id"` - Sequences []int64 `json:"sequences"` - FeeBytes []byte `json:"fee_bytes"` - MsgBytes []byte `json:"msg_bytes"` - AltBytes []byte `json:"alt_bytes"` + ChainID string `json:"chain_id"` + Sequences []int64 `json:"sequences"` + FeeBytes json.RawMessage `json:"fee_bytes"` + MsgBytes json.RawMessage `json:"msg_bytes"` + AltBytes json.RawMessage `json:"alt_bytes"` } // StdSignBytes returns the bytes to sign for a transaction. @@ -96,8 +98,8 @@ func StdSignBytes(chainID string, sequences []int64, fee StdFee, msg sdk.Msg) [] bz, err := msgCdc.MarshalJSON(StdSignDoc{ ChainID: chainID, Sequences: sequences, - FeeBytes: fee.Bytes(), - MsgBytes: msg.GetSignBytes(), + FeeBytes: json.RawMessage(fee.Bytes()), + MsgBytes: json.RawMessage(msg.GetSignBytes()), }) if err != nil { panic(err)