codec

package
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2020 License: Apache-2.0 Imports: 20 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthCodec        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowCodec          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupCodec = fmt.Errorf("proto: unexpected end of group")
)

Functions

func MakeCodec

func MakeCodec(bm module.BasicManager) *codec.Codec

MakeCodec registers the necessary types and interfaces for an sdk.App. This codec is provided to all the modules the application depends on.

NOTE: This codec will be deprecated in favor of AppCodec once all modules are migrated.

Types

type Account

type Account struct {
	// sum defines a list of all acceptable concrete Account implementations.
	//
	// Types that are valid to be assigned to Sum:
	//	*Account_BaseAccount
	//	*Account_ContinuousVestingAccount
	//	*Account_DelayedVestingAccount
	//	*Account_PeriodicVestingAccount
	//	*Account_ModuleAccount
	//	*Account_EthAccount
	Sum isAccount_Sum `protobuf_oneof:"sum"`
}

Account defines the application-level Account type.

func (*Account) Descriptor

func (*Account) Descriptor() ([]byte, []int)

func (*Account) GetAccount

func (*Account) GetBaseAccount

func (m *Account) GetBaseAccount() *types.BaseAccount

func (*Account) GetContinuousVestingAccount

func (m *Account) GetContinuousVestingAccount() *types1.ContinuousVestingAccount

func (*Account) GetDelayedVestingAccount

func (m *Account) GetDelayedVestingAccount() *types1.DelayedVestingAccount

func (*Account) GetEthAccount

func (m *Account) GetEthAccount() *types3.EthAccount

func (*Account) GetModuleAccount

func (m *Account) GetModuleAccount() *types2.ModuleAccount

func (*Account) GetPeriodicVestingAccount

func (m *Account) GetPeriodicVestingAccount() *types1.PeriodicVestingAccount

func (*Account) GetSum

func (m *Account) GetSum() isAccount_Sum

func (*Account) Marshal

func (m *Account) Marshal() (dAtA []byte, err error)

func (*Account) MarshalTo

func (m *Account) MarshalTo(dAtA []byte) (int, error)

func (*Account) MarshalToSizedBuffer

func (m *Account) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Account) ProtoMessage

func (*Account) ProtoMessage()

func (*Account) Reset

func (m *Account) Reset()

func (*Account) SetAccount

func (*Account) Size

func (m *Account) Size() (n int)

func (*Account) String

func (m *Account) String() string

func (*Account) Unmarshal

func (m *Account) Unmarshal(dAtA []byte) error

func (*Account) XXX_DiscardUnknown

func (m *Account) XXX_DiscardUnknown()

func (*Account) XXX_Marshal

func (m *Account) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Account) XXX_Merge

func (m *Account) XXX_Merge(src proto.Message)

func (*Account) XXX_OneofWrappers

func (*Account) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*Account) XXX_Size

func (m *Account) XXX_Size() int

func (*Account) XXX_Unmarshal

func (m *Account) XXX_Unmarshal(b []byte) error

type Account_BaseAccount

type Account_BaseAccount struct {
	BaseAccount *types.BaseAccount `protobuf:"bytes,1,opt,name=base_account,json=baseAccount,proto3,oneof" json:"base_account,omitempty"`
}

func (*Account_BaseAccount) MarshalTo

func (m *Account_BaseAccount) MarshalTo(dAtA []byte) (int, error)

func (*Account_BaseAccount) MarshalToSizedBuffer

func (m *Account_BaseAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Account_BaseAccount) Size

func (m *Account_BaseAccount) Size() (n int)

type Account_ContinuousVestingAccount

type Account_ContinuousVestingAccount struct {
	ContinuousVestingAccount *types1.ContinuousVestingAccount `` /* 141-byte string literal not displayed */
}

func (*Account_ContinuousVestingAccount) MarshalTo

func (m *Account_ContinuousVestingAccount) MarshalTo(dAtA []byte) (int, error)

func (*Account_ContinuousVestingAccount) MarshalToSizedBuffer

func (m *Account_ContinuousVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Account_ContinuousVestingAccount) Size

func (m *Account_ContinuousVestingAccount) Size() (n int)

type Account_DelayedVestingAccount

type Account_DelayedVestingAccount struct {
	DelayedVestingAccount *types1.DelayedVestingAccount `` /* 132-byte string literal not displayed */
}

func (*Account_DelayedVestingAccount) MarshalTo

func (m *Account_DelayedVestingAccount) MarshalTo(dAtA []byte) (int, error)

func (*Account_DelayedVestingAccount) MarshalToSizedBuffer

func (m *Account_DelayedVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Account_DelayedVestingAccount) Size

func (m *Account_DelayedVestingAccount) Size() (n int)

type Account_EthAccount

type Account_EthAccount struct {
	EthAccount *types3.EthAccount `protobuf:"bytes,6,opt,name=eth_account,json=ethAccount,proto3,oneof" json:"eth_account,omitempty"`
}

func (*Account_EthAccount) MarshalTo

func (m *Account_EthAccount) MarshalTo(dAtA []byte) (int, error)

func (*Account_EthAccount) MarshalToSizedBuffer

func (m *Account_EthAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Account_EthAccount) Size

func (m *Account_EthAccount) Size() (n int)

type Account_ModuleAccount

type Account_ModuleAccount struct {
	ModuleAccount *types2.ModuleAccount `protobuf:"bytes,5,opt,name=module_account,json=moduleAccount,proto3,oneof" json:"module_account,omitempty"`
}

func (*Account_ModuleAccount) MarshalTo

func (m *Account_ModuleAccount) MarshalTo(dAtA []byte) (int, error)

func (*Account_ModuleAccount) MarshalToSizedBuffer

func (m *Account_ModuleAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Account_ModuleAccount) Size

func (m *Account_ModuleAccount) Size() (n int)

type Account_PeriodicVestingAccount

type Account_PeriodicVestingAccount struct {
	PeriodicVestingAccount *types1.PeriodicVestingAccount `` /* 135-byte string literal not displayed */
}

func (*Account_PeriodicVestingAccount) MarshalTo

func (m *Account_PeriodicVestingAccount) MarshalTo(dAtA []byte) (int, error)

func (*Account_PeriodicVestingAccount) MarshalToSizedBuffer

func (m *Account_PeriodicVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Account_PeriodicVestingAccount) Size

func (m *Account_PeriodicVestingAccount) Size() (n int)

type Codec

type Codec struct {
	*codecstd.Codec
}

Codec is a wrapper of the SDK standard Codec. It extends the Account interface by adding the EthAccount type for ethereum accounts.

func NewAppCodec

func NewAppCodec(amino *codec.Codec) *Codec

func (*Codec) MarshalAccount

func (c *Codec) MarshalAccount(accI authexported.Account) ([]byte, error)

MarshalAccount marshals an Account interface. If the given type implements the Marshaler interface, it is treated as a Proto-defined message and serialized that way. Otherwise, it falls back on the internal Amino codec.

func (*Codec) MarshalAccountJSON

func (c *Codec) MarshalAccountJSON(acc authexported.Account) ([]byte, error)

MarshalAccountJSON JSON encodes an account object implementing the Account interface.

func (*Codec) UnmarshalAccount

func (c *Codec) UnmarshalAccount(bz []byte) (authexported.Account, error)

UnmarshalAccount returns an Account interface from raw encoded account bytes of a Proto-based Account type. An error is returned upon decoding failure.

func (*Codec) UnmarshalAccountJSON

func (c *Codec) UnmarshalAccountJSON(bz []byte) (authexported.Account, error)

UnmarshalAccountJSON returns an Account from JSON encoded bytes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL