Documentation ¶
Index ¶
- Variables
- func AccountStateKey(a base.Address) string
- func BalanceStateKey(a base.Address, cid types.CurrencyID) string
- func BalanceStateKeyPrefix(a base.Address, cid types.CurrencyID) string
- func DesignStateKey(cid types.CurrencyID) string
- func GetAccountKeysFromState(st base.State) (types.AccountKeys, error)
- func GetDesignFromState(st base.State) (types.CurrencyDesign, error)
- func IsAccountStateKey(key string) bool
- func IsBalanceStateKey(key string) bool
- func IsDesignStateKey(key string) bool
- func LoadAccountStateValue(st base.State) (*types.Account, error)
- func StateBalanceValue(st base.State) (types.Amount, error)
- type AccountStateValue
- func (a *AccountStateValue) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
- func (a *AccountStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (a AccountStateValue) HashBytes() []byte
- func (a AccountStateValue) Hint() hint.Hint
- func (a AccountStateValue) IsValid([]byte) error
- func (a AccountStateValue) MarshalBSON() ([]byte, error)
- func (a AccountStateValue) MarshalJSON() ([]byte, error)
- type AccountStateValueBSONUnmarshaler
- type AccountStateValueJSONMarshaler
- type AccountStateValueJSONUnmarshaler
- type AddBalanceStateValue
- type BalanceStateValue
- func (b *BalanceStateValue) DecodeBSON(v []byte, enc *bsonenc.Encoder) error
- func (b *BalanceStateValue) DecodeJSON(v []byte, enc encoder.Encoder) error
- func (b BalanceStateValue) HashBytes() []byte
- func (b BalanceStateValue) Hint() hint.Hint
- func (b BalanceStateValue) IsValid([]byte) error
- func (b BalanceStateValue) MarshalBSON() ([]byte, error)
- func (b BalanceStateValue) MarshalJSON() ([]byte, error)
- type BalanceStateValueBSONUnmarshaler
- type BalanceStateValueJSONMarshaler
- type BalanceStateValueJSONUnmarshaler
- type BalanceStateValueMerger
- type CurrencyDesignStateValueJSONUnmarshaler
- type DeductBalanceStateValue
- type DesignStateValue
- func (c *DesignStateValue) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
- func (c *DesignStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (c DesignStateValue) HashBytes() []byte
- func (c DesignStateValue) Hint() hint.Hint
- func (c DesignStateValue) IsValid([]byte) error
- func (c DesignStateValue) MarshalBSON() ([]byte, error)
- func (c DesignStateValue) MarshalJSON() ([]byte, error)
- type DesignStateValueBSONUnmarshaler
- type DesignStateValueJSONMarshaler
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AccountStateValueHint = hint.MustNewHint("account-state-value-v0.0.1") BalanceStateValueHint = hint.MustNewHint("balance-state-value-v0.0.1") DesignStateValueHint = hint.MustNewHint("currency-design-state-value-v0.0.1") )
View Source
var ( AccountStateKeySuffix = ":account" BalanceStateKeySuffix = ":balance" DesignStateKeyPrefix = "currencydesign:" )
Functions ¶
func AccountStateKey ¶
func BalanceStateKey ¶
func BalanceStateKey(a base.Address, cid types.CurrencyID) string
func BalanceStateKeyPrefix ¶
func BalanceStateKeyPrefix(a base.Address, cid types.CurrencyID) string
func DesignStateKey ¶
func DesignStateKey(cid types.CurrencyID) string
func GetAccountKeysFromState ¶
func GetAccountKeysFromState(st base.State) (types.AccountKeys, error)
func GetDesignFromState ¶
func GetDesignFromState(st base.State) (types.CurrencyDesign, error)
func IsAccountStateKey ¶
func IsBalanceStateKey ¶
func IsDesignStateKey ¶
Types ¶
type AccountStateValue ¶
type AccountStateValue struct { hint.BaseHinter Account types.Account }
func NewAccountStateValue ¶
func NewAccountStateValue(account types.Account) AccountStateValue
func (*AccountStateValue) DecodeBSON ¶
func (a *AccountStateValue) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
func (*AccountStateValue) DecodeJSON ¶
func (a *AccountStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error
func (AccountStateValue) HashBytes ¶
func (a AccountStateValue) HashBytes() []byte
func (AccountStateValue) Hint ¶
func (a AccountStateValue) Hint() hint.Hint
func (AccountStateValue) IsValid ¶
func (a AccountStateValue) IsValid([]byte) error
func (AccountStateValue) MarshalBSON ¶
func (a AccountStateValue) MarshalBSON() ([]byte, error)
func (AccountStateValue) MarshalJSON ¶
func (a AccountStateValue) MarshalJSON() ([]byte, error)
type AccountStateValueJSONMarshaler ¶
type AccountStateValueJSONMarshaler struct { hint.BaseHinter Account types.Account `json:"account"` }
type AccountStateValueJSONUnmarshaler ¶
type AccountStateValueJSONUnmarshaler struct {
AC json.RawMessage `json:"account"`
}
type AddBalanceStateValue ¶
func NewAddBalanceStateValue ¶
func NewAddBalanceStateValue(amount types.Amount) AddBalanceStateValue
func (AddBalanceStateValue) HashBytes ¶
func (b AddBalanceStateValue) HashBytes() []byte
func (AddBalanceStateValue) IsValid ¶
func (b AddBalanceStateValue) IsValid([]byte) error
type BalanceStateValue ¶
type BalanceStateValue struct { hint.BaseHinter Amount types.Amount }
func NewBalanceStateValue ¶
func NewBalanceStateValue(amount types.Amount) BalanceStateValue
func (*BalanceStateValue) DecodeBSON ¶
func (b *BalanceStateValue) DecodeBSON(v []byte, enc *bsonenc.Encoder) error
func (*BalanceStateValue) DecodeJSON ¶
func (b *BalanceStateValue) DecodeJSON(v []byte, enc encoder.Encoder) error
func (BalanceStateValue) HashBytes ¶
func (b BalanceStateValue) HashBytes() []byte
func (BalanceStateValue) Hint ¶
func (b BalanceStateValue) Hint() hint.Hint
func (BalanceStateValue) IsValid ¶
func (b BalanceStateValue) IsValid([]byte) error
func (BalanceStateValue) MarshalBSON ¶
func (b BalanceStateValue) MarshalBSON() ([]byte, error)
func (BalanceStateValue) MarshalJSON ¶
func (b BalanceStateValue) MarshalJSON() ([]byte, error)
type BalanceStateValueJSONMarshaler ¶
type BalanceStateValueJSONMarshaler struct { hint.BaseHinter Amount types.Amount `json:"amount"` }
type BalanceStateValueJSONUnmarshaler ¶
type BalanceStateValueJSONUnmarshaler struct {
AM json.RawMessage `json:"amount"`
}
type BalanceStateValueMerger ¶
type BalanceStateValueMerger struct { *common.BaseStateValueMerger sync.Mutex // contains filtered or unexported fields }
func NewBalanceStateValueMerger ¶
func NewBalanceStateValueMerger(height base.Height, key string, currency types.CurrencyID, st base.State) *BalanceStateValueMerger
func (*BalanceStateValueMerger) CloseValue ¶
func (s *BalanceStateValueMerger) CloseValue() (base.State, error)
func (*BalanceStateValueMerger) Merge ¶
func (s *BalanceStateValueMerger) Merge(value base.StateValue, ops util.Hash) error
type CurrencyDesignStateValueJSONUnmarshaler ¶
type CurrencyDesignStateValueJSONUnmarshaler struct {
CD json.RawMessage `json:"currency_design"`
}
type DeductBalanceStateValue ¶
func NewDeductBalanceStateValue ¶
func NewDeductBalanceStateValue(amount types.Amount) DeductBalanceStateValue
func (DeductBalanceStateValue) HashBytes ¶
func (b DeductBalanceStateValue) HashBytes() []byte
func (DeductBalanceStateValue) IsValid ¶
func (b DeductBalanceStateValue) IsValid([]byte) error
type DesignStateValue ¶
type DesignStateValue struct { hint.BaseHinter Design types.CurrencyDesign }
func NewCurrencyDesignStateValue ¶
func NewCurrencyDesignStateValue(currencyDesign types.CurrencyDesign) DesignStateValue
func (*DesignStateValue) DecodeBSON ¶
func (c *DesignStateValue) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
func (*DesignStateValue) DecodeJSON ¶
func (c *DesignStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error
func (DesignStateValue) HashBytes ¶
func (c DesignStateValue) HashBytes() []byte
func (DesignStateValue) Hint ¶
func (c DesignStateValue) Hint() hint.Hint
func (DesignStateValue) IsValid ¶
func (c DesignStateValue) IsValid([]byte) error
func (DesignStateValue) MarshalBSON ¶
func (c DesignStateValue) MarshalBSON() ([]byte, error)
func (DesignStateValue) MarshalJSON ¶
func (c DesignStateValue) MarshalJSON() ([]byte, error)
type DesignStateValueJSONMarshaler ¶
type DesignStateValueJSONMarshaler struct { hint.BaseHinter CurrencyDesign types.CurrencyDesign `json:"currency_design"` }
Click to show internal directories.
Click to hide internal directories.