You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed in #13140, it would be nice if modules didn't have to deal with converting bech32 address strings to bytes. Sometimes to avoid making the conversion, modules store addresses in state as bytes which is inefficient and unneeded. The reason addresses are strings in messages is so that they render correctly on the ledger with amino JSON. Now that we have SIGN_MODE_TEXTUAL, we can create a value renderer specifically to do this rendering so that as far as modules are concerned addresses are bytes.
Proposal
Support bytes fields in x/txGetSignersContext
Add a value renderer to SIGN_MODE_TEXTUAL for the cosmos_proto.scalarcosmos.AddressBytes which renders it as a bech32 address string
The text was updated successfully, but these errors were encountered:
Since Amino JSON is going to stay there for a while, and technically every msg should support it, does it mean that we are going to accept address bytes in Amino JSON as a part of the deprecation process?
Yes amino JSON would support bytes signers but unfortunately they would likely get rendered as base64 unless we can figure out some special behavior with an annotation. That actually might not be too complex now that we render amino json with protoreflect. We'd just need to coordinate with js implementations. What do you think @kocubinski ?
Summary
Support using
bytes
fields for message signers.Problem Definition
As discussed in #13140, it would be nice if modules didn't have to deal with converting bech32 address strings to bytes. Sometimes to avoid making the conversion, modules store addresses in state as bytes which is inefficient and unneeded. The reason addresses are strings in messages is so that they render correctly on the ledger with amino JSON. Now that we have
SIGN_MODE_TEXTUAL
, we can create a value renderer specifically to do this rendering so that as far as modules are concerned addresses are bytes.Proposal
bytes
fields inx/tx
GetSignersContext
SIGN_MODE_TEXTUAL
for thecosmos_proto.scalar
cosmos.AddressBytes
which renders it as a bech32 address stringThe text was updated successfully, but these errors were encountered: