Documentation ¶
Index ¶
- Constants
- func AddressStoreKey(addr types.Address) []byte
- func RegisterCodec(cdc *go_amino.Codec)
- type Account
- type AccountMapper
- func (mapper *AccountMapper) Copy() mapper.IMapper
- func (mapper *AccountMapper) DecodeAccount(bz []byte) (acc Account)
- func (mapper *AccountMapper) EncodeAccount(acc Account) []byte
- func (mapper *AccountMapper) GetAccount(addr types.Address) (acc Account)
- func (mapper *AccountMapper) GetNonce(addr types.Address) (uint64, types.Error)
- func (mapper *AccountMapper) GetPubKey(addr types.Address) (crypto.PubKey, types.Error)
- func (mapper *AccountMapper) IterateAccounts(process func(Account) (stop bool))
- func (mapper *AccountMapper) Name() string
- func (mapper *AccountMapper) NewAccountWithAddress(add types.Address) Account
- func (mapper *AccountMapper) SetAccount(acc Account)
- func (mapper *AccountMapper) SetNonce(addr types.Address, nonce uint64) types.Error
- type BaseAccount
- func (accnt *BaseAccount) GetAddress() types.Address
- func (accnt *BaseAccount) GetNonce() uint64
- func (accnt *BaseAccount) GetPubicKey() crypto.PubKey
- func (accnt *BaseAccount) SetAddress(addr types.Address) error
- func (accnt *BaseAccount) SetNonce(nonce uint64) error
- func (accnt *BaseAccount) SetPublicKey(pubKey crypto.PubKey) error
Constants ¶
View Source
const (
AccountMapperName = "accountmapper"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Account ¶
type Account interface { GetAddress() types.Address SetAddress(addr types.Address) error GetPubicKey() crypto.PubKey SetPublicKey(pubKey crypto.PubKey) error GetNonce() uint64 SetNonce(nonce uint64) error }
func ProtoBaseAccount ¶
func ProtoBaseAccount() Account
type AccountMapper ¶
type AccountMapper struct { *mapper.BaseMapper // contains filtered or unexported fields }
对BaseAccount存储操作进行包装的结构,可进行序列化
func (*AccountMapper) Copy ¶
func (mapper *AccountMapper) Copy() mapper.IMapper
func (*AccountMapper) DecodeAccount ¶
func (mapper *AccountMapper) DecodeAccount(bz []byte) (acc Account)
func (*AccountMapper) EncodeAccount ¶
func (mapper *AccountMapper) EncodeAccount(acc Account) []byte
func (*AccountMapper) GetAccount ¶
func (mapper *AccountMapper) GetAccount(addr types.Address) (acc Account)
从存储中获得账户
func (*AccountMapper) IterateAccounts ¶
func (mapper *AccountMapper) IterateAccounts(process func(Account) (stop bool))
遍历并用闭包批量处理所存储的全部账户
func (*AccountMapper) Name ¶
func (mapper *AccountMapper) Name() string
func (*AccountMapper) NewAccountWithAddress ¶
func (mapper *AccountMapper) NewAccountWithAddress(add types.Address) Account
用指定地址生成账户返回
type BaseAccount ¶
type BaseAccount struct { AccountAddress types.Address `json:"account_address"` // account address Publickey crypto.PubKey `json:"public_key"` // public key Nonce uint64 `json:"nonce"` // identifies tx_status of an account }
func (*BaseAccount) GetAddress ¶
func (accnt *BaseAccount) GetAddress() types.Address
getter for account address
func (*BaseAccount) GetPubicKey ¶
func (accnt *BaseAccount) GetPubicKey() crypto.PubKey
getter for public key
func (*BaseAccount) SetAddress ¶
func (accnt *BaseAccount) SetAddress(addr types.Address) error
setter for account address
func (*BaseAccount) SetNonce ¶
func (accnt *BaseAccount) SetNonce(nonce uint64) error
setter for nonce
func (*BaseAccount) SetPublicKey ¶
func (accnt *BaseAccount) SetPublicKey(pubKey crypto.PubKey) error
setter for public key
Click to show internal directories.
Click to hide internal directories.