Start removing HybridCodec (init + auth, bank, distribution) (#6838)
* Start to remove HybridCodec * Rename * Fixes * Test fixes * Cleanup
This commit is contained in:
+2
-2
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
// MarshalAny is a convenience function for packing the provided value in an
|
||||
// Any and then proto marshaling it to bytes
|
||||
func MarshalAny(m Marshaler, x interface{}) ([]byte, error) {
|
||||
func MarshalAny(m BinaryMarshaler, x interface{}) ([]byte, error) {
|
||||
msg, ok := x.(proto.Message)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("can't proto marshal %T", x)
|
||||
@@ -32,7 +32,7 @@ func MarshalAny(m Marshaler, x interface{}) ([]byte, error) {
|
||||
// Ex:
|
||||
// var x MyInterface
|
||||
// err := UnmarshalAny(unpacker, &x, bz)
|
||||
func UnmarshalAny(m Marshaler, iface interface{}, bz []byte) error {
|
||||
func UnmarshalAny(m BinaryMarshaler, iface interface{}, bz []byte) error {
|
||||
any := &types.Any{}
|
||||
|
||||
err := m.UnmarshalBinaryBare(bz, any)
|
||||
|
||||
+5
-3
@@ -17,9 +17,12 @@ type (
|
||||
//
|
||||
// 1. AminoCodec: Provides full Amino serialization compatibility.
|
||||
// 2. ProtoCodec: Provides full Protobuf serialization compatibility.
|
||||
// 3. HybridCodec: Provides Protobuf serialization for binary encoding and Amino
|
||||
// for JSON encoding.
|
||||
Marshaler interface {
|
||||
BinaryMarshaler
|
||||
JSONMarshaler
|
||||
}
|
||||
|
||||
BinaryMarshaler interface {
|
||||
MarshalBinaryBare(o ProtoMarshaler) ([]byte, error)
|
||||
MustMarshalBinaryBare(o ProtoMarshaler) []byte
|
||||
|
||||
@@ -32,7 +35,6 @@ type (
|
||||
UnmarshalBinaryLengthPrefixed(bz []byte, ptr ProtoMarshaler) error
|
||||
MustUnmarshalBinaryLengthPrefixed(bz []byte, ptr ProtoMarshaler)
|
||||
|
||||
JSONMarshaler
|
||||
types.AnyUnpacker
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user