Cosmos-sdk: SignBytes serialization for all governance transaction wasn't standardized

Created on 30 Jan 2019  ·  5Comments  ·  Source: cosmos/cosmos-sdk

Summary of Bug

See #3336

This apparently wasn't fixed for governance transactions.

Gaia commit: 30aebc1173ed6dae2848d1e845ec2f4e22750355

Steps to Reproduce


For Admin Use

  • [x] Not duplicate issue
  • [x] Appropriate labels applied
  • [x] Appropriate contributors tagged
  • [x] Contributor assigned/self-assigned
bug gov

All 5 comments

What makes you say this @faboweb? Just took a look at the latest develop and the commit you mentioned and all the GetSignBytes look correct to me:

e.g.

func (msg MsgSubmitProposal) GetSignBytes() []byte {
    bz := msgCdc.MustMarshalJSON(msg)
    return sdk.MustSortJSON(bz)
}

Each of the three total x/gov messages uses msgCdc.MustMarshalJSON(msg).

Because I needed to re-add the hack to remove {type, value} from the message for the created signature to be accepted.

See: https://github.com/cosmos/voyager/blob/develop/app/src/renderer/scripts/wallet.js#L85
Needed on commit: 30aebc1173ed6dae2848d1e845ec2f4e22750355

@faboweb so sorry, I completely didn't realize x/gov does NOT register these types via an init call. Thank you. Trivial fix.

Thx for the effort.

thanks 👍

Was this page helpful?
0 / 5 - 0 ratings