Move codec.MarshalAny functions to codec.Marshaler interface #8049
Labels
C:Encoding
C:Types
T: API Breaking
Breaking changes that impact APIs and the SDK only (not state machine).
Milestone
Summary
In Remove bech32 PubKey support #7477 I added
codec.MarshalIfcJSON
andcodec.UnmarshalIfcJSON
as a helper methods for serializing interfaces (eg PubKey). The functions are completing thecodec.MarshalAny
andcodec.UnmarshalAny
to provide JSON support. They hide the complexity and low-level knowledge about wrapping interfaces intoAny
structure.For better UX this functions should be moved to the Marshaler interface:
Problem Definition
Currently we have many
(Un)marshal
functions: directly incodec
, some local helper as well as in implementations ofcodec.Marshaler
. It is confusing for the developer which function he should use.Proposal
Add
codec.[Un]marshalnterface[JSON]
functions tocodec.Marshaler
interface and move that functions to implementations.For Admin Use
The text was updated successfully, but these errors were encountered: