currency

package
v0.0.1-stable Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: GPL-3.0 Imports: 30 Imported by: 12

Documentation

Overview

Package currency is the currency model, based on mitum.

Index

Constants

View Source
const (
	FeeerNil   = "nil"
	FeeerFixed = "fixed"
	FeeerRatio = "ratio"
)

Variables

View Source
var (
	AccountType   = hint.Type("mitum-currency-account")
	AccountHint   = hint.NewHint(AccountType, "v0.0.1")
	AccountHinter = Account{BaseHinter: hint.NewBaseHinter(AccountHint)}
)
View Source
var (
	AddressType       = hint.Type("mca")
	AddressHint       = hint.NewHint(AddressType, "v0.0.1")
	AddressHinter     = Address{StringAddress: base.NewStringAddressWithHint(AddressHint, "")}
	ZeroAddressSuffix = "-X"
)
View Source
var (
	AmountType   = hint.Type("mitum-currency-amount")
	AmountHint   = hint.NewHint(AmountType, "v0.0.1")
	AmountHinter = Amount{BaseHinter: hint.NewBaseHinter(AmountHint)}
)
View Source
var (
	NilBig       = NewBig(-1)
	NilBigString = big.NewInt(-1).String()
	ZeroBig      = NewBig(0)
)
View Source
var (
	CreateAccountsFactType   = hint.Type("mitum-currency-create-accounts-operation-fact")
	CreateAccountsFactHint   = hint.NewHint(CreateAccountsFactType, "v0.0.1")
	CreateAccountsFactHinter = CreateAccountsFact{BaseHinter: hint.NewBaseHinter(CreateAccountsFactHint)}
	CreateAccountsType       = hint.Type("mitum-currency-create-accounts-operation")
	CreateAccountsHint       = hint.NewHint(CreateAccountsType, "v0.0.1")
	CreateAccountsHinter     = CreateAccounts{BaseOperation: operationHinter(CreateAccountsHint)}
)
View Source
var (
	CreateAccountsItemMultiAmountsType   = hint.Type("mitum-currency-create-accounts-multiple-amounts")
	CreateAccountsItemMultiAmountsHint   = hint.NewHint(CreateAccountsItemMultiAmountsType, "v0.0.1")
	CreateAccountsItemMultiAmountsHinter = CreateAccountsItemMultiAmounts{
		BaseCreateAccountsItem: BaseCreateAccountsItem{
			BaseHinter: hint.NewBaseHinter(CreateAccountsItemMultiAmountsHint),
		},
	}
)
View Source
var (
	CreateAccountsItemSingleAmountType   = hint.Type("mitum-currency-create-accounts-single-amount")
	CreateAccountsItemSingleAmountHint   = hint.NewHint(CreateAccountsItemSingleAmountType, "v0.0.1")
	CreateAccountsItemSingleAmountHinter = CreateAccountsItemSingleAmount{
		BaseCreateAccountsItem: BaseCreateAccountsItem{
			BaseHinter: hint.NewBaseHinter(CreateAccountsItemSingleAmountHint),
		},
	}
)
View Source
var (
	MinLengthCurrencyID = 3
	MaxLengthCurrencyID = 10
	ReValidCurrencyID   = regexp.MustCompile(`^[A-Z0-9][A-Z0-9_\.\!\$\*\@]*[A-Z0-9]$`)
)
View Source
var (
	CurrencyDesignType   = hint.Type("mitum-currency-currency-design")
	CurrencyDesignHint   = hint.NewHint(CurrencyDesignType, "v0.0.1")
	CurrencyDesignHinter = CurrencyDesign{BaseHinter: hint.NewBaseHinter(CurrencyDesignHint)}
)
View Source
var (
	CurrencyPolicyType   = hint.Type("mitum-currency-currency-policy")
	CurrencyPolicyHint   = hint.NewHint(CurrencyPolicyType, "v0.0.1")
	CurrencyPolicyHinter = CurrencyPolicy{BaseHinter: hint.NewBaseHinter(CurrencyPolicyHint)}
)
View Source
var (
	CurrencyPolicyUpdaterFactType   = hint.Type("mitum-currency-currency-policy-updater-operation-fact")
	CurrencyPolicyUpdaterFactHint   = hint.NewHint(CurrencyPolicyUpdaterFactType, "v0.0.1")
	CurrencyPolicyUpdaterFactHinter = CurrencyPolicyUpdaterFact{
		BaseHinter: hint.NewBaseHinter(CurrencyPolicyUpdaterFactHint),
	}
	CurrencyPolicyUpdaterType   = hint.Type("mitum-currency-currency-policy-updater-operation")
	CurrencyPolicyUpdaterHint   = hint.NewHint(CurrencyPolicyUpdaterType, "v0.0.1")
	CurrencyPolicyUpdaterHinter = CurrencyPolicyUpdater{BaseOperation: operationHinter(CurrencyPolicyUpdaterHint)}
)
View Source
var (
	CurrencyRegisterFactType   = hint.Type("mitum-currency-currency-register-operation-fact")
	CurrencyRegisterFactHint   = hint.NewHint(CurrencyRegisterFactType, "v0.0.1")
	CurrencyRegisterFactHinter = CurrencyRegisterFact{BaseHinter: hint.NewBaseHinter(CurrencyRegisterFactHint)}
	CurrencyRegisterType       = hint.Type("mitum-currency-currency-register-operation")
	CurrencyRegisterHint       = hint.NewHint(CurrencyRegisterType, "v0.0.1")
	CurrencyRegisterHinter     = CurrencyRegister{BaseOperation: operationHinter(CurrencyRegisterHint)}
)
View Source
var (
	FeeOperationFactType   = hint.Type("mitum-currency-fee-operation-fact")
	FeeOperationFactHint   = hint.NewHint(FeeOperationFactType, "v0.0.1")
	FeeOperationFactHinter = FeeOperationFact{BaseHinter: hint.NewBaseHinter(FeeOperationFactHint)}
	FeeOperationType       = hint.Type("mitum-currency-fee-operation")
	FeeOperationHint       = hint.NewHint(FeeOperationType, "v0.0.1")
	FeeOperationHinter     = FeeOperation{BaseHinter: hint.NewBaseHinter(FeeOperationHint)}
)
View Source
var (
	NilFeeerType     = hint.Type("mitum-currency-nil-feeer")
	NilFeeerHint     = hint.NewHint(NilFeeerType, "v0.0.1")
	NilFeeerHinter   = NilFeeer{BaseHinter: hint.NewBaseHinter(NilFeeerHint)}
	FixedFeeerType   = hint.Type("mitum-currency-fixed-feeer")
	FixedFeeerHint   = hint.NewHint(FixedFeeerType, "v0.0.1")
	FixedFeeerHinter = FixedFeeer{BaseHinter: hint.NewBaseHinter(FixedFeeerHint)}
	RatioFeeerType   = hint.Type("mitum-currency-ratio-feeer")
	RatioFeeerHint   = hint.NewHint(RatioFeeerType, "v0.0.1")
	RatioFeeerHinter = RatioFeeer{BaseHinter: hint.NewBaseHinter(RatioFeeerHint)}
)
View Source
var (
	GenesisCurrenciesFactType   = hint.Type("mitum-currency-genesis-currencies-operation-fact")
	GenesisCurrenciesFactHint   = hint.NewHint(GenesisCurrenciesFactType, "v0.0.1")
	GenesisCurrenciesFactHinter = GenesisCurrenciesFact{BaseHinter: hint.NewBaseHinter(GenesisCurrenciesFactHint)}
	GenesisCurrenciesType       = hint.Type("mitum-currency-genesis-currencies-operation")
	GenesisCurrenciesHint       = hint.NewHint(GenesisCurrenciesType, "v0.0.1")
	GenesisCurrenciesHinter     = GenesisCurrencies{BaseOperation: operation.EmptyBaseOperation(GenesisCurrenciesHint)}
)
View Source
var (
	AccountKeyType    = hint.Type("mitum-currency-key")
	AccountKeyHint    = hint.NewHint(AccountKeyType, "v0.0.1")
	AccountKeyHinter  = BaseAccountKey{BaseHinter: hint.NewBaseHinter(AccountKeyHint)}
	AccountKeysType   = hint.Type("mitum-currency-keys")
	AccountKeysHint   = hint.NewHint(AccountKeysType, "v0.0.1")
	AccountKeysHinter = BaseAccountKeys{BaseHinter: hint.NewBaseHinter(AccountKeysHint)}
)
View Source
var (
	KeyUpdaterFactType   = hint.Type("mitum-currency-keyupdater-operation-fact")
	KeyUpdaterFactHint   = hint.NewHint(KeyUpdaterFactType, "v0.0.1")
	KeyUpdaterFactHinter = KeyUpdaterFact{BaseHinter: hint.NewBaseHinter(KeyUpdaterFactHint)}
	KeyUpdaterType       = hint.Type("mitum-currency-keyupdater-operation")
	KeyUpdaterHint       = hint.NewHint(KeyUpdaterType, "v0.0.1")
	KeyUpdaterHinter     = KeyUpdater{BaseOperation: operationHinter(KeyUpdaterHint)}
)
View Source
var (
	StateKeyAccountSuffix        = ":account"
	StateKeyBalanceSuffix        = ":balance"
	StateKeyCurrencyDesignPrefix = "currencydesign:"
)
View Source
var (
	SuffrageInflationFactType   = hint.Type("mitum-currency-suffrage-inflation-operation-fact")
	SuffrageInflationFactHint   = hint.NewHint(SuffrageInflationFactType, "v0.0.1")
	SuffrageInflationFactHinter = SuffrageInflationFact{BaseHinter: hint.NewBaseHinter(SuffrageInflationFactHint)}
	SuffrageInflationType       = hint.Type("mitum-currency-suffrage-inflation-operation")
	SuffrageInflationHint       = hint.NewHint(SuffrageInflationType, "v0.0.1")
	SuffrageInflationHinter     = SuffrageInflation{BaseOperation: operationHinter(SuffrageInflationHint)}
)
View Source
var (
	TransfersFactType   = hint.Type("mitum-currency-transfers-operation-fact")
	TransfersFactHint   = hint.NewHint(TransfersFactType, "v0.0.1")
	TransfersFactHinter = TransfersFact{BaseHinter: hint.NewBaseHinter(TransfersFactHint)}
	TransfersType       = hint.Type("mitum-currency-transfers-operation")
	TransfersHint       = hint.NewHint(TransfersType, "v0.0.1")
	TransfersHinter     = Transfers{BaseOperation: operationHinter(TransfersHint)}
)
View Source
var (
	TransfersItemMultiAmountsType   = hint.Type("mitum-currency-transfers-item-multi-amounts")
	TransfersItemMultiAmountsHint   = hint.NewHint(TransfersItemMultiAmountsType, "v0.0.1")
	TransfersItemMultiAmountsHinter = TransfersItemMultiAmounts{
		BaseTransfersItem: BaseTransfersItem{BaseHinter: hint.NewBaseHinter(TransfersItemMultiAmountsHint)},
	}
)
View Source
var (
	TransfersItemSingleAmountType   = hint.Type("mitum-currency-transfers-item-single-amount")
	TransfersItemSingleAmountHint   = hint.NewHint(TransfersItemSingleAmountType, "v0.0.1")
	TransfersItemSingleAmountHinter = TransfersItemSingleAmount{
		BaseTransfersItem: BaseTransfersItem{BaseHinter: hint.NewBaseHinter(TransfersItemSingleAmountHint)},
	}
)
View Source
var MaxAccountKeyInKeys = 10
View Source
var MaxCreateAccountsItems uint = 10
View Source
var MaxMemoSize = 100 // TODO should be managed by policy
View Source
var MaxTransferItems uint = 10
View Source
var UnlimitedMaxFeeAmount = NewBig(-1)

Functions

func CalculateItemsFee

func CalculateItemsFee(cp *CurrencyPool, items []AmountsItem) (map[CurrencyID][2]Big, error)

func CheckEnoughBalance

func CheckEnoughBalance(
	holder base.Address,
	required map[CurrencyID][2]Big,
	getState func(key string) (state.State, bool, error),
) (map[CurrencyID]AmountState, error)

func IsStateAccountKey

func IsStateAccountKey(key string) bool

func IsStateBalanceKey

func IsStateBalanceKey(key string) bool

func IsStateCurrencyDesignKey

func IsStateCurrencyDesignKey(key string) bool

func IsValidMemo

func IsValidMemo(s string) error

func IsValidOperationFact

func IsValidOperationFact(fact operation.OperationFact, b []byte) error

func NewFeeOperationProcessor

func NewFeeOperationProcessor(cp *CurrencyPool, op FeeOperation) state.Processor

func NewFeeToken

func NewFeeToken(feeer Feeer, height base.Height) []byte

func SetStateAccountValue

func SetStateAccountValue(st state.State, v Account) (state.State, error)

func SetStateBalanceValue

func SetStateBalanceValue(st state.State, v Amount) (state.State, error)

func SetStateCurrencyDesignValue

func SetStateCurrencyDesignValue(st state.State, v CurrencyDesign) (state.State, error)

func SetStateKeysValue

func SetStateKeysValue(st state.State, v AccountKeys) (state.State, error)

func StateBalanceKeyPrefix

func StateBalanceKeyPrefix(a base.Address, cid CurrencyID) string

func StateKeyAccount

func StateKeyAccount(a base.Address) string

func StateKeyBalance

func StateKeyBalance(a base.Address, cid CurrencyID) string

func StateKeyCurrencyDesign

func StateKeyCurrencyDesign(cid CurrencyID) string

Types

type Account

type Account struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func LoadStateAccountValue

func LoadStateAccountValue(st state.State) (Account, error)

func NewAccount

func NewAccount(address base.Address, keys AccountKeys) (Account, error)

func NewAccountFromKeys

func NewAccountFromKeys(keys AccountKeys) (Account, error)

func ZeroAccount

func ZeroAccount(cid CurrencyID) (Account, error)

func (Account) Address

func (ac Account) Address() base.Address

func (Account) Bytes

func (ac Account) Bytes() []byte

func (Account) GenerateHash

func (ac Account) GenerateHash() valuehash.Hash

func (Account) Hash

func (ac Account) Hash() valuehash.Hash

func (Account) IsEmpty

func (ac Account) IsEmpty() bool

func (Account) Keys

func (ac Account) Keys() AccountKeys

func (Account) MarshalBSON

func (ac Account) MarshalBSON() ([]byte, error)

func (Account) MarshalJSON

func (ac Account) MarshalJSON() ([]byte, error)

func (Account) PackerJSON

func (ac Account) PackerJSON() AccountPackerJSON

func (Account) SetKeys

func (ac Account) SetKeys(keys AccountKeys) (Account, error)

func (*Account) UnpackBSON

func (ac *Account) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*Account) UnpackJSON

func (ac *Account) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type AccountBSONUnpacker

type AccountBSONUnpacker struct {
	H  valuehash.Bytes     `bson:"hash"`
	AD base.AddressDecoder `bson:"address"`
	KS bson.Raw            `bson:"keys"`
}

type AccountJSONUnpacker

type AccountJSONUnpacker struct {
	H  valuehash.Bytes     `json:"hash"`
	AD base.AddressDecoder `json:"address"`
	KS json.RawMessage     `json:"keys"`
}

type AccountKey

type AccountKey interface {
	hint.Hinter
	isvalid.IsValider
	util.Byter
	Key() key.Publickey
	Weight() uint
	Equal(AccountKey) bool
}

type AccountKeys

type AccountKeys interface {
	hint.Hinter
	isvalid.IsValider
	util.Byter
	valuehash.Hasher
	Threshold() uint
	Keys() []AccountKey
	Key(key.Publickey) (AccountKey, bool)
	Equal(AccountKeys) bool
}

func StateKeysValue

func StateKeysValue(st state.State) (AccountKeys, error)

type AccountPackerJSON

type AccountPackerJSON struct {
	jsonenc.HintedHead
	H  valuehash.Hash `json:"hash"`
	AD base.Address   `json:"address"`
	KS AccountKeys    `json:"keys"`
}

type Address

type Address struct {
	base.StringAddress
}

func NewAddress

func NewAddress(s string) Address

func NewAddressFromKeys

func NewAddressFromKeys(keys AccountKeys) (Address, error)

func ZeroAddress

func ZeroAddress(cid CurrencyID) Address

func (Address) IsValid

func (ca Address) IsValid([]byte) error

func (Address) MarshalBSONValue

func (ca Address) MarshalBSONValue() (bsontype.Type, []byte, error)

func (Address) MarshalText

func (ca Address) MarshalText() ([]byte, error)

func (Address) SetHint

func (ca Address) SetHint(ht hint.Hint) hint.Hinter

func (*Address) UnpackBSON

func (ca *Address) UnpackBSON(b []byte, _ *bsonenc.Encoder) error

func (*Address) UnpackJSON

func (ca *Address) UnpackJSON(b []byte, _ *jsonenc.Encoder) error

type Addresses

type Addresses interface {
	Addresses() ([]base.Address, error)
}

type Amount

type Amount struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func MustNewAmount

func MustNewAmount(big Big, cid CurrencyID) Amount

func NewAmount

func NewAmount(big Big, cid CurrencyID) Amount

func NewZeroAmount

func NewZeroAmount(cid CurrencyID) Amount

func StateBalanceValue

func StateBalanceValue(st state.State) (Amount, error)

func (Amount) Big

func (am Amount) Big() Big

func (Amount) Bytes

func (am Amount) Bytes() []byte

func (Amount) Currency

func (am Amount) Currency() CurrencyID

func (Amount) Equal

func (am Amount) Equal(b Amount) bool

func (Amount) GenerateHash

func (am Amount) GenerateHash() valuehash.Hash

func (Amount) Hash

func (am Amount) Hash() valuehash.Hash

func (Amount) IsEmpty

func (am Amount) IsEmpty() bool

func (Amount) IsValid

func (am Amount) IsValid([]byte) error

func (Amount) MarshalBSON

func (am Amount) MarshalBSON() ([]byte, error)

func (Amount) MarshalJSON

func (am Amount) MarshalJSON() ([]byte, error)

func (Amount) String

func (am Amount) String() string

func (*Amount) UnmarshalBSON

func (am *Amount) UnmarshalBSON(b []byte) error

func (*Amount) UnmarshalJSON

func (am *Amount) UnmarshalJSON(b []byte) error

func (Amount) WithBig

func (am Amount) WithBig(big Big) Amount

type AmountBSONPacker

type AmountBSONPacker struct {
	CR CurrencyID `bson:"currency"`
	BG Big        `bson:"amount"`
}

type AmountBSONUnpacker

type AmountBSONUnpacker struct {
	HT hint.Hint `bson:"_hint"`
	CR string    `bson:"currency"`
	BG Big       `bson:"amount"`
}

type AmountJSONPacker

type AmountJSONPacker struct {
	jsonenc.HintedHead
	BG Big        `json:"amount"`
	CR CurrencyID `json:"currency"`
}

type AmountJSONUnpacker

type AmountJSONUnpacker struct {
	HT hint.Hint `json:"_hint"`
	BG Big       `json:"amount"`
	CR string    `json:"currency"`
}

type AmountState

type AmountState struct {
	state.State
	// contains filtered or unexported fields
}

func NewAmountState

func NewAmountState(st state.State, cid CurrencyID) AmountState

func (AmountState) Add

func (st AmountState) Add(a Big) AmountState

func (AmountState) AddFee

func (st AmountState) AddFee(fee Big) AmountState

func (AmountState) Clear

func (st AmountState) Clear() state.State

func (AmountState) Currency

func (st AmountState) Currency() CurrencyID

func (AmountState) Fee

func (st AmountState) Fee() Big

func (AmountState) Hint

func (AmountState) Hint() hint.Hint

func (AmountState) IsValid

func (st AmountState) IsValid(b []byte) error

func (AmountState) MarshalBSON

func (st AmountState) MarshalBSON() ([]byte, error)

func (AmountState) MarshalJSON

func (st AmountState) MarshalJSON() ([]byte, error)

func (AmountState) Merge

func (st AmountState) Merge(b state.State) (state.State, error)

func (AmountState) SetHash

func (st AmountState) SetHash(h valuehash.Hash) (state.State, error)

func (AmountState) SetHeight

func (st AmountState) SetHeight(h base.Height) state.State

func (AmountState) SetOperation

func (st AmountState) SetOperation(ops []valuehash.Hash) state.State

func (AmountState) SetPreviousHeight

func (st AmountState) SetPreviousHeight(h base.Height) (state.State, error)

func (AmountState) SetValue

func (st AmountState) SetValue(v state.Value) (state.State, error)

func (AmountState) Sub

func (st AmountState) Sub(a Big) AmountState

type AmountsItem

type AmountsItem interface {
	Amounts() []Amount
}

type BaseAccountKey

type BaseAccountKey struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewBaseAccountKey

func NewBaseAccountKey(k key.Publickey, w uint) (BaseAccountKey, error)

func (BaseAccountKey) Bytes

func (ky BaseAccountKey) Bytes() []byte

func (BaseAccountKey) Equal

func (ky BaseAccountKey) Equal(b AccountKey) bool

func (BaseAccountKey) IsValid

func (ky BaseAccountKey) IsValid([]byte) error

func (BaseAccountKey) Key

func (ky BaseAccountKey) Key() key.Publickey

func (BaseAccountKey) MarshalBSON

func (ky BaseAccountKey) MarshalBSON() ([]byte, error)

func (BaseAccountKey) MarshalJSON

func (ky BaseAccountKey) MarshalJSON() ([]byte, error)

func (*BaseAccountKey) UnpackBSON

func (ky *BaseAccountKey) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*BaseAccountKey) UnpackJSON

func (ky *BaseAccountKey) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

func (BaseAccountKey) Weight

func (ky BaseAccountKey) Weight() uint

type BaseAccountKeys

type BaseAccountKeys struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func EmptyBaseAccountKeys

func EmptyBaseAccountKeys() BaseAccountKeys

func NewBaseAccountKeys

func NewBaseAccountKeys(keys []AccountKey, threshold uint) (BaseAccountKeys, error)

func (BaseAccountKeys) Bytes

func (ks BaseAccountKeys) Bytes() []byte

func (BaseAccountKeys) Equal

func (ks BaseAccountKeys) Equal(b AccountKeys) bool

func (BaseAccountKeys) GenerateHash

func (ks BaseAccountKeys) GenerateHash() (valuehash.Hash, error)

func (BaseAccountKeys) Hash

func (ks BaseAccountKeys) Hash() valuehash.Hash

func (BaseAccountKeys) IsValid

func (ks BaseAccountKeys) IsValid([]byte) error

func (BaseAccountKeys) Key

func (BaseAccountKeys) Keys

func (ks BaseAccountKeys) Keys() []AccountKey

func (BaseAccountKeys) MarshalBSON

func (ks BaseAccountKeys) MarshalBSON() ([]byte, error)

func (BaseAccountKeys) MarshalJSON

func (ks BaseAccountKeys) MarshalJSON() ([]byte, error)

func (BaseAccountKeys) Threshold

func (ks BaseAccountKeys) Threshold() uint

func (*BaseAccountKeys) UnpackBSON

func (ks *BaseAccountKeys) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*BaseAccountKeys) UnpackJSON

func (ks *BaseAccountKeys) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type BaseCreateAccountsItem

type BaseCreateAccountsItem struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewBaseCreateAccountsItem

func NewBaseCreateAccountsItem(ht hint.Hint, keys AccountKeys, amounts []Amount) BaseCreateAccountsItem

func (BaseCreateAccountsItem) Address

func (it BaseCreateAccountsItem) Address() (base.Address, error)

func (BaseCreateAccountsItem) Amounts

func (it BaseCreateAccountsItem) Amounts() []Amount

func (BaseCreateAccountsItem) Bytes

func (it BaseCreateAccountsItem) Bytes() []byte

func (BaseCreateAccountsItem) IsValid

func (it BaseCreateAccountsItem) IsValid([]byte) error

func (BaseCreateAccountsItem) Keys

func (BaseCreateAccountsItem) MarshalBSON

func (it BaseCreateAccountsItem) MarshalBSON() ([]byte, error)

func (BaseCreateAccountsItem) MarshalJSON

func (it BaseCreateAccountsItem) MarshalJSON() ([]byte, error)

func (BaseCreateAccountsItem) Rebuild

func (*BaseCreateAccountsItem) UnpackBSON

func (it *BaseCreateAccountsItem) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*BaseCreateAccountsItem) UnpackJSON

func (it *BaseCreateAccountsItem) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type BaseOperation

type BaseOperation struct {
	operation.BaseOperation
	Memo string
}

func NewBaseOperationFromFact

func NewBaseOperationFromFact(
	ht hint.Hint, fact operation.OperationFact, fs []base.FactSign, memo string,
) (BaseOperation, error)

func (BaseOperation) AddFactSigns

func (op BaseOperation) AddFactSigns(fs ...base.FactSign) (base.FactSignUpdater, error)

func (BaseOperation) GenerateHash

func (op BaseOperation) GenerateHash() valuehash.Hash

func (BaseOperation) IsValid

func (op BaseOperation) IsValid(networkID []byte) error

func (BaseOperation) MarshalBSON

func (op BaseOperation) MarshalBSON() ([]byte, error)

func (BaseOperation) MarshalJSON

func (op BaseOperation) MarshalJSON() ([]byte, error)

func (*BaseOperation) UnpackBSON

func (op *BaseOperation) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*BaseOperation) UnpackJSON

func (op *BaseOperation) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type BaseTransfersItem

type BaseTransfersItem struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewBaseTransfersItem

func NewBaseTransfersItem(ht hint.Hint, receiver base.Address, amounts []Amount) BaseTransfersItem

func (BaseTransfersItem) Amounts

func (it BaseTransfersItem) Amounts() []Amount

func (BaseTransfersItem) Bytes

func (it BaseTransfersItem) Bytes() []byte

func (BaseTransfersItem) IsValid

func (it BaseTransfersItem) IsValid([]byte) error

func (BaseTransfersItem) MarshalBSON

func (it BaseTransfersItem) MarshalBSON() ([]byte, error)

func (BaseTransfersItem) MarshalJSON

func (it BaseTransfersItem) MarshalJSON() ([]byte, error)

func (BaseTransfersItem) Rebuild

func (it BaseTransfersItem) Rebuild() TransfersItem

func (BaseTransfersItem) Receiver

func (it BaseTransfersItem) Receiver() base.Address

func (*BaseTransfersItem) UnpackBSON

func (it *BaseTransfersItem) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*BaseTransfersItem) UnpackJSON

func (it *BaseTransfersItem) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type BaseTransfersItemBSONUnpacker

type BaseTransfersItemBSONUnpacker struct {
	RC base.AddressDecoder `bson:"receiver"`
	AM bson.Raw            `bson:"amounts"`
}

type BaseTransfersItemJSONUnpacker

type BaseTransfersItemJSONUnpacker struct {
	RC base.AddressDecoder `json:"receiver"`
	AM json.RawMessage     `json:"amounts"`
}

type Big

type Big struct {
	*big.Int
}

func MustBigFromString

func MustBigFromString(s string) Big

func NewBig

func NewBig(i int64) Big

func NewBigFromBigInt

func NewBigFromBigInt(b *big.Int) Big

func NewBigFromInterface

func NewBigFromInterface(a interface{}) (Big, error)

func NewBigFromString

func NewBigFromString(s string) (Big, error)

func (Big) Add

func (a Big) Add(b Big) Big

func (Big) Compare

func (a Big) Compare(b Big) int

func (Big) Div

func (a Big) Div(b Big) Big

func (Big) Equal

func (a Big) Equal(b Big) bool

func (Big) IsValid

func (Big) IsValid([]byte) error

func (Big) IsZero

func (a Big) IsZero() bool

func (Big) MarshalBSONValue

func (a Big) MarshalBSONValue() (bsontype.Type, []byte, error)

func (Big) MarshalJSON

func (a Big) MarshalJSON() ([]byte, error)

func (Big) Mul

func (a Big) Mul(b Big) Big

func (Big) MulFloat64

func (a Big) MulFloat64(b float64) Big

func (Big) MulInt64

func (a Big) MulInt64(b int64) Big

func (Big) Neg

func (a Big) Neg() Big

func (Big) OverNil

func (a Big) OverNil() bool

func (Big) OverZero

func (a Big) OverZero() bool

func (Big) String

func (a Big) String() string

func (Big) Sub

func (a Big) Sub(b Big) Big

func (*Big) UnmarshalBSONValue

func (a *Big) UnmarshalBSONValue(t bsontype.Type, b []byte) error

func (*Big) UnmarshalJSON

func (a *Big) UnmarshalJSON(b []byte) error

type CreateAccounts

type CreateAccounts struct {
	BaseOperation
}

func NewCreateAccounts

func NewCreateAccounts(fact CreateAccountsFact, fs []base.FactSign, memo string) (CreateAccounts, error)

func (CreateAccounts) Process

func (CreateAccounts) Process(
	func(key string) (state.State, bool, error),
	func(valuehash.Hash, ...state.State) error,
) error

func (*CreateAccounts) UnpackBSON

func (op *CreateAccounts) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*CreateAccounts) UnpackJSON

func (op *CreateAccounts) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type CreateAccountsFact

type CreateAccountsFact struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewCreateAccountsFact

func NewCreateAccountsFact(token []byte, sender base.Address, items []CreateAccountsItem) CreateAccountsFact

func (CreateAccountsFact) Addresses

func (fact CreateAccountsFact) Addresses() ([]base.Address, error)

func (CreateAccountsFact) Bytes

func (fact CreateAccountsFact) Bytes() []byte

func (CreateAccountsFact) GenerateHash

func (fact CreateAccountsFact) GenerateHash() valuehash.Hash

func (CreateAccountsFact) Hash

func (fact CreateAccountsFact) Hash() valuehash.Hash

func (CreateAccountsFact) IsValid

func (fact CreateAccountsFact) IsValid(b []byte) error

func (CreateAccountsFact) Items

func (fact CreateAccountsFact) Items() []CreateAccountsItem

func (CreateAccountsFact) MarshalBSON

func (fact CreateAccountsFact) MarshalBSON() ([]byte, error)

func (CreateAccountsFact) MarshalJSON

func (fact CreateAccountsFact) MarshalJSON() ([]byte, error)

func (CreateAccountsFact) Rebuild

func (fact CreateAccountsFact) Rebuild() CreateAccountsFact

func (CreateAccountsFact) Sender

func (fact CreateAccountsFact) Sender() base.Address

func (CreateAccountsFact) Targets

func (fact CreateAccountsFact) Targets() ([]base.Address, error)

func (CreateAccountsFact) Token

func (fact CreateAccountsFact) Token() []byte

func (*CreateAccountsFact) UnpackBSON

func (fact *CreateAccountsFact) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*CreateAccountsFact) UnpackJSON

func (fact *CreateAccountsFact) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type CreateAccountsFactBSONUnpacker

type CreateAccountsFactBSONUnpacker struct {
	H  valuehash.Bytes     `bson:"hash"`
	TK []byte              `bson:"token"`
	SD base.AddressDecoder `bson:"sender"`
	IT bson.Raw            `bson:"items"`
}

type CreateAccountsFactJSONPacker

type CreateAccountsFactJSONPacker struct {
	jsonenc.HintedHead
	H  valuehash.Hash       `json:"hash"`
	TK []byte               `json:"token"`
	SD base.Address         `json:"sender"`
	IT []CreateAccountsItem `json:"items"`
}

type CreateAccountsFactJSONUnpacker

type CreateAccountsFactJSONUnpacker struct {
	H  valuehash.Bytes     `json:"hash"`
	TK []byte              `json:"token"`
	SD base.AddressDecoder `json:"sender"`
	IT json.RawMessage     `json:"items"`
}

type CreateAccountsItem

type CreateAccountsItem interface {
	hint.Hinter
	isvalid.IsValider
	AmountsItem
	Bytes() []byte
	Keys() AccountKeys
	Address() (base.Address, error)
	Rebuild() CreateAccountsItem
}

type CreateAccountsItemBSONUnpacker

type CreateAccountsItemBSONUnpacker struct {
	KS bson.Raw `bson:"keys"`
	AM bson.Raw `bson:"amounts"`
}

type CreateAccountsItemJSONPacker

type CreateAccountsItemJSONPacker struct {
	jsonenc.HintedHead
	KS AccountKeys `json:"keys"`
	AS []Amount    `json:"amounts"`
}

type CreateAccountsItemJSONUnpacker

type CreateAccountsItemJSONUnpacker struct {
	KS json.RawMessage `json:"keys"`
	AM json.RawMessage `json:"amounts"`
}

type CreateAccountsItemMultiAmounts

type CreateAccountsItemMultiAmounts struct {
	BaseCreateAccountsItem
}

func NewCreateAccountsItemMultiAmounts

func NewCreateAccountsItemMultiAmounts(keys AccountKeys, amounts []Amount) CreateAccountsItemMultiAmounts

func (CreateAccountsItemMultiAmounts) IsValid

func (CreateAccountsItemMultiAmounts) Rebuild

type CreateAccountsItemProcessor

type CreateAccountsItemProcessor struct {
	// contains filtered or unexported fields
}

func (*CreateAccountsItemProcessor) Close

func (opp *CreateAccountsItemProcessor) Close() error

func (*CreateAccountsItemProcessor) PreProcess

func (opp *CreateAccountsItemProcessor) PreProcess(
	getState func(key string) (state.State, bool, error),
	_ func(valuehash.Hash, ...state.State) error,
) error

func (*CreateAccountsItemProcessor) Process

func (opp *CreateAccountsItemProcessor) Process(
	_ func(key string) (state.State, bool, error),
	_ func(valuehash.Hash, ...state.State) error,
) ([]state.State, error)

type CreateAccountsItemSingleAmount

type CreateAccountsItemSingleAmount struct {
	BaseCreateAccountsItem
}

func NewCreateAccountsItemSingleAmount

func NewCreateAccountsItemSingleAmount(keys AccountKeys, amount Amount) CreateAccountsItemSingleAmount

func (CreateAccountsItemSingleAmount) IsValid

func (CreateAccountsItemSingleAmount) Rebuild

type CreateAccountsProcessor

type CreateAccountsProcessor struct {
	CreateAccounts
	// contains filtered or unexported fields
}

func (*CreateAccountsProcessor) Close

func (opp *CreateAccountsProcessor) Close() error

func (*CreateAccountsProcessor) PreProcess

func (opp *CreateAccountsProcessor) PreProcess(
	getState func(key string) (state.State, bool, error),
	setState func(valuehash.Hash, ...state.State) error,
) (state.Processor, error)

func (*CreateAccountsProcessor) Process

func (opp *CreateAccountsProcessor) Process(
	getState func(key string) (state.State, bool, error),
	setState func(valuehash.Hash, ...state.State) error,
) error

type CurrencyDesign

type CurrencyDesign struct {
	hint.BaseHinter
	Amount
	// contains filtered or unexported fields
}

func NewCurrencyDesign

func NewCurrencyDesign(amount Amount, genesisAccount base.Address, po CurrencyPolicy) CurrencyDesign

func StateCurrencyDesignValue

func StateCurrencyDesignValue(st state.State) (CurrencyDesign, error)

func (CurrencyDesign) AddAggregate

func (de CurrencyDesign) AddAggregate(b Big) (CurrencyDesign, error)

func (CurrencyDesign) Aggregate

func (de CurrencyDesign) Aggregate() Big

func (CurrencyDesign) Bytes

func (de CurrencyDesign) Bytes() []byte

func (CurrencyDesign) GenesisAccount

func (de CurrencyDesign) GenesisAccount() base.Address

func (CurrencyDesign) IsValid

func (de CurrencyDesign) IsValid([]byte) error

func (CurrencyDesign) MarshalBSON

func (de CurrencyDesign) MarshalBSON() ([]byte, error)

func (CurrencyDesign) MarshalJSON

func (de CurrencyDesign) MarshalJSON() ([]byte, error)

func (CurrencyDesign) Policy

func (de CurrencyDesign) Policy() CurrencyPolicy

func (CurrencyDesign) SetPolicy

func (de CurrencyDesign) SetPolicy(po CurrencyPolicy) CurrencyDesign

func (*CurrencyDesign) UnpackBSON

func (de *CurrencyDesign) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*CurrencyDesign) UnpackJSON

func (de *CurrencyDesign) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type CurrencyDesignBSONUnpacker

type CurrencyDesignBSONUnpacker struct {
	AM Amount              `bson:"amount"`
	GA base.AddressDecoder `bson:"genesis_account"`
	PO bson.Raw            `bson:"policy"`
	AG Big                 `bson:"aggregate"`
}

type CurrencyDesignJSONPacker

type CurrencyDesignJSONPacker struct {
	jsonenc.HintedHead
	AM Amount         `json:"amount"`
	GA base.Address   `json:"genesis_account"`
	PO CurrencyPolicy `json:"policy"`
	AG Big            `json:"aggregate"`
}

type CurrencyDesignJSONUnpacker

type CurrencyDesignJSONUnpacker struct {
	AM Amount              `json:"amount"`
	GA base.AddressDecoder `json:"genesis_account"`
	PO json.RawMessage     `json:"policy"`
	AG Big                 `json:"aggregate"`
}

type CurrencyID

type CurrencyID string

func (CurrencyID) Bytes

func (cid CurrencyID) Bytes() []byte

func (CurrencyID) IsValid

func (cid CurrencyID) IsValid([]byte) error

func (CurrencyID) String

func (cid CurrencyID) String() string

type CurrencyPolicy

type CurrencyPolicy struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewCurrencyPolicy

func NewCurrencyPolicy(newAccountMinBalance Big, feeer Feeer) CurrencyPolicy

func (CurrencyPolicy) Bytes

func (po CurrencyPolicy) Bytes() []byte

func (CurrencyPolicy) Feeer

func (po CurrencyPolicy) Feeer() Feeer

func (CurrencyPolicy) IsValid

func (po CurrencyPolicy) IsValid([]byte) error

func (CurrencyPolicy) MarshalBSON

func (po CurrencyPolicy) MarshalBSON() ([]byte, error)

func (CurrencyPolicy) MarshalJSON

func (po CurrencyPolicy) MarshalJSON() ([]byte, error)

func (CurrencyPolicy) NewAccountMinBalance

func (po CurrencyPolicy) NewAccountMinBalance() Big

func (*CurrencyPolicy) UnpackBSON

func (po *CurrencyPolicy) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*CurrencyPolicy) UnpackJSON

func (po *CurrencyPolicy) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type CurrencyPolicyBSONUnpacker

type CurrencyPolicyBSONUnpacker struct {
	MN Big      `bson:"new_account_min_balance"`
	FE bson.Raw `bson:"feeer"`
}

type CurrencyPolicyJSONPacker

type CurrencyPolicyJSONPacker struct {
	jsonenc.HintedHead
	MN Big   `json:"new_account_min_balance"`
	FE Feeer `json:"feeer"`
}

type CurrencyPolicyJSONUnpacker

type CurrencyPolicyJSONUnpacker struct {
	MN Big             `json:"new_account_min_balance"`
	FE json.RawMessage `json:"feeer"`
}

type CurrencyPolicyUpdater

type CurrencyPolicyUpdater struct {
	BaseOperation
}

func NewCurrencyPolicyUpdater

func NewCurrencyPolicyUpdater(
	fact CurrencyPolicyUpdaterFact,
	fs []base.FactSign,
	memo string,
) (CurrencyPolicyUpdater, error)

func (CurrencyPolicyUpdater) Process

func (CurrencyPolicyUpdater) Process(
	func(string) (state.State, bool, error),
	func(valuehash.Hash, ...state.State) error,
) error

func (*CurrencyPolicyUpdater) UnpackBSON

func (op *CurrencyPolicyUpdater) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*CurrencyPolicyUpdater) UnpackJSON

func (op *CurrencyPolicyUpdater) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type CurrencyPolicyUpdaterFact

type CurrencyPolicyUpdaterFact struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewCurrencyPolicyUpdaterFact

func NewCurrencyPolicyUpdaterFact(token []byte, cid CurrencyID, policy CurrencyPolicy) CurrencyPolicyUpdaterFact

func (CurrencyPolicyUpdaterFact) Bytes

func (fact CurrencyPolicyUpdaterFact) Bytes() []byte

func (CurrencyPolicyUpdaterFact) Currency

func (fact CurrencyPolicyUpdaterFact) Currency() CurrencyID

func (CurrencyPolicyUpdaterFact) GenerateHash

func (fact CurrencyPolicyUpdaterFact) GenerateHash() valuehash.Hash

func (CurrencyPolicyUpdaterFact) Hash

func (CurrencyPolicyUpdaterFact) IsValid

func (fact CurrencyPolicyUpdaterFact) IsValid(b []byte) error

func (CurrencyPolicyUpdaterFact) MarshalBSON

func (fact CurrencyPolicyUpdaterFact) MarshalBSON() ([]byte, error)

func (CurrencyPolicyUpdaterFact) MarshalJSON

func (fact CurrencyPolicyUpdaterFact) MarshalJSON() ([]byte, error)

func (CurrencyPolicyUpdaterFact) Policy

func (CurrencyPolicyUpdaterFact) Token

func (fact CurrencyPolicyUpdaterFact) Token() []byte

func (*CurrencyPolicyUpdaterFact) UnpackBSON

func (fact *CurrencyPolicyUpdaterFact) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*CurrencyPolicyUpdaterFact) UnpackJSON

func (fact *CurrencyPolicyUpdaterFact) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type CurrencyPolicyUpdaterFactBSONUnpacker

type CurrencyPolicyUpdaterFactBSONUnpacker struct {
	H  valuehash.Bytes `bson:"hash"`
	TK []byte          `bson:"token"`
	CI string          `bson:"currency"`
	PO bson.Raw        `bson:"policy"`
}

type CurrencyPolicyUpdaterFactJSONPacker

type CurrencyPolicyUpdaterFactJSONPacker struct {
	jsonenc.HintedHead
	H  valuehash.Hash `json:"hash"`
	TK []byte         `json:"token"`
	CI CurrencyID     `json:"currency"`
	PO CurrencyPolicy `json:"policy"`
}

type CurrencyPolicyUpdaterFactJSONUnpacker

type CurrencyPolicyUpdaterFactJSONUnpacker struct {
	H  valuehash.Bytes `json:"hash"`
	TK []byte          `json:"token"`
	CI string          `json:"currency"`
	PO json.RawMessage `json:"policy"`
}

type CurrencyPolicyUpdaterProcessor

type CurrencyPolicyUpdaterProcessor struct {
	CurrencyPolicyUpdater
	// contains filtered or unexported fields
}

func (*CurrencyPolicyUpdaterProcessor) Close

func (*CurrencyPolicyUpdaterProcessor) PreProcess

func (opp *CurrencyPolicyUpdaterProcessor) PreProcess(
	getState func(string) (state.State, bool, error),
	_ func(valuehash.Hash, ...state.State) error,
) (state.Processor, error)

func (*CurrencyPolicyUpdaterProcessor) Process

func (opp *CurrencyPolicyUpdaterProcessor) Process(
	_ func(string) (state.State, bool, error),
	setState func(valuehash.Hash, ...state.State) error,
) error

type CurrencyPool

type CurrencyPool struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewCurrencyPool

func NewCurrencyPool() *CurrencyPool

func (*CurrencyPool) CIDs

func (cp *CurrencyPool) CIDs() []CurrencyID

func (*CurrencyPool) Clear

func (cp *CurrencyPool) Clear()

func (*CurrencyPool) Designs

func (cp *CurrencyPool) Designs() map[CurrencyID]CurrencyDesign

func (*CurrencyPool) Exists

func (cp *CurrencyPool) Exists(cid CurrencyID) bool

func (*CurrencyPool) Feeer

func (cp *CurrencyPool) Feeer(cid CurrencyID) (Feeer, bool)

func (*CurrencyPool) Get

func (cp *CurrencyPool) Get(cid CurrencyID) (CurrencyDesign, bool)

func (*CurrencyPool) Policy

func (cp *CurrencyPool) Policy(cid CurrencyID) (CurrencyPolicy, bool)

func (*CurrencyPool) Set

func (cp *CurrencyPool) Set(st state.State) error

func (*CurrencyPool) State

func (cp *CurrencyPool) State(cid CurrencyID) (state.State, bool)

func (*CurrencyPool) States

func (cp *CurrencyPool) States() map[CurrencyID]state.State

func (*CurrencyPool) TraverseDesign

func (cp *CurrencyPool) TraverseDesign(callback func(cid CurrencyID, de CurrencyDesign) bool)

func (*CurrencyPool) TraverseState

func (cp *CurrencyPool) TraverseState(callback func(cid CurrencyID, de state.State) bool)

type CurrencyRegister

type CurrencyRegister struct {
	BaseOperation
}

func NewCurrencyRegister

func NewCurrencyRegister(fact CurrencyRegisterFact, fs []base.FactSign, memo string) (CurrencyRegister, error)

func (CurrencyRegister) Process

func (CurrencyRegister) Process(
	func(string) (state.State, bool, error),
	func(valuehash.Hash, ...state.State) error,
) error

func (*CurrencyRegister) UnpackBSON

func (op *CurrencyRegister) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*CurrencyRegister) UnpackJSON

func (op *CurrencyRegister) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type CurrencyRegisterFact

type CurrencyRegisterFact struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewCurrencyRegisterFact

func NewCurrencyRegisterFact(token []byte, de CurrencyDesign) CurrencyRegisterFact

func (CurrencyRegisterFact) Bytes

func (fact CurrencyRegisterFact) Bytes() []byte

func (CurrencyRegisterFact) Currency

func (fact CurrencyRegisterFact) Currency() CurrencyDesign

func (CurrencyRegisterFact) GenerateHash

func (fact CurrencyRegisterFact) GenerateHash() valuehash.Hash

func (CurrencyRegisterFact) Hash

func (fact CurrencyRegisterFact) Hash() valuehash.Hash

func (CurrencyRegisterFact) IsValid

func (fact CurrencyRegisterFact) IsValid(b []byte) error

func (CurrencyRegisterFact) MarshalBSON

func (fact CurrencyRegisterFact) MarshalBSON() ([]byte, error)

func (CurrencyRegisterFact) MarshalJSON

func (fact CurrencyRegisterFact) MarshalJSON() ([]byte, error)

func (CurrencyRegisterFact) Token

func (fact CurrencyRegisterFact) Token() []byte

func (*CurrencyRegisterFact) UnpackBSON

func (fact *CurrencyRegisterFact) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*CurrencyRegisterFact) UnpackJSON

func (fact *CurrencyRegisterFact) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type CurrencyRegisterFactBSONUnpacker

type CurrencyRegisterFactBSONUnpacker struct {
	H  valuehash.Bytes `bson:"hash"`
	TK []byte          `bson:"token"`
	CR bson.Raw        `bson:"currency"`
}

type CurrencyRegisterFactJSONPacker

type CurrencyRegisterFactJSONPacker struct {
	jsonenc.HintedHead
	H  valuehash.Hash `json:"hash"`
	TK []byte         `json:"token"`
	CR CurrencyDesign `json:"currency"`
}

type CurrencyRegisterFactJSONUnpacker

type CurrencyRegisterFactJSONUnpacker struct {
	H  valuehash.Bytes `json:"hash"`
	TK []byte          `json:"token"`
	CR json.RawMessage `json:"currency"`
}

type CurrencyRegisterProcessor

type CurrencyRegisterProcessor struct {
	CurrencyRegister
	// contains filtered or unexported fields
}

func (*CurrencyRegisterProcessor) Close

func (opp *CurrencyRegisterProcessor) Close() error

func (*CurrencyRegisterProcessor) PreProcess

func (opp *CurrencyRegisterProcessor) PreProcess(
	getState func(string) (state.State, bool, error),
	_ func(valuehash.Hash, ...state.State) error,
) (state.Processor, error)

func (*CurrencyRegisterProcessor) Process

func (opp *CurrencyRegisterProcessor) Process(
	getState func(string) (state.State, bool, error),
	setState func(valuehash.Hash, ...state.State) error,
) error

type DuplicationType

type DuplicationType string
const (
	DuplicationTypeSender   DuplicationType = "sender"
	DuplicationTypeCurrency DuplicationType = "currency"
)

type FeeOperation

type FeeOperation struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewFeeOperation

func NewFeeOperation(fact FeeOperationFact) FeeOperation

func (FeeOperation) AddFactSigns

func (FeeOperation) AddFactSigns(...base.FactSign) (base.FactSignUpdater, error)

func (FeeOperation) Fact

func (op FeeOperation) Fact() base.Fact

func (FeeOperation) GenerateHash

func (op FeeOperation) GenerateHash() valuehash.Hash

func (FeeOperation) Hash

func (op FeeOperation) Hash() valuehash.Hash

func (FeeOperation) IsValid

func (op FeeOperation) IsValid([]byte) error

func (FeeOperation) LastSignedAt

func (FeeOperation) LastSignedAt() time.Time

func (FeeOperation) MarshalBSON

func (op FeeOperation) MarshalBSON() ([]byte, error)

func (FeeOperation) MarshalJSON

func (op FeeOperation) MarshalJSON() ([]byte, error)

func (FeeOperation) Process

func (FeeOperation) Process(
	func(key string) (state.State, bool, error),
	func(valuehash.Hash, ...state.State) error,
) error

func (FeeOperation) Signs

func (FeeOperation) Signs() []base.FactSign

func (*FeeOperation) UnpackBSON

func (op *FeeOperation) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*FeeOperation) UnpackJSON

func (op *FeeOperation) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type FeeOperationBSONUnpacker

type FeeOperationBSONUnpacker struct {
	H  valuehash.Bytes `bson:"hash"`
	FC bson.Raw        `bson:"fact"`
}

type FeeOperationFact

type FeeOperationFact struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewFeeOperationFact

func NewFeeOperationFact(height base.Height, ams map[CurrencyID]Big) FeeOperationFact

func (FeeOperationFact) Amounts

func (fact FeeOperationFact) Amounts() []Amount

func (FeeOperationFact) Bytes

func (fact FeeOperationFact) Bytes() []byte

func (FeeOperationFact) Hash

func (fact FeeOperationFact) Hash() valuehash.Hash

func (FeeOperationFact) IsValid

func (fact FeeOperationFact) IsValid([]byte) error

func (FeeOperationFact) MarshalBSON

func (fact FeeOperationFact) MarshalBSON() ([]byte, error)

func (FeeOperationFact) MarshalJSON

func (fact FeeOperationFact) MarshalJSON() ([]byte, error)

func (FeeOperationFact) Token

func (fact FeeOperationFact) Token() []byte

func (*FeeOperationFact) UnpackBSON

func (fact *FeeOperationFact) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*FeeOperationFact) UnpackJSON

func (fact *FeeOperationFact) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type FeeOperationFactBSONUnpacker

type FeeOperationFactBSONUnpacker struct {
	H  valuehash.Bytes `bson:"hash"`
	TK []byte          `bson:"token"`
	AM bson.Raw        `bson:"amounts"`
}

type FeeOperationFactJSONPacker

type FeeOperationFactJSONPacker struct {
	jsonenc.HintedHead
	H  valuehash.Hash `json:"hash"`
	TK []byte         `json:"token"`
	AM []Amount       `json:"amounts"`
}

type FeeOperationFactJSONUnpacker

type FeeOperationFactJSONUnpacker struct {
	H  valuehash.Bytes `json:"hash"`
	TK []byte          `json:"token"`
	AM json.RawMessage `json:"amounts"`
}

type FeeOperationJSONPacker

type FeeOperationJSONPacker struct {
	jsonenc.HintedHead
	H  valuehash.Hash   `json:"hash"`
	FT FeeOperationFact `json:"fact"`
}

type FeeOperationJSONUnpacker

type FeeOperationJSONUnpacker struct {
	H  valuehash.Bytes `json:"hash"`
	FT json.RawMessage `json:"fact"`
}

type FeeOperationProcessor

type FeeOperationProcessor struct {
	FeeOperation
	// contains filtered or unexported fields
}

func (*FeeOperationProcessor) Process

func (opp *FeeOperationProcessor) Process(
	getState func(key string) (state.State, bool, error),
	setState func(valuehash.Hash, ...state.State) error,
) error

type Feeer

type Feeer interface {
	isvalid.IsValider
	hint.Hinter
	Type() string
	Bytes() []byte
	Receiver() base.Address
	Min() Big
	Fee(Big) (Big, error)
}

type FixedFeeer

type FixedFeeer struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewFixedFeeer

func NewFixedFeeer(receiver base.Address, amount Big) FixedFeeer

func (FixedFeeer) Bytes

func (fa FixedFeeer) Bytes() []byte

func (FixedFeeer) Fee

func (fa FixedFeeer) Fee(Big) (Big, error)

func (FixedFeeer) IsValid

func (fa FixedFeeer) IsValid([]byte) error

func (FixedFeeer) MarshalBSON

func (fa FixedFeeer) MarshalBSON() ([]byte, error)

func (FixedFeeer) MarshalJSON

func (fa FixedFeeer) MarshalJSON() ([]byte, error)

func (FixedFeeer) Min

func (fa FixedFeeer) Min() Big

func (FixedFeeer) Receiver

func (fa FixedFeeer) Receiver() base.Address

func (FixedFeeer) Type

func (FixedFeeer) Type() string

func (*FixedFeeer) UnpackBSON

func (fa *FixedFeeer) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*FixedFeeer) UnpackJSON

func (fa *FixedFeeer) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type FixedFeeerBSONUnpacker

type FixedFeeerBSONUnpacker struct {
	HT hint.Hint           `bson:"_hint"`
	RC base.AddressDecoder `bson:"receiver"`
	AM Big                 `bson:"amount"`
}

type FixedFeeerJSONPacker

type FixedFeeerJSONPacker struct {
	jsonenc.HintedHead
	RC base.Address `json:"receiver"`
	AM Big          `json:"amount"`
}

type FixedFeeerJSONUnpacker

type FixedFeeerJSONUnpacker struct {
	HT hint.Hint           `json:"_hint"`
	RC base.AddressDecoder `json:"receiver"`
	AM Big                 `json:"amount"`
}

type GenesisCurrencies

type GenesisCurrencies struct {
	operation.BaseOperation
}

func NewGenesisCurrencies

func NewGenesisCurrencies(
	genesisNodeKey key.Privatekey,
	keys AccountKeys,
	cs []CurrencyDesign,
	networkID base.NetworkID,
) (GenesisCurrencies, error)

func (GenesisCurrencies) IsValid

func (op GenesisCurrencies) IsValid(networkID []byte) error

func (GenesisCurrencies) MarshalBSON

func (op GenesisCurrencies) MarshalBSON() ([]byte, error)

func (GenesisCurrencies) MarshalJSON

func (op GenesisCurrencies) MarshalJSON() ([]byte, error)

func (GenesisCurrencies) Process

func (op GenesisCurrencies) Process(
	getState func(key string) (state.State, bool, error),
	setState func(valuehash.Hash, ...state.State) error,
) error

func (*GenesisCurrencies) UnpackBSON

func (op *GenesisCurrencies) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*GenesisCurrencies) UnpackJSON

func (op *GenesisCurrencies) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type GenesisCurrenciesFact

type GenesisCurrenciesFact struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewGenesisCurrenciesFact

func NewGenesisCurrenciesFact(
	token []byte,
	genesisNodeKey key.Publickey,
	keys AccountKeys,
	cs []CurrencyDesign,
) GenesisCurrenciesFact

func (GenesisCurrenciesFact) Address

func (fact GenesisCurrenciesFact) Address() (base.Address, error)

func (GenesisCurrenciesFact) Bytes

func (fact GenesisCurrenciesFact) Bytes() []byte

func (GenesisCurrenciesFact) Currencies

func (fact GenesisCurrenciesFact) Currencies() []CurrencyDesign

func (GenesisCurrenciesFact) GenerateHash

func (fact GenesisCurrenciesFact) GenerateHash() valuehash.Hash

func (GenesisCurrenciesFact) GenesisNodeKey

func (fact GenesisCurrenciesFact) GenesisNodeKey() key.Publickey

func (GenesisCurrenciesFact) Hash

func (fact GenesisCurrenciesFact) Hash() valuehash.Hash

func (GenesisCurrenciesFact) IsValid

func (fact GenesisCurrenciesFact) IsValid(b []byte) error

func (GenesisCurrenciesFact) Keys

func (fact GenesisCurrenciesFact) Keys() AccountKeys

func (GenesisCurrenciesFact) MarshalBSON

func (fact GenesisCurrenciesFact) MarshalBSON() ([]byte, error)

func (GenesisCurrenciesFact) MarshalJSON

func (fact GenesisCurrenciesFact) MarshalJSON() ([]byte, error)

func (GenesisCurrenciesFact) Token

func (fact GenesisCurrenciesFact) Token() []byte

func (*GenesisCurrenciesFact) UnpackBSON

func (fact *GenesisCurrenciesFact) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*GenesisCurrenciesFact) UnpackJSON

func (fact *GenesisCurrenciesFact) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type GenesisCurrenciesFactBSONUnpacker

type GenesisCurrenciesFactBSONUnpacker struct {
	H  valuehash.Bytes      `bson:"hash"`
	TK []byte               `bson:"token"`
	GK key.PublickeyDecoder `bson:"genesis_node_key"`
	KS bson.Raw             `bson:"keys"`
	CS bson.Raw             `bson:"currencies"`
}

type GenesisCurrenciesFactJSONPacker

type GenesisCurrenciesFactJSONPacker struct {
	jsonenc.HintedHead
	H  valuehash.Hash   `json:"hash"`
	TK []byte           `json:"token"`
	GK key.Publickey    `json:"genesis_node_key"`
	KS AccountKeys      `json:"keys"`
	CS []CurrencyDesign `json:"currencies"`
}

type GenesisCurrenciesFactJSONUnpacker

type GenesisCurrenciesFactJSONUnpacker struct {
	H  valuehash.Bytes      `json:"hash"`
	TK []byte               `json:"token"`
	GK key.PublickeyDecoder `json:"genesis_node_key"`
	KS json.RawMessage      `json:"keys"`
	CS json.RawMessage      `json:"currencies"`
}

type GetNewProcessor

type GetNewProcessor func(state.Processor) (state.Processor, error)

func NewCreateAccountsProcessor

func NewCreateAccountsProcessor(cp *CurrencyPool) GetNewProcessor

func NewCurrencyPolicyUpdaterProcessor

func NewCurrencyPolicyUpdaterProcessor(
	cp *CurrencyPool,
	pubs []key.Publickey,
	threshold base.Threshold,
) GetNewProcessor

func NewCurrencyRegisterProcessor

func NewCurrencyRegisterProcessor(cp *CurrencyPool, pubs []key.Publickey, threshold base.Threshold) GetNewProcessor

func NewKeyUpdaterProcessor

func NewKeyUpdaterProcessor(cp *CurrencyPool) GetNewProcessor

func NewSuffrageInflationProcessor

func NewSuffrageInflationProcessor(cp *CurrencyPool, pubs []key.Publickey, threshold base.Threshold) GetNewProcessor

func NewTransfersProcessor

func NewTransfersProcessor(cp *CurrencyPool) GetNewProcessor

type KeyBSONUnpacker

type KeyBSONUnpacker struct {
	W uint                 `bson:"weight"`
	K key.PublickeyDecoder `bson:"key"`
}

type KeyJSONPacker

type KeyJSONPacker struct {
	jsonenc.HintedHead
	W uint          `json:"weight"`
	K key.Publickey `json:"key"`
}

type KeyJSONUnpacker

type KeyJSONUnpacker struct {
	W uint                 `json:"weight"`
	K key.PublickeyDecoder `json:"key"`
}

type KeyUpdater

type KeyUpdater struct {
	BaseOperation
}

func NewKeyUpdater

func NewKeyUpdater(fact KeyUpdaterFact, fs []base.FactSign, memo string) (KeyUpdater, error)

func (KeyUpdater) Process

func (KeyUpdater) Process(
	func(key string) (state.State, bool, error),
	func(valuehash.Hash, ...state.State) error,
) error

func (*KeyUpdater) UnpackBSON

func (op *KeyUpdater) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*KeyUpdater) UnpackJSON

func (op *KeyUpdater) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type KeyUpdaterFact

type KeyUpdaterFact struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewKeyUpdaterFact

func NewKeyUpdaterFact(token []byte, target base.Address, keys AccountKeys, currency CurrencyID) KeyUpdaterFact

func (KeyUpdaterFact) Addresses

func (fact KeyUpdaterFact) Addresses() ([]base.Address, error)

func (KeyUpdaterFact) Bytes

func (fact KeyUpdaterFact) Bytes() []byte

func (KeyUpdaterFact) Currency

func (fact KeyUpdaterFact) Currency() CurrencyID

func (KeyUpdaterFact) GenerateHash

func (fact KeyUpdaterFact) GenerateHash() valuehash.Hash

func (KeyUpdaterFact) Hash

func (fact KeyUpdaterFact) Hash() valuehash.Hash

func (KeyUpdaterFact) IsValid

func (fact KeyUpdaterFact) IsValid(b []byte) error

func (KeyUpdaterFact) Keys

func (fact KeyUpdaterFact) Keys() AccountKeys

func (KeyUpdaterFact) MarshalBSON

func (fact KeyUpdaterFact) MarshalBSON() ([]byte, error)

func (KeyUpdaterFact) MarshalJSON

func (fact KeyUpdaterFact) MarshalJSON() ([]byte, error)

func (KeyUpdaterFact) Target

func (fact KeyUpdaterFact) Target() base.Address

func (KeyUpdaterFact) Token

func (fact KeyUpdaterFact) Token() []byte

func (*KeyUpdaterFact) UnpackBSON

func (fact *KeyUpdaterFact) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*KeyUpdaterFact) UnpackJSON

func (fact *KeyUpdaterFact) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type KeyUpdaterFactBSONUnpacker

type KeyUpdaterFactBSONUnpacker struct {
	H  valuehash.Bytes     `bson:"hash"`
	TK []byte              `bson:"token"`
	TG base.AddressDecoder `bson:"target"`
	KS bson.Raw            `bson:"keys"`
	CR string              `bson:"currency"`
}

type KeyUpdaterFactJSONPacker

type KeyUpdaterFactJSONPacker struct {
	jsonenc.HintedHead
	H  valuehash.Hash `json:"hash"`
	TK []byte         `json:"token"`
	TG base.Address   `json:"target"`
	KS AccountKeys    `json:"keys"`
	CR CurrencyID     `json:"currency"`
}

type KeyUpdaterFactJSONUnpacker

type KeyUpdaterFactJSONUnpacker struct {
	H  valuehash.Bytes     `json:"hash"`
	TK []byte              `json:"token"`
	TG base.AddressDecoder `json:"target"`
	KS json.RawMessage     `json:"keys"`
	CR string              `json:"currency"`
}

type KeyUpdaterProcessor

type KeyUpdaterProcessor struct {
	KeyUpdater
	// contains filtered or unexported fields
}

func (*KeyUpdaterProcessor) Close

func (opp *KeyUpdaterProcessor) Close() error

func (*KeyUpdaterProcessor) PreProcess

func (opp *KeyUpdaterProcessor) PreProcess(
	getState func(string) (state.State, bool, error),
	_ func(valuehash.Hash, ...state.State) error,
) (state.Processor, error)

func (*KeyUpdaterProcessor) Process

func (opp *KeyUpdaterProcessor) Process(
	_ func(key string) (state.State, bool, error),
	setState func(valuehash.Hash, ...state.State) error,
) error

type KeysBSONUnpacker

type KeysBSONUnpacker struct {
	H  valuehash.Bytes `bson:"hash"`
	KS bson.Raw        `bson:"keys"`
	TH uint            `bson:"threshold"`
}

type KeysJSONPacker

type KeysJSONPacker struct {
	jsonenc.HintedHead
	H  valuehash.Hash `json:"hash"`
	KS []AccountKey   `json:"keys"`
	TH uint           `json:"threshold"`
}

type KeysJSONUnpacker

type KeysJSONUnpacker struct {
	H  valuehash.Bytes `json:"hash"`
	KS json.RawMessage `json:"keys"`
	TH uint            `json:"threshold"`
}

type MemoBSONUnpacker

type MemoBSONUnpacker struct {
	Memo string `bson:"memo"`
}

type MemoJSONUnpacker

type MemoJSONUnpacker struct {
	Memo string `json:"memo"`
}

type NilFeeer

type NilFeeer struct {
	hint.BaseHinter
}

func NewNilFeeer

func NewNilFeeer() NilFeeer

func (NilFeeer) Bytes

func (NilFeeer) Bytes() []byte

func (NilFeeer) Fee

func (NilFeeer) Fee(Big) (Big, error)

func (NilFeeer) IsValid

func (fa NilFeeer) IsValid([]byte) error

func (NilFeeer) MarshalBSON

func (fa NilFeeer) MarshalBSON() ([]byte, error)

func (NilFeeer) MarshalJSON

func (fa NilFeeer) MarshalJSON() ([]byte, error)

func (NilFeeer) Min

func (NilFeeer) Min() Big

func (NilFeeer) Receiver

func (NilFeeer) Receiver() base.Address

func (NilFeeer) Type

func (NilFeeer) Type() string

func (*NilFeeer) UnmarsahlBSON

func (fa *NilFeeer) UnmarsahlBSON(b []byte) error

func (*NilFeeer) UnmarsahlJSON

func (fa *NilFeeer) UnmarsahlJSON(b []byte) error

type OperationProcessor

type OperationProcessor struct {
	sync.RWMutex
	*logging.Logging
	// contains filtered or unexported fields
}

func NewOperationProcessor

func NewOperationProcessor(cp *CurrencyPool) *OperationProcessor

func (*OperationProcessor) Cancel

func (opr *OperationProcessor) Cancel() error

func (*OperationProcessor) Close

func (opr *OperationProcessor) Close() error

func (*OperationProcessor) New

func (*OperationProcessor) PreProcess

func (opr *OperationProcessor) PreProcess(op state.Processor) (state.Processor, error)

func (*OperationProcessor) Process

func (opr *OperationProcessor) Process(op state.Processor) error

func (*OperationProcessor) SetProcessor

func (opr *OperationProcessor) SetProcessor(
	hinter hint.Hinter,
	newProcessor GetNewProcessor,
) (prprocessor.OperationProcessor, error)

type RatioFeeer

type RatioFeeer struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewRatioFeeer

func NewRatioFeeer(receiver base.Address, ratio float64, min, max Big) RatioFeeer

func (RatioFeeer) Bytes

func (fa RatioFeeer) Bytes() []byte

func (RatioFeeer) Fee

func (fa RatioFeeer) Fee(a Big) (Big, error)

func (RatioFeeer) IsValid

func (fa RatioFeeer) IsValid([]byte) error

func (RatioFeeer) MarshalBSON

func (fa RatioFeeer) MarshalBSON() ([]byte, error)

func (RatioFeeer) MarshalJSON

func (fa RatioFeeer) MarshalJSON() ([]byte, error)

func (RatioFeeer) Min

func (fa RatioFeeer) Min() Big

func (RatioFeeer) Receiver

func (fa RatioFeeer) Receiver() base.Address

func (RatioFeeer) Type

func (RatioFeeer) Type() string

func (*RatioFeeer) UnpackBSON

func (fa *RatioFeeer) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*RatioFeeer) UnpackJSON

func (fa *RatioFeeer) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type RatioFeeerBSONUnpacker

type RatioFeeerBSONUnpacker struct {
	HT hint.Hint           `bson:"_hint"`
	RC base.AddressDecoder `bson:"receiver"`
	RA float64             `bson:"ratio"`
	MI Big                 `bson:"min"`
	MA Big                 `bson:"max"`
}

type RatioFeeerJSONPacker

type RatioFeeerJSONPacker struct {
	jsonenc.HintedHead
	RC base.Address `json:"receiver"`
	RA float64      `json:"ratio"`
	MI Big          `json:"min"`
	MA Big          `json:"max"`
}

type RatioFeeerJSONUnpacker

type RatioFeeerJSONUnpacker struct {
	HT hint.Hint           `json:"_hint"`
	RC base.AddressDecoder `json:"receiver"`
	RA float64             `json:"ratio"`
	MI Big                 `json:"min"`
	MA Big                 `json:"max"`
}

type SuffrageInflation

type SuffrageInflation struct {
	BaseOperation
}

func NewSuffrageInflation

func NewSuffrageInflation(fact SuffrageInflationFact, fs []base.FactSign, memo string) (SuffrageInflation, error)

func (SuffrageInflation) Process

func (SuffrageInflation) Process(
	func(string) (state.State, bool, error),
	func(valuehash.Hash, ...state.State) error,
) error

func (*SuffrageInflation) UnpackBSON

func (op *SuffrageInflation) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*SuffrageInflation) UnpackJSON

func (op *SuffrageInflation) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type SuffrageInflationFact

type SuffrageInflationFact struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewSuffrageInflationFact

func NewSuffrageInflationFact(token []byte, items []SuffrageInflationItem) SuffrageInflationFact

func (SuffrageInflationFact) Bytes

func (fact SuffrageInflationFact) Bytes() []byte

func (SuffrageInflationFact) GenerateHash

func (fact SuffrageInflationFact) GenerateHash() valuehash.Hash

func (SuffrageInflationFact) Hash

func (fact SuffrageInflationFact) Hash() valuehash.Hash

func (SuffrageInflationFact) IsValid

func (fact SuffrageInflationFact) IsValid(b []byte) error

func (SuffrageInflationFact) Items

func (SuffrageInflationFact) MarshalBSON

func (fact SuffrageInflationFact) MarshalBSON() ([]byte, error)

func (SuffrageInflationFact) MarshalJSON

func (fact SuffrageInflationFact) MarshalJSON() ([]byte, error)

func (SuffrageInflationFact) Token

func (fact SuffrageInflationFact) Token() []byte

func (*SuffrageInflationFact) UnpackBSON

func (fact *SuffrageInflationFact) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*SuffrageInflationFact) UnpackJSON

func (fact *SuffrageInflationFact) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type SuffrageInflationFactBSONUnpacker

type SuffrageInflationFactBSONUnpacker struct {
	H  valuehash.Bytes `bson:"hash"`
	TK []byte          `bson:"token"`
	IS bson.Raw        `bson:"items"`
}

type SuffrageInflationFactJSONPacker

type SuffrageInflationFactJSONPacker struct {
	jsonenc.HintedHead
	H  valuehash.Hash          `json:"hash"`
	TK []byte                  `json:"token"`
	IS []SuffrageInflationItem `json:"items"`
}

type SuffrageInflationFactJSONUnpacker

type SuffrageInflationFactJSONUnpacker struct {
	H  valuehash.Bytes   `json:"hash"`
	TK []byte            `json:"token"`
	IS []json.RawMessage `json:"items"`
}

type SuffrageInflationItem

type SuffrageInflationItem struct {
	// contains filtered or unexported fields
}

func NewSuffrageInflationItem

func NewSuffrageInflationItem(receiver base.Address, amount Amount) SuffrageInflationItem

func (SuffrageInflationItem) Bytes

func (item SuffrageInflationItem) Bytes() []byte

func (SuffrageInflationItem) IsValid

func (item SuffrageInflationItem) IsValid([]byte) error

func (SuffrageInflationItem) MarshalBSON

func (item SuffrageInflationItem) MarshalBSON() ([]byte, error)

func (SuffrageInflationItem) MarshalJSON

func (item SuffrageInflationItem) MarshalJSON() ([]byte, error)

type SuffrageInflationItemPacker

type SuffrageInflationItemPacker struct {
	RC base.Address `bson:"receiver" json:"receiver"`
	AM Amount       `bson:"amount" json:"amount"`
}

type SuffrageInflationItemUnpacker

type SuffrageInflationItemUnpacker struct {
	RC base.AddressDecoder `bson:"receiver" json:"receiver"`
	AM Amount              `bson:"amount" json:"amount"`
}

type SuffrageInflationProcessor

type SuffrageInflationProcessor struct {
	SuffrageInflation
	// contains filtered or unexported fields
}

func (*SuffrageInflationProcessor) Close

func (opp *SuffrageInflationProcessor) Close() error

func (*SuffrageInflationProcessor) PreProcess

func (opp *SuffrageInflationProcessor) PreProcess(
	getState func(string) (state.State, bool, error),
	_ func(valuehash.Hash, ...state.State) error,
) (state.Processor, error)

func (*SuffrageInflationProcessor) Process

func (opp *SuffrageInflationProcessor) Process(
	_ func(string) (state.State, bool, error),
	setState func(valuehash.Hash, ...state.State) error,
) error

type TransferFactJSONPacker

type TransferFactJSONPacker struct {
	jsonenc.HintedHead
	H  valuehash.Hash  `json:"hash"`
	TK []byte          `json:"token"`
	SD base.Address    `json:"sender"`
	IT []TransfersItem `json:"items"`
}

type Transfers

type Transfers struct {
	BaseOperation
}

func NewTransfers

func NewTransfers(
	fact TransfersFact,
	fs []base.FactSign,
	memo string,
) (Transfers, error)

func (Transfers) Process

func (Transfers) Process(
	func(key string) (state.State, bool, error),
	func(valuehash.Hash, ...state.State) error,
) error

func (*Transfers) UnpackBSON

func (op *Transfers) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*Transfers) UnpackJSON

func (op *Transfers) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type TransfersFact

type TransfersFact struct {
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewTransfersFact

func NewTransfersFact(token []byte, sender base.Address, items []TransfersItem) TransfersFact

func (TransfersFact) Addresses

func (fact TransfersFact) Addresses() ([]base.Address, error)

func (TransfersFact) Bytes

func (fact TransfersFact) Bytes() []byte

func (TransfersFact) GenerateHash

func (fact TransfersFact) GenerateHash() valuehash.Hash

func (TransfersFact) Hash

func (fact TransfersFact) Hash() valuehash.Hash

func (TransfersFact) IsValid

func (fact TransfersFact) IsValid(b []byte) error

func (TransfersFact) Items

func (fact TransfersFact) Items() []TransfersItem

func (TransfersFact) MarshalBSON

func (fact TransfersFact) MarshalBSON() ([]byte, error)

func (TransfersFact) MarshalJSON

func (fact TransfersFact) MarshalJSON() ([]byte, error)

func (TransfersFact) Rebuild

func (fact TransfersFact) Rebuild() TransfersFact

func (TransfersFact) Sender

func (fact TransfersFact) Sender() base.Address

func (TransfersFact) Token

func (fact TransfersFact) Token() []byte

func (*TransfersFact) UnpackBSON

func (fact *TransfersFact) UnpackBSON(b []byte, enc *bsonenc.Encoder) error

func (*TransfersFact) UnpackJSON

func (fact *TransfersFact) UnpackJSON(b []byte, enc *jsonenc.Encoder) error

type TransfersFactBSONUnpacker

type TransfersFactBSONUnpacker struct {
	H  valuehash.Bytes     `bson:"hash"`
	TK []byte              `bson:"token"`
	SD base.AddressDecoder `bson:"sender"`
	IT bson.Raw            `bson:"items"`
}

type TransfersItem

type TransfersItem interface {
	hint.Hinter
	isvalid.IsValider
	AmountsItem
	Bytes() []byte
	Receiver() base.Address
	Rebuild() TransfersItem
}

type TransfersItemJSONPacker

type TransfersItemJSONPacker struct {
	jsonenc.HintedHead
	RC base.Address `json:"receiver"`
	AM []Amount     `json:"amounts"`
}

type TransfersItemMultiAmounts

type TransfersItemMultiAmounts struct {
	BaseTransfersItem
}

func NewTransfersItemMultiAmounts

func NewTransfersItemMultiAmounts(receiver base.Address, amounts []Amount) TransfersItemMultiAmounts

func (TransfersItemMultiAmounts) IsValid

func (it TransfersItemMultiAmounts) IsValid([]byte) error

func (TransfersItemMultiAmounts) Rebuild

type TransfersItemProcessor

type TransfersItemProcessor struct {
	// contains filtered or unexported fields
}

func (*TransfersItemProcessor) Close

func (opp *TransfersItemProcessor) Close() error

func (*TransfersItemProcessor) PreProcess

func (opp *TransfersItemProcessor) PreProcess(
	getState func(key string) (state.State, bool, error),
	_ func(valuehash.Hash, ...state.State) error,
) error

func (*TransfersItemProcessor) Process

func (opp *TransfersItemProcessor) Process(
	_ func(key string) (state.State, bool, error),
	_ func(valuehash.Hash, ...state.State) error,
) ([]state.State, error)

type TransfersItemSingleAmount

type TransfersItemSingleAmount struct {
	BaseTransfersItem
}

func NewTransfersItemSingleAmount

func NewTransfersItemSingleAmount(receiver base.Address, amount Amount) TransfersItemSingleAmount

func (TransfersItemSingleAmount) IsValid

func (it TransfersItemSingleAmount) IsValid([]byte) error

func (TransfersItemSingleAmount) Rebuild

type TransfersProcessor

type TransfersProcessor struct {
	Transfers
	// contains filtered or unexported fields
}

func (*TransfersProcessor) Close

func (opp *TransfersProcessor) Close() error

func (*TransfersProcessor) PreProcess

func (opp *TransfersProcessor) PreProcess(
	getState func(key string) (state.State, bool, error),
	setState func(valuehash.Hash, ...state.State) error,
) (state.Processor, error)

func (*TransfersProcessor) Process

func (opp *TransfersProcessor) Process(
	getState func(key string) (state.State, bool, error),
	setState func(valuehash.Hash, ...state.State) error,
) error

Source Files

Jump to

Keyboard shortcuts

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