Documentation ¶
Index ¶
- Variables
- func IsStateAccountKey(key string) bool
- func IsStateBalanceKey(key string) bool
- func IsStateCurrencyDesignKey(key string) bool
- func LoadStateAccountValue(st base.State) (types.Account, error)
- func StateBalanceKeyPrefix(a base.Address, cid types.CurrencyID) string
- func StateBalanceValue(st base.State) (types.Amount, error)
- func StateCurrencyDesignValue(st base.State) (types.CurrencyDesign, error)
- func StateKeyAccount(a base.Address) string
- func StateKeyBalance(a base.Address, cid types.CurrencyID) string
- func StateKeyCurrencyDesign(cid types.CurrencyID) string
- func StateKeysValue(st base.State) (types.AccountKeys, 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 CurrencyDesignStateValue
- func (c *CurrencyDesignStateValue) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
- func (c *CurrencyDesignStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (c CurrencyDesignStateValue) HashBytes() []byte
- func (c CurrencyDesignStateValue) Hint() hint.Hint
- func (c CurrencyDesignStateValue) IsValid([]byte) error
- func (c CurrencyDesignStateValue) MarshalBSON() ([]byte, error)
- func (c CurrencyDesignStateValue) MarshalJSON() ([]byte, error)
- type CurrencyDesignStateValueBSONUnmarshaler
- type CurrencyDesignStateValueJSONMarshaler
- type CurrencyDesignStateValueJSONUnmarshaler
- type DeductBalanceStateValue
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") CurrencyDesignStateValueHint = hint.MustNewHint("currency-design-state-value-v0.0.1") )
View Source
var ( StateKeyAccountSuffix = ":account" StateKeyBalanceSuffix = ":balance" StateKeyCurrencyDesignPrefix = "currencydesign:" )
Functions ¶
func IsStateAccountKey ¶
func IsStateBalanceKey ¶
func StateBalanceKeyPrefix ¶
func StateBalanceKeyPrefix(a base.Address, cid types.CurrencyID) string
func StateCurrencyDesignValue ¶
func StateCurrencyDesignValue(st base.State) (types.CurrencyDesign, error)
func StateKeyAccount ¶
func StateKeyBalance ¶
func StateKeyBalance(a base.Address, cid types.CurrencyID) string
func StateKeyCurrencyDesign ¶
func StateKeyCurrencyDesign(cid types.CurrencyID) string
func StateKeysValue ¶
func StateKeysValue(st base.State) (types.AccountKeys, error)
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 CurrencyDesignStateValue ¶
type CurrencyDesignStateValue struct { hint.BaseHinter CurrencyDesign types.CurrencyDesign }
func NewCurrencyDesignStateValue ¶
func NewCurrencyDesignStateValue(currencyDesign types.CurrencyDesign) CurrencyDesignStateValue
func (*CurrencyDesignStateValue) DecodeBSON ¶
func (c *CurrencyDesignStateValue) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
func (*CurrencyDesignStateValue) DecodeJSON ¶
func (c *CurrencyDesignStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error
func (CurrencyDesignStateValue) HashBytes ¶
func (c CurrencyDesignStateValue) HashBytes() []byte
func (CurrencyDesignStateValue) Hint ¶
func (c CurrencyDesignStateValue) Hint() hint.Hint
func (CurrencyDesignStateValue) IsValid ¶
func (c CurrencyDesignStateValue) IsValid([]byte) error
func (CurrencyDesignStateValue) MarshalBSON ¶
func (c CurrencyDesignStateValue) MarshalBSON() ([]byte, error)
func (CurrencyDesignStateValue) MarshalJSON ¶
func (c CurrencyDesignStateValue) MarshalJSON() ([]byte, error)
type CurrencyDesignStateValueJSONMarshaler ¶
type CurrencyDesignStateValueJSONMarshaler struct { hint.BaseHinter CurrencyDesign types.CurrencyDesign `json:"currencydesign"` }
type CurrencyDesignStateValueJSONUnmarshaler ¶
type CurrencyDesignStateValueJSONUnmarshaler struct {
CD json.RawMessage `json:"currencydesign"`
}
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
Click to show internal directories.
Click to hide internal directories.