currency

package
v2.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: GPL-3.0 Imports: 31 Imported by: 4

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 (
	AddressHint       = hint.MustNewHint("mca-v0.0.1")
	EthAddressHint    = hint.MustNewHint("eca-v0.0.1")
	ZeroAddressSuffix = "-X"
)
View Source
var (
	MaxAddressSize = 100
	MinAddressSize = base.AddressTypeSize + 3

	REStringAddressString = `[a-zA-Z0-9][\w\-\.\!\$\*\@]*[a-zA-Z0-9]`
)
View Source
var (
	NilBig       = NewBig(-1)
	NilBigString = big.NewInt(-1).String()
	ZeroBig      = NewBig(0)
)
View Source
var (
	CreateAccountsFactHint = hint.MustNewHint("mitum-currency-create-accounts-operation-fact-v0.0.1")
	CreateAccountsHint     = hint.MustNewHint("mitum-currency-create-accounts-operation-v0.0.1")
)
View Source
var (
	MinLengthCurrencyID = 3
	MaxLengthCurrencyID = 10
	ReValidCurrencyID   = regexp.MustCompile(`^[A-Z0-9][A-Z0-9_\.\!\$\*\@]*[A-Z0-9]$`)
)
View Source
var (
	CurrencyPolicyUpdaterFactHint = hint.MustNewHint("mitum-currency-currency-policy-updater-operation-fact-v0.0.1")
	CurrencyPolicyUpdaterHint     = hint.MustNewHint("mitum-currency-currency-policy-updater-operation-v0.0.1")
)
View Source
var (
	CurrencyRegisterFactHint = hint.MustNewHint("mitum-currency-currency-register-operation-fact-v0.0.1")
	CurrencyRegisterHint     = hint.MustNewHint("mitum-currency-currency-register-operation-v0.0.1")
)
View Source
var (
	FeeOperationFactHint = hint.MustNewHint("mitum-currency-fee-operation-fact-v0.0.1")
	FeeOperationHint     = hint.MustNewHint("mitum-currency-fee-operation-v0.0.1")
)
View Source
var (
	NilFeeerHint   = hint.MustNewHint("mitum-currency-nil-feeer-v0.0.1")
	FixedFeeerHint = hint.MustNewHint("mitum-currency-fixed-feeer-v0.0.1")
	RatioFeeerHint = hint.MustNewHint("mitum-currency-ratio-feeer-v0.0.1")
)
View Source
var (
	GenesisCurrenciesFactHint = hint.MustNewHint("mitum-currency-genesis-currencies-operation-fact-v0.0.1")
	GenesisCurrenciesHint     = hint.MustNewHint("mitum-currency-genesis-currencies-operation-v0.0.1")
)
View Source
var (
	KeyUpdaterFactHint = hint.MustNewHint("mitum-currency-keyupdater-operation-fact-v0.0.1")
	KeyUpdaterHint     = hint.MustNewHint("mitum-currency-keyupdater-operation-v0.0.1")
)
View Source
var (
	AccountKeyHint  = hint.MustNewHint("mitum-currency-key-v0.0.1")
	AccountKeysHint = hint.MustNewHint("mitum-currency-keys-v0.0.1")
)
View Source
var (
	MEPrivatekeyHint = hint.MustNewHint("epr-v0.0.1")
	MEPublickeyHint  = hint.MustNewHint("epu-v0.0.1")
)
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:"
)
View Source
var (
	SuffrageInflationFactHint = hint.MustNewHint("mitum-currency-suffrage-inflation-operation-fact-v0.0.1")
	SuffrageInflationHint     = hint.MustNewHint("mitum-currency-suffrage-inflation-operation-v0.0.1")
)
View Source
var (
	TransfersFactHint = hint.MustNewHint("mitum-currency-transfers-operation-fact-v0.0.1")
	TransfersHint     = hint.MustNewHint("mitum-currency-transfers-operation-v0.0.1")
)
View Source
var (
	AccountHint = hint.MustNewHint("mitum-currency-account-v0.0.1")
)
View Source
var (
	AmountHint = hint.MustNewHint("mitum-currency-amount-v0.0.1")
)
View Source
var BaseStateHint = hint.MustNewHint("currency-base-state-v0.0.1")
View Source
var (
	CreateAccountsItemMultiAmountsHint = hint.MustNewHint("mitum-currency-create-accounts-multiple-amounts-v0.0.1")
)
View Source
var (
	CreateAccountsItemSingleAmountHint = hint.MustNewHint("mitum-currency-create-accounts-single-amount-v0.0.1")
)
View Source
var (
	CurrencyDesignHint = hint.MustNewHint("mitum-currency-currency-design-v0.0.1")
)
View Source
var (
	CurrencyPolicyHint = hint.MustNewHint("mitum-currency-currency-policy-v0.0.1")
)
View Source
var MaxAccountKeyInKeys = 10
View Source
var MaxCreateAccountsItems uint = 1000
View Source
var MaxTransferItems uint = 10
View Source
var NodeHint = hint.MustNewHint("currency-node-v0.0.1")
View Source
var StringAddressHint = hint.MustNewHint("sas-v2")
View Source
var (
	SuffrageInflationItemHint = hint.MustNewHint("mitum-currency-suffrage-inflation-item-v0.0.1")
)
View Source
var (
	TransfersItemMultiAmountsHint = hint.MustNewHint("mitum-currency-transfers-item-multi-amounts-v0.0.1")
)
View Source
var (
	TransfersItemSingleAmountHint = hint.MustNewHint("mitum-currency-transfers-item-single-amount-v0.0.1")
)
View Source
var UnlimitedMaxFeeAmount = NewBig(-1)

Functions

func CalculateItemsFee

func CalculateItemsFee(getStateFunc base.GetStateFunc, items []AmountsItem) (map[CurrencyID]base.State, map[CurrencyID][2]Big, error)

func CheckEnoughBalance

func CheckEnoughBalance(
	holder base.Address,
	required map[CurrencyID][2]Big,
	getStateFunc base.GetStateFunc,
) (map[CurrencyID]base.State, error)

func DecodeStateValue

func DecodeStateValue(b []byte, enc encoder.Encoder) (base.StateValue, error)

func IsStateAccountKey

func IsStateAccountKey(key string) bool

func IsStateBalanceKey

func IsStateBalanceKey(key string) bool

func IsStateCurrencyDesignKey

func IsStateCurrencyDesignKey(key string) bool

func IsValidOperationFact

func IsValidOperationFact(fact base.Fact, networkID []byte) error

func NewAccountStateMergeValue

func NewAccountStateMergeValue(key string, stv base.StateValue) base.StateMergeValue

func NewBalanceStateMergeValue

func NewBalanceStateMergeValue(key string, stv base.StateValue) base.StateMergeValue

func NewCurrencyDesignStateMergeValue

func NewCurrencyDesignStateMergeValue(key string, stv base.StateValue) base.StateMergeValue

func NewFeeOperationProcessor

func NewFeeOperationProcessor(
	height base.Height,
	getStateFunc base.GetStateFunc,
) (base.OperationProcessor, error)

func NewFeeToken

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

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 base.State) (Account, error)

func NewAccount

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

func NewAccountFromKeys

func NewAccountFromKeys(keys AccountKeys) (Account, error)

func NewEthAccountFromKeys

func NewEthAccountFromKeys(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) DecodeBSON

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

func (*Account) DecodeJSON

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

func (Account) EncodeJSON

func (ac Account) EncodeJSON() AccountJSONMarshaler

func (Account) GenerateHash

func (ac Account) GenerateHash() util.Hash

func (Account) Hash

func (ac Account) Hash() util.Hash

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) SetKeys

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

type AccountBSONUnmarshaler

type AccountBSONUnmarshaler struct {
	Hint    string          `bson:"_hint"`
	Hash    valuehash.Bytes `bson:"hash"`
	Address string          `bson:"address"`
	Keys    bson.Raw        `bson:"keys"`
}

type AccountJSONMarshaler

type AccountJSONMarshaler struct {
	hint.BaseHinter
	Hash    util.Hash    `json:"hash"`
	Address base.Address `json:"address"`
	Keys    AccountKeys  `json:"keys"`
}

type AccountJSONUnmarshaler

type AccountJSONUnmarshaler struct {
	Hint    hint.Hint             `json:"_hint"`
	Hash    valuehash.HashDecoder `json:"hash"`
	Address string                `json:"address"`
	Keys    json.RawMessage       `json:"keys"`
}

type AccountKey

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

type AccountKeys

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

func StateKeysValue

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

type AccountStateValue

type AccountStateValue struct {
	hint.BaseHinter
	Account Account
}

func NewAccountStateValue

func NewAccountStateValue(account Account) AccountStateValue

func (*AccountStateValue) DecodeBSON

func (s *AccountStateValue) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*AccountStateValue) DecodeJSON

func (s *AccountStateValue) DecodeJSON(b []byte, enc *jsonenc.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 (s AccountStateValue) MarshalBSON() ([]byte, error)

func (AccountStateValue) MarshalJSON

func (s AccountStateValue) MarshalJSON() ([]byte, error)

type AccountStateValueBSONUnmarshaler

type AccountStateValueBSONUnmarshaler struct {
	Hint    string   `bson:"_hint"`
	Account bson.Raw `bson:"account"`
}

type AccountStateValueJSONMarshaler

type AccountStateValueJSONMarshaler struct {
	hint.BaseHinter
	Account Account `json:"account"`
}

type AccountStateValueJSONUnmarshaler

type AccountStateValueJSONUnmarshaler struct {
	AC json.RawMessage `json:"account"`
}

type AccountStateValueMerger

type AccountStateValueMerger struct {
	*BaseStateValueMerger
}

func NewAccountStateValueMerger

func NewAccountStateValueMerger(height base.Height, key string, st base.State) *AccountStateValueMerger

type AddFee

type AddFee map[CurrencyID][2]Big

func (AddFee) Add

func (af AddFee) Add(key CurrencyID, add Big) AddFee

func (AddFee) Fee

func (af AddFee) Fee(key CurrencyID, fee Big) AddFee

type Address

type Address struct {
	base.BaseStringAddress
}

func NewAddress

func NewAddress(s string) Address

func NewAddressFromKeys

func NewAddressFromKeys(keys AccountKeys) (Address, error)

func ZeroAddress

func ZeroAddress(cid CurrencyID) Address

func (*Address) DecodeBSON

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

func (*Address) DecodeJSON

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

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)

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 base.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) DecodeBSON

func (am *Amount) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*Amount) DecodeJSON

func (am *Amount) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (Amount) Equal

func (am Amount) Equal(b Amount) bool

func (Amount) GenerateHash

func (am Amount) GenerateHash() util.Hash

func (Amount) Hash

func (am Amount) Hash() util.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) WithBig

func (am Amount) WithBig(big Big) Amount

type AmountBSONUnmarshaler

type AmountBSONUnmarshaler struct {
	Hint      string `bson:"_hint"`
	Currency  string `bson:"currency"`
	AmountBig string `bson:"amount"`
}

type AmountJSONMarshaler

type AmountJSONMarshaler struct {
	AmountBig string     `json:"amount"`
	Currency  CurrencyID `json:"currency"`
	hint.BaseHinter
}

type AmountJSONUnmarshaler

type AmountJSONUnmarshaler struct {
	AmountBig string    `json:"amount"`
	Currency  string    `json:"currency"`
	Hint      hint.Hint `json:"_hint"`
}

type AmountsItem

type AmountsItem interface {
	Amounts() []Amount
}

type BalanceStateValue

type BalanceStateValue struct {
	hint.BaseHinter
	Amount Amount
}

func NewBalanceStateValue

func NewBalanceStateValue(amount Amount) BalanceStateValue

func (*BalanceStateValue) DecodeBSON

func (s *BalanceStateValue) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*BalanceStateValue) DecodeJSON

func (s *BalanceStateValue) DecodeJSON(b []byte, enc *jsonenc.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 (s BalanceStateValue) MarshalBSON() ([]byte, error)

func (BalanceStateValue) MarshalJSON

func (s BalanceStateValue) MarshalJSON() ([]byte, error)

type BalanceStateValueBSONUnmarshaler

type BalanceStateValueBSONUnmarshaler struct {
	Hint   string   `bson:"_hint"`
	Amount bson.Raw `bson:"amount"`
}

type BalanceStateValueJSONMarshaler

type BalanceStateValueJSONMarshaler struct {
	hint.BaseHinter
	Amount Amount `json:"amount"`
}

type BalanceStateValueJSONUnmarshaler

type BalanceStateValueJSONUnmarshaler struct {
	AM json.RawMessage `json:"amount"`
}

type BalanceStateValueMerger

type BalanceStateValueMerger struct {
	*BaseStateValueMerger
}

func NewBalanceStateValueMerger

func NewBalanceStateValueMerger(height base.Height, key string, st base.State) *BalanceStateValueMerger

type BaseAccountKey

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

func NewBaseAccountKey

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

func (BaseAccountKey) Bytes

func (ky BaseAccountKey) Bytes() []byte

func (*BaseAccountKey) DecodeBSON

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

func (*BaseAccountKey) DecodeJSON

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

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() base.Publickey

func (BaseAccountKey) MarshalBSON

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

func (BaseAccountKey) MarshalJSON

func (ky BaseAccountKey) MarshalJSON() ([]byte, 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) DecodeBSON

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

func (*BaseAccountKeys) DecodeJSON

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

func (BaseAccountKeys) Equal

func (ks BaseAccountKeys) Equal(b AccountKeys) bool

func (BaseAccountKeys) GenerateHash

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

func (BaseAccountKeys) GenerateKeccakHash

func (ks BaseAccountKeys) GenerateKeccakHash() (util.Hash, error)

func (BaseAccountKeys) Hash

func (ks BaseAccountKeys) Hash() util.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

type BaseCreateAccountsItem

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

func NewBaseCreateAccountsItem

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

func (BaseCreateAccountsItem) Address

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

func (BaseCreateAccountsItem) AddressType

func (it BaseCreateAccountsItem) AddressType() hint.Type

func (BaseCreateAccountsItem) Amounts

func (it BaseCreateAccountsItem) Amounts() []Amount

func (BaseCreateAccountsItem) Bytes

func (it BaseCreateAccountsItem) Bytes() []byte

func (*BaseCreateAccountsItem) DecodeBSON

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

func (*BaseCreateAccountsItem) DecodeJSON

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

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

type BaseFactBSONUnmarshaler

type BaseFactBSONUnmarshaler struct {
	Hash  string `bson:"hash"`
	Token []byte `bson:"token"`
}

type BaseNode

type BaseNode struct {
	util.IsValider

	util.DefaultJSONMarshaled
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewBaseNode

func NewBaseNode(ht hint.Hint, pub base.Publickey, addr Address) BaseNode

func (BaseNode) Address

func (n BaseNode) Address() base.Address

func (*BaseNode) DecodeBSON

func (n *BaseNode) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*BaseNode) DecodeJSON

func (n *BaseNode) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (BaseNode) HashBytes

func (n BaseNode) HashBytes() []byte

func (BaseNode) IsValid

func (n BaseNode) IsValid([]byte) error

func (BaseNode) MarshalBSON

func (n BaseNode) MarshalBSON() ([]byte, error)

func (BaseNode) MarshalJSON

func (n BaseNode) MarshalJSON() ([]byte, error)

func (BaseNode) Publickey

func (n BaseNode) Publickey() base.Publickey

type BaseNodeBSONUnMarshaler

type BaseNodeBSONUnMarshaler struct {
	Hint      string `bson:"_hint"`
	Address   string `bson:"address"`
	Publickey string `bson:"publickey"`
}

type BaseNodeJSONMarshaler

type BaseNodeJSONMarshaler struct {
	Address   base.Address   `json:"address"`
	Publickey base.Publickey `json:"publickey"`
}

type BaseNodeJSONUnmarshaler

type BaseNodeJSONUnmarshaler struct {
	Address   string `json:"address"`
	Publickey string `json:"publickey"`
}

type BaseNodeOperation

type BaseNodeOperation struct {
	BaseOperation
}

func NewBaseNodeOperation

func NewBaseNodeOperation(ht hint.Hint, fact base.Fact) BaseNodeOperation

func (*BaseNodeOperation) AddNodeSigns

func (op *BaseNodeOperation) AddNodeSigns(signs []base.NodeSign) (added bool, _ error)

func (*BaseNodeOperation) DecodeBSON

func (op *BaseNodeOperation) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (BaseNodeOperation) IsValid

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

func (*BaseNodeOperation) NodeSign

func (op *BaseNodeOperation) NodeSign(priv base.Privatekey, networkID base.NetworkID, node base.Address) error

func (BaseNodeOperation) NodeSigns

func (op BaseNodeOperation) NodeSigns() []base.NodeSign

func (*BaseNodeOperation) SetNodeSigns

func (op *BaseNodeOperation) SetNodeSigns(signs []base.NodeSign) error

type BaseOperation

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

func NewBaseOperation

func NewBaseOperation(
	ht hint.Hint, fact base.Fact,
) BaseOperation

func (*BaseOperation) DecodeBSON

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

func (*BaseOperation) DecodeJSON

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

func (BaseOperation) Fact

func (op BaseOperation) Fact() base.Fact

func (BaseOperation) Hash

func (op BaseOperation) Hash() util.Hash

func (BaseOperation) HashBytes

func (op BaseOperation) HashBytes() []byte

func (BaseOperation) IsValid

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

func (BaseOperation) JSONMarshaler

func (op BaseOperation) JSONMarshaler() BaseOperationJSONMarshaler

func (BaseOperation) MarshalBSON

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

func (BaseOperation) MarshalJSON

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

func (*BaseOperation) SetFact

func (op *BaseOperation) SetFact(fact base.Fact)

func (*BaseOperation) SetHash

func (op *BaseOperation) SetHash(h util.Hash)

func (*BaseOperation) Sign

func (op *BaseOperation) Sign(priv base.Privatekey, networkID base.NetworkID) error

func (BaseOperation) Signs

func (op BaseOperation) Signs() []base.Sign

type BaseOperationBSONUnmarshaler

type BaseOperationBSONUnmarshaler struct {
	Hint string   `bson:"_hint"`
	Hash string   `bson:"hash"`
	Fact bson.Raw `bson:"fact"`
}

type BaseOperationJSONMarshaler

type BaseOperationJSONMarshaler struct {
	Hash  util.Hash   `json:"hash"`
	Fact  base.Fact   `json:"fact"`
	Signs []base.Sign `json:"signs"`
	hint.BaseHinter
}

type BaseOperationJSONUnmarshaler

type BaseOperationJSONUnmarshaler struct {
	Hash  valuehash.HashDecoder `json:"hash"`
	Fact  json.RawMessage       `json:"fact"`
	Signs []json.RawMessage     `json:"signs"`
}

type BaseState

type BaseState struct {
	util.DefaultJSONMarshaled
	hint.BaseHinter
	// contains filtered or unexported fields
}

func NewBaseState

func NewBaseState(
	height base.Height,
	k string,
	v base.StateValue,
	previous util.Hash,
	ops []util.Hash,
) BaseState

func (BaseState) BSONM

func (s BaseState) BSONM() bson.M

func (*BaseState) DecodeBSON

func (s *BaseState) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*BaseState) DecodeJSON

func (s *BaseState) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (BaseState) Hash

func (s BaseState) Hash() util.Hash

func (BaseState) Height

func (s BaseState) Height() base.Height

func (BaseState) IsValid

func (s BaseState) IsValid([]byte) error

func (BaseState) Key

func (s BaseState) Key() string

func (BaseState) MarshalBSON

func (s BaseState) MarshalBSON() ([]byte, error)

func (BaseState) MarshalJSON

func (s BaseState) MarshalJSON() ([]byte, error)

func (BaseState) Operations

func (s BaseState) Operations() []util.Hash

func (BaseState) Previous

func (s BaseState) Previous() util.Hash

func (BaseState) Value

func (s BaseState) Value() base.StateValue

type BaseStateBSONUnmarshaler

type BaseStateBSONUnmarshaler struct {
	Hint       string            `bson:"_hint"`
	Hash       valuehash.Bytes   `bson:"hash"`
	Previous   valuehash.Bytes   `bson:"previous"`
	Key        string            `bson:"key"`
	Value      bson.Raw          `bson:"value"`
	Operations []valuehash.Bytes `bson:"operations"`
	Height     base.Height       `bson:"height"`
}

type BaseStateMergeValue

type BaseStateMergeValue struct {
	base.StateValue
	// contains filtered or unexported fields
}

func NewBaseStateMergeValue

func NewBaseStateMergeValue(
	key string,
	value base.StateValue,
	merger func(base.Height, base.State) base.StateValueMerger,
) BaseStateMergeValue

func (BaseStateMergeValue) Key

func (v BaseStateMergeValue) Key() string

func (BaseStateMergeValue) Merger

func (BaseStateMergeValue) Value

type BaseStateValueMerger

type BaseStateValueMerger struct {
	base.State

	sync.RWMutex
	// contains filtered or unexported fields
}

func NewBaseStateValueMerger

func NewBaseStateValueMerger(height base.Height, key string, st base.State) *BaseStateValueMerger

func (*BaseStateValueMerger) AddOperations

func (s *BaseStateValueMerger) AddOperations(ops []util.Hash)

func (*BaseStateValueMerger) Close

func (s *BaseStateValueMerger) Close() error

func (*BaseStateValueMerger) Hash

func (s *BaseStateValueMerger) Hash() util.Hash

func (*BaseStateValueMerger) Height

func (s *BaseStateValueMerger) Height() base.Height

func (*BaseStateValueMerger) Key

func (s *BaseStateValueMerger) Key() string

func (*BaseStateValueMerger) MarshalJSON

func (s *BaseStateValueMerger) MarshalJSON() ([]byte, error)

func (*BaseStateValueMerger) Merge

func (s *BaseStateValueMerger) Merge(value base.StateValue, ops []util.Hash) error

func (*BaseStateValueMerger) Operations

func (s *BaseStateValueMerger) Operations() []util.Hash

func (*BaseStateValueMerger) Previous

func (s *BaseStateValueMerger) Previous() util.Hash

func (*BaseStateValueMerger) SetValue

func (s *BaseStateValueMerger) SetValue(v base.StateValue)

func (*BaseStateValueMerger) Value

type BaseStringAddress

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

func NewBaseStringAddressWithHint

func NewBaseStringAddressWithHint(ht hint.Hint, s string) BaseStringAddress

func (BaseStringAddress) Bytes

func (ad BaseStringAddress) Bytes() []byte

func (BaseStringAddress) Equal

func (ad BaseStringAddress) Equal(b base.Address) bool

func (BaseStringAddress) IsValid

func (ad BaseStringAddress) IsValid([]byte) error

func (BaseStringAddress) MarshalText

func (ad BaseStringAddress) MarshalText() ([]byte, error)

func (BaseStringAddress) String

func (ad BaseStringAddress) String() string

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) DecodeBSON

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

func (*BaseTransfersItem) DecodeJSON

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

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

type BaseTransfersItemJSONUnpacker

type BaseTransfersItemJSONUnpacker struct {
	Hint     hint.Hint       `json:"_hint"`
	Receiver string          `json:"receiver"`
	Amounts  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) (CreateAccounts, error)

func (*CreateAccounts) DecodeBSON

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

func (*CreateAccounts) DecodeJSON

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

func (*CreateAccounts) HashSign

func (op *CreateAccounts) HashSign(priv base.Privatekey, networkID base.NetworkID) error

func (CreateAccounts) MarshalBSON

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

func (CreateAccounts) MarshalJSON

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

func (CreateAccounts) Process

type CreateAccountsFact

type CreateAccountsFact struct {
	base.BaseFact
	// 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) DecodeBSON

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

func (*CreateAccountsFact) DecodeJSON

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

func (CreateAccountsFact) GenerateHash

func (fact CreateAccountsFact) GenerateHash() util.Hash

func (CreateAccountsFact) Hash

func (fact CreateAccountsFact) Hash() util.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() base.Token

type CreateAccountsFactBSONUnmarshaler

type CreateAccountsFactBSONUnmarshaler struct {
	Hint   string   `bson:"_hint"`
	Sender string   `bson:"sender"`
	Items  bson.Raw `bson:"items"`
}

type CreateAccountsFactJSONMarshaler

type CreateAccountsFactJSONMarshaler struct {
	base.BaseFactJSONMarshaler
	Sender base.Address         `json:"sender"`
	Items  []CreateAccountsItem `json:"items"`
}

type CreateAccountsFactJSONUnMarshaler

type CreateAccountsFactJSONUnMarshaler struct {
	base.BaseFactJSONUnmarshaler
	Sender string          `json:"sender"`
	Items  json.RawMessage `json:"items"`
}

type CreateAccountsItem

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

type CreateAccountsItemBSONUnmarshaler

type CreateAccountsItemBSONUnmarshaler struct {
	Hint     string   `bson:"_hint"`
	Keys     bson.Raw `bson:"keys"`
	Amount   bson.Raw `bson:"amounts"`
	AddrType string   `bson:"addrtype"`
}

type CreateAccountsItemJSONMarshaler

type CreateAccountsItemJSONMarshaler struct {
	hint.BaseHinter
	Keys     AccountKeys `json:"keys"`
	Amounts  []Amount    `json:"amounts"`
	AddrType hint.Type   `json:"addrtype"`
}

type CreateAccountsItemJSONUnMarshaler

type CreateAccountsItemJSONUnMarshaler struct {
	Hint     hint.Hint       `json:"_hint"`
	Keys     json.RawMessage `json:"keys"`
	Amounts  json.RawMessage `json:"amounts"`
	AddrType string          `json:"addrtype"`
}

type CreateAccountsItemMultiAmounts

type CreateAccountsItemMultiAmounts struct {
	BaseCreateAccountsItem
}

func NewCreateAccountsItemMultiAmounts

func NewCreateAccountsItemMultiAmounts(keys AccountKeys, amounts []Amount, addrType hint.Type) 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(
	ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc,
) error

func (*CreateAccountsItemProcessor) Process

type CreateAccountsItemSingleAmount

type CreateAccountsItemSingleAmount struct {
	BaseCreateAccountsItem
}

func NewCreateAccountsItemSingleAmount

func NewCreateAccountsItemSingleAmount(keys AccountKeys, amount Amount, addrType hint.Type) CreateAccountsItemSingleAmount

func (CreateAccountsItemSingleAmount) IsValid

func (CreateAccountsItemSingleAmount) Rebuild

type CreateAccountsProcessor

type CreateAccountsProcessor struct {
	*base.BaseOperationProcessor
	// contains filtered or unexported fields
}

func (*CreateAccountsProcessor) Close

func (opp *CreateAccountsProcessor) Close() error

func (*CreateAccountsProcessor) PreProcess

func (*CreateAccountsProcessor) Process

type CurrencyDesign

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

func NewCurrencyDesign

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

func StateCurrencyDesignValue

func StateCurrencyDesignValue(st base.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) Currency

func (de CurrencyDesign) Currency() CurrencyID

func (*CurrencyDesign) DecodeBSON

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

func (*CurrencyDesign) DecodeJSON

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

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

type CurrencyDesignBSONUnmarshaler

type CurrencyDesignBSONUnmarshaler struct {
	Hint      string   `bson:"_hint"`
	Amount    bson.Raw `bson:"amount"`
	Genesis   string   `bson:"genesis_account"`
	Policy    bson.Raw `bson:"policy"`
	Aggregate string   `bson:"aggregate"`
}

type CurrencyDesignJSONMarshaler

type CurrencyDesignJSONMarshaler struct {
	hint.BaseHinter
	Amount    Amount         `json:"amount"`
	Genesis   base.Address   `json:"genesis_account"`
	Policy    CurrencyPolicy `json:"policy"`
	Aggregate string         `json:"aggregate"`
}

type CurrencyDesignJSONUnmarshaler

type CurrencyDesignJSONUnmarshaler struct {
	Hint      hint.Hint       `json:"_hint"`
	Amount    json.RawMessage `json:"amount"`
	Genesis   string          `json:"genesis_account"`
	Policy    json.RawMessage `json:"policy"`
	Aggregate string          `json:"aggregate"`
}

type CurrencyDesignStateValue

type CurrencyDesignStateValue struct {
	hint.BaseHinter
	CurrencyDesign CurrencyDesign
}

func NewCurrencyDesignStateValue

func NewCurrencyDesignStateValue(currencyDesign CurrencyDesign) CurrencyDesignStateValue

func (*CurrencyDesignStateValue) DecodeBSON

func (s *CurrencyDesignStateValue) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*CurrencyDesignStateValue) DecodeJSON

func (s *CurrencyDesignStateValue) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (CurrencyDesignStateValue) HashBytes

func (c CurrencyDesignStateValue) HashBytes() []byte

func (CurrencyDesignStateValue) Hint

func (CurrencyDesignStateValue) IsValid

func (c CurrencyDesignStateValue) IsValid([]byte) error

func (CurrencyDesignStateValue) MarshalBSON

func (s CurrencyDesignStateValue) MarshalBSON() ([]byte, error)

func (CurrencyDesignStateValue) MarshalJSON

func (s CurrencyDesignStateValue) MarshalJSON() ([]byte, error)

type CurrencyDesignStateValueBSONUnmarshaler

type CurrencyDesignStateValueBSONUnmarshaler struct {
	Hint           string   `bson:"_hint"`
	CurrencyDesign bson.Raw `bson:"currencydesign"`
}

type CurrencyDesignStateValueJSONMarshaler

type CurrencyDesignStateValueJSONMarshaler struct {
	hint.BaseHinter
	CurrencyDesign CurrencyDesign `json:"currencydesign"`
}

type CurrencyDesignStateValueJSONUnmarshaler

type CurrencyDesignStateValueJSONUnmarshaler struct {
	CD json.RawMessage `json:"currencydesign"`
}

type CurrencyDesignStateValueMerger

type CurrencyDesignStateValueMerger struct {
	*BaseStateValueMerger
}

func NewCurrencyDesignStateValueMerger

func NewCurrencyDesignStateValueMerger(height base.Height, key string, st base.State) *CurrencyDesignStateValueMerger

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) DecodeBSON

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

func (*CurrencyPolicy) DecodeJSON

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

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) Process

type CurrencyPolicyBSONUnmarshaler

type CurrencyPolicyBSONUnmarshaler struct {
	Hint          string   `bson:"_hint"`
	NewAccountMin string   `bson:"new_account_min_balance"`
	Feeer         bson.Raw `bson:"feeer"`
}

type CurrencyPolicyJSONMarshaler

type CurrencyPolicyJSONMarshaler struct {
	hint.BaseHinter
	NewAccountMin string `json:"new_account_min_balance"`
	Feeer         Feeer  `json:"feeer"`
}

type CurrencyPolicyJSONUnmarshaler

type CurrencyPolicyJSONUnmarshaler struct {
	Hint          hint.Hint       `json:"_hint"`
	NewAccountMin string          `json:"new_account_min_balance"`
	Feeer         json.RawMessage `json:"feeer"`
}

type CurrencyPolicyUpdater

type CurrencyPolicyUpdater struct {
	BaseNodeOperation
}

func NewCurrencyPolicyUpdater

func NewCurrencyPolicyUpdater(fact CurrencyPolicyUpdaterFact, memo string) (CurrencyPolicyUpdater, error)

func (*CurrencyPolicyUpdater) DecodeBSON

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

func (*CurrencyPolicyUpdater) DecodeJSON

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

func (CurrencyPolicyUpdater) MarshalBSON

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

func (CurrencyPolicyUpdater) MarshalJSON

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

type CurrencyPolicyUpdaterFact

type CurrencyPolicyUpdaterFact struct {
	base.BaseFact
	// contains filtered or unexported fields
}

func NewCurrencyPolicyUpdaterFact

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

func (CurrencyPolicyUpdaterFact) Bytes

func (fact CurrencyPolicyUpdaterFact) Bytes() []byte

func (CurrencyPolicyUpdaterFact) Currency

func (fact CurrencyPolicyUpdaterFact) Currency() CurrencyID

func (*CurrencyPolicyUpdaterFact) DecodeBSON

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

func (*CurrencyPolicyUpdaterFact) DecodeJSON

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

func (CurrencyPolicyUpdaterFact) GenerateHash

func (fact CurrencyPolicyUpdaterFact) GenerateHash() util.Hash

func (CurrencyPolicyUpdaterFact) Hash

func (fact CurrencyPolicyUpdaterFact) Hash() util.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() base.Token

type CurrencyPolicyUpdaterFactBSONUnmarshaler

type CurrencyPolicyUpdaterFactBSONUnmarshaler struct {
	Hint     string   `bson:"_hint"`
	Currency string   `bson:"currency"`
	Policy   bson.Raw `bson:"policy"`
}

type CurrencyPolicyUpdaterFactJSONMarshaler

type CurrencyPolicyUpdaterFactJSONMarshaler struct {
	base.BaseFactJSONMarshaler
	Currency CurrencyID     `json:"currency"`
	Policy   CurrencyPolicy `json:"policy"`
}

type CurrencyPolicyUpdaterFactJSONUnMarshaler

type CurrencyPolicyUpdaterFactJSONUnMarshaler struct {
	base.BaseFactJSONUnmarshaler
	Currency string          `json:"currency"`
	Policy   json.RawMessage `json:"policy"`
}

type CurrencyPolicyUpdaterProcessor

type CurrencyPolicyUpdaterProcessor struct {
	*base.BaseOperationProcessor
	// contains filtered or unexported fields
}

func (*CurrencyPolicyUpdaterProcessor) Close

func (*CurrencyPolicyUpdaterProcessor) PreProcess

func (*CurrencyPolicyUpdaterProcessor) Process

type CurrencyRegister

type CurrencyRegister struct {
	BaseNodeOperation
}

func NewCurrencyRegister

func NewCurrencyRegister(fact CurrencyRegisterFact, memo string) (CurrencyRegister, error)

func (*CurrencyRegister) DecodeBSON

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

func (*CurrencyRegister) DecodeJSON

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

func (CurrencyRegister) MarshalBSON

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

func (CurrencyRegister) MarshalJSON

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

func (CurrencyRegister) Process

type CurrencyRegisterFact

type CurrencyRegisterFact struct {
	base.BaseFact
	// 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) DecodeBSON

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

func (*CurrencyRegisterFact) DecodeJSON

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

func (CurrencyRegisterFact) GenerateHash

func (fact CurrencyRegisterFact) GenerateHash() util.Hash

func (CurrencyRegisterFact) Hash

func (fact CurrencyRegisterFact) Hash() util.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() base.Token

type CurrencyRegisterFactBSONUnmarshaler

type CurrencyRegisterFactBSONUnmarshaler struct {
	Hint     string   `bson:"_hint"`
	Currency bson.Raw `bson:"currency"`
}

type CurrencyRegisterFactJSONMarshaler

type CurrencyRegisterFactJSONMarshaler struct {
	base.BaseFactJSONMarshaler
	Currency CurrencyDesign `json:"currency"`
}

type CurrencyRegisterFactJSONUnMarshaler

type CurrencyRegisterFactJSONUnMarshaler struct {
	base.BaseFactJSONUnmarshaler
	Currency json.RawMessage `json:"currency"`
}

type CurrencyRegisterProcessor

type CurrencyRegisterProcessor struct {
	*base.BaseOperationProcessor
	// contains filtered or unexported fields
}

func (*CurrencyRegisterProcessor) Close

func (opp *CurrencyRegisterProcessor) Close() error

func (*CurrencyRegisterProcessor) PreProcess

func (*CurrencyRegisterProcessor) Process

type DuplicationType

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

type EthAddress

type EthAddress struct {
	base.BaseStringAddress
}

func NewEthAddress

func NewEthAddress(s string) EthAddress

func NewEthAddressFromKeys

func NewEthAddressFromKeys(keys AccountKeys) (EthAddress, error)

func (*EthAddress) DecodeBSON

func (ca *EthAddress) DecodeBSON(b []byte, _ *bsonenc.Encoder) error

func (*EthAddress) DecodeJSON

func (ca *EthAddress) DecodeJSON(b []byte, _ *jsonenc.Encoder) error

func (EthAddress) IsValid

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

func (EthAddress) MarshalBSONValue

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

func (EthAddress) MarshalText

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

type FeeOperation

type FeeOperation struct {
	BaseOperation
}

func NewFeeOperation

func NewFeeOperation(fact FeeOperationFact) (FeeOperation, error)

func (*FeeOperation) DecodeBSON

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

func (*FeeOperation) HashSign

func (op *FeeOperation) HashSign(priv base.Privatekey, networkID base.NetworkID) error

func (FeeOperation) Process

func (FeeOperation) Process(
	func(key string) (base.State, bool, error),
	func(util.Hash, ...base.State) error,
) error

type FeeOperationFact

type FeeOperationFact struct {
	base.BaseFact
	// 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) DecodeBSON

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

func (*FeeOperationFact) DecodeJSON

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

func (FeeOperationFact) Hash

func (fact FeeOperationFact) Hash() util.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() base.Token

type FeeOperationFactBSONUnmarshaler

type FeeOperationFactBSONUnmarshaler struct {
	Hint    string   `bson:"_hint"`
	Amounts bson.Raw `bson:"amounts"`
}

type FeeOperationFactJSONMarshaler

type FeeOperationFactJSONMarshaler struct {
	base.BaseFactJSONMarshaler
	Amounts []Amount `json:"amounts"`
}

type FeeOperationFactJSONUnMarshaler

type FeeOperationFactJSONUnMarshaler struct {
	base.BaseFactJSONUnmarshaler
	AM json.RawMessage `json:"amounts"`
}

type FeeOperationProcessor

type FeeOperationProcessor struct {
	*base.BaseOperationProcessor
}

func (*FeeOperationProcessor) PreProcess

func (*FeeOperationProcessor) Process

type Feeer

type Feeer interface {
	util.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) DecodeBSON

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

func (*FixedFeeer) DecodeJSON

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

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

type FixedFeeerBSONUnmarshaler

type FixedFeeerBSONUnmarshaler struct {
	Hint     string `bson:"_hint"`
	Receiver string `bson:"receiver"`
	Amount   string `bson:"amount"`
}

type FixedFeeerJSONMarshaler

type FixedFeeerJSONMarshaler struct {
	hint.BaseHinter
	Receiver base.Address `json:"receiver"`
	Amount   string       `json:"amount"`
}

type FixedFeeerJSONUnmarshaler

type FixedFeeerJSONUnmarshaler struct {
	Hint     hint.Hint `json:"_hint"`
	Receiver string    `json:"receiver"`
	Amount   string    `json:"amount"`
}

type GenesisCurrencies

type GenesisCurrencies struct {
	BaseOperation
}

func NewGenesisCurrencies

func NewGenesisCurrencies(
	fact GenesisCurrenciesFact,
) GenesisCurrencies

func (*GenesisCurrencies) DecodeBSON

func (op *GenesisCurrencies) DecodeBSON(b []byte, enc *bsonenc.Encoder) 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) PreProcess

func (GenesisCurrencies) Process

type GenesisCurrenciesFact

type GenesisCurrenciesFact struct {
	base.BaseFact
	// contains filtered or unexported fields
}

func NewGenesisCurrenciesFact

func NewGenesisCurrenciesFact(
	token []byte,
	genesisNodeKey base.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) DecodeBSON

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

func (*GenesisCurrenciesFact) DecodeJSON

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

func (GenesisCurrenciesFact) GenerateHash

func (fact GenesisCurrenciesFact) GenerateHash() util.Hash

func (GenesisCurrenciesFact) GenesisNodeKey

func (fact GenesisCurrenciesFact) GenesisNodeKey() base.Publickey

func (GenesisCurrenciesFact) Hash

func (fact GenesisCurrenciesFact) Hash() util.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() base.Token

type GenesisCurrenciesFactBSONUnMarshaler

type GenesisCurrenciesFactBSONUnMarshaler struct {
	Hint           string   `bson:"_hint"`
	GenesisNodeKey string   `bson:"genesis_node_key"`
	Keys           bson.Raw `bson:"keys"`
	Currencies     bson.Raw `bson:"currencies"`
}

type GenesisCurrenciesFactJSONMarshaler

type GenesisCurrenciesFactJSONMarshaler struct {
	base.BaseFactJSONMarshaler
	GenesisNodeKey base.Publickey   `json:"genesis_node_key"`
	Keys           AccountKeys      `json:"keys"`
	Currencies     []CurrencyDesign `json:"currencies"`
}

type GenesisCurrenciesFactJSONUnMarshaler

type GenesisCurrenciesFactJSONUnMarshaler struct {
	base.BaseFactJSONUnmarshaler
	GenesisNodeKey string          `json:"genesis_node_key"`
	Keys           json.RawMessage `json:"keys"`
	Currencies     json.RawMessage `json:"currencies"`
}

type GetNewProcessor

type GetNewProcessor func(
	height base.Height,
	getStateFunc base.GetStateFunc,
	newPreProcessConstraintFunc base.NewOperationProcessorProcessFunc,
	newProcessConstraintFunc base.NewOperationProcessorProcessFunc) (base.OperationProcessor, error)

func NewCreateAccountsProcessor

func NewCreateAccountsProcessor() GetNewProcessor

func NewCurrencyPolicyUpdaterProcessor

func NewCurrencyPolicyUpdaterProcessor(threshold base.Threshold) GetNewProcessor

func NewCurrencyRegisterProcessor

func NewCurrencyRegisterProcessor(threshold base.Threshold) GetNewProcessor

func NewKeyUpdaterProcessor

func NewKeyUpdaterProcessor() GetNewProcessor

func NewSuffrageInflationProcessor

func NewSuffrageInflationProcessor(threshold base.Threshold) GetNewProcessor

func NewTransfersProcessor

func NewTransfersProcessor() GetNewProcessor

type HashGenerator

type HashGenerator interface {
	GenerateHash() util.Hash
}

type KeyBSONUnmarshaler

type KeyBSONUnmarshaler struct {
	Hint   string `bson:"_hint"`
	Weight uint   `bson:"weight"`
	Keys   string `bson:"key"`
}

type KeyJSONMarshaler

type KeyJSONMarshaler struct {
	hint.BaseHinter
	Weight uint           `json:"weight"`
	Key    base.Publickey `json:"key"`
}

type KeyJSONUnmarshaler

type KeyJSONUnmarshaler struct {
	Hint   hint.Hint `json:"_hint"`
	Weight uint      `json:"weight"`
	Key    string    `json:"key"`
}

type KeyUpdater

type KeyUpdater struct {
	BaseOperation
}

func NewKeyUpdater

func NewKeyUpdater(fact KeyUpdaterFact) (KeyUpdater, error)

func (*KeyUpdater) DecodeBSON

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

func (*KeyUpdater) DecodeJSON

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

func (*KeyUpdater) HashSign

func (op *KeyUpdater) HashSign(priv base.Privatekey, networkID base.NetworkID) error

func (KeyUpdater) MarshalBSON

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

func (KeyUpdater) MarshalJSON

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

func (KeyUpdater) Process

type KeyUpdaterFact

type KeyUpdaterFact struct {
	base.BaseFact
	// 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) DecodeBSON

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

func (*KeyUpdaterFact) DecodeJSON

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

func (KeyUpdaterFact) GenerateHash

func (fact KeyUpdaterFact) GenerateHash() util.Hash

func (KeyUpdaterFact) Hash

func (fact KeyUpdaterFact) Hash() util.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) Rebuild

func (fact KeyUpdaterFact) Rebuild() KeyUpdaterFact

func (KeyUpdaterFact) Target

func (fact KeyUpdaterFact) Target() base.Address

func (KeyUpdaterFact) Token

func (fact KeyUpdaterFact) Token() base.Token

type KeyUpdaterFactBSONUnmarshaler

type KeyUpdaterFactBSONUnmarshaler struct {
	Hint     string   `bson:"_hint"`
	Target   string   `bson:"target"`
	Keys     bson.Raw `bson:"keys"`
	Currency string   `bson:"currency"`
}

type KeyUpdaterFactJSONMarshaler

type KeyUpdaterFactJSONMarshaler struct {
	base.BaseFactJSONMarshaler
	Target   base.Address `json:"target"`
	Keys     AccountKeys  `json:"keys"`
	Currency CurrencyID   `json:"currency"`
}

type KeyUpdaterFactJSONUnMarshaler

type KeyUpdaterFactJSONUnMarshaler struct {
	base.BaseFactJSONUnmarshaler
	Target   string          `json:"target"`
	Keys     json.RawMessage `json:"keys"`
	Currency string          `json:"currency"`
}

type KeyUpdaterProcessor

type KeyUpdaterProcessor struct {
	*base.BaseOperationProcessor
	// contains filtered or unexported fields
}

func (*KeyUpdaterProcessor) Close

func (opp *KeyUpdaterProcessor) Close() error

func (*KeyUpdaterProcessor) PreProcess

func (*KeyUpdaterProcessor) Process

type KeysBSONUnmarshaler

type KeysBSONUnmarshaler struct {
	Hint      string   `bson:"_hint"`
	Hash      string   `bson:"hash"`
	Keys      bson.Raw `bson:"keys"`
	Threshold uint     `bson:"threshold"`
}

type KeysJSONMarshaler

type KeysJSONMarshaler struct {
	hint.BaseHinter
	Hash      util.Hash    `json:"hash"`
	Keys      []AccountKey `json:"keys"`
	Threshold uint         `json:"threshold"`
}

type KeysJSONUnMarshaler

type KeysJSONUnMarshaler struct {
	Hint      hint.Hint             `json:"_hint"`
	Hash      valuehash.HashDecoder `json:"hash"`
	Keys      json.RawMessage       `json:"keys"`
	Threshold uint                  `json:"threshold"`
}

type MEPrivatekey

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

MEPrivatekey is the default privatekey of mitum, it is based on BTC Privatekey.

func LoadMEPrivatekey

func LoadMEPrivatekey(s string) (MEPrivatekey, error)

func NewMEPrivatekey

func NewMEPrivatekey() MEPrivatekey

func NewMEPrivatekeyFromSeed

func NewMEPrivatekeyFromSeed(s string) (MEPrivatekey, error)

func ParseMEPrivatekey

func ParseMEPrivatekey(s string) (MEPrivatekey, error)

func (MEPrivatekey) Bytes

func (k MEPrivatekey) Bytes() []byte

func (MEPrivatekey) Equal

func (k MEPrivatekey) Equal(b base.PKKey) bool

func (MEPrivatekey) IsValid

func (k MEPrivatekey) IsValid([]byte) error

func (MEPrivatekey) MarshalText

func (k MEPrivatekey) MarshalText() ([]byte, error)

func (MEPrivatekey) Publickey

func (k MEPrivatekey) Publickey() base.Publickey

func (MEPrivatekey) Sign

func (k MEPrivatekey) Sign(b []byte) (base.Signature, error)

func (MEPrivatekey) String

func (k MEPrivatekey) String() string

func (*MEPrivatekey) UnmarshalText

func (k *MEPrivatekey) UnmarshalText(b []byte) error

type MEPublickey

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

MEPublickey is the default publickey of mitum, it is based on BTC Privatekey.

func LoadMEPublickey

func LoadMEPublickey(s string) (MEPublickey, error)

func NewMEPublickey

func NewMEPublickey(k *ecdsa.PublicKey) MEPublickey

func ParseMEPublickey

func ParseMEPublickey(s string) (MEPublickey, error)

func (MEPublickey) Bytes

func (k MEPublickey) Bytes() []byte

func (MEPublickey) Equal

func (k MEPublickey) Equal(b base.PKKey) bool

func (MEPublickey) IsValid

func (k MEPublickey) IsValid([]byte) error

func (MEPublickey) MarshalText

func (k MEPublickey) MarshalText() ([]byte, error)

func (MEPublickey) String

func (k MEPublickey) String() string

func (*MEPublickey) UnmarshalText

func (k *MEPublickey) UnmarshalText(b []byte) error

func (MEPublickey) Verify

func (k MEPublickey) Verify(input []byte, sig base.Signature) error

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 {
	// id string
	sync.RWMutex
	*logging.Logging
	*base.BaseOperationProcessor

	GetStateFunc base.GetStateFunc
	CollectFee   func(*OperationProcessor, AddFee) error
	// contains filtered or unexported fields
}

func NewOperationProcessor

func NewOperationProcessor() *OperationProcessor

func (*OperationProcessor) Cancel

func (opr *OperationProcessor) Cancel() error

func (*OperationProcessor) Close

func (opr *OperationProcessor) Close() error

func (*OperationProcessor) New

func (opr *OperationProcessor) New(
	height base.Height,
	getStateFunc base.GetStateFunc,
	newPreProcessConstraintFunc base.NewOperationProcessorProcessFunc,
	newProcessConstraintFunc base.NewOperationProcessorProcessFunc) (*OperationProcessor, error)

func (*OperationProcessor) PreProcess

func (*OperationProcessor) Process

func (*OperationProcessor) SetProcessor

func (opr *OperationProcessor) SetProcessor(
	hint hint.Hint,
	newProcessor GetNewProcessor,
) (base.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) DecodeBSON

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

func (*RatioFeeer) DecodeJSON

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

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

type RatioFeeerBSONUnmarshaler

type RatioFeeerBSONUnmarshaler struct {
	Hint     string  `bson:"_hint"`
	Receiver string  `bson:"receiver"`
	Ratio    float64 `bson:"ratio"`
	Min      string  `bson:"min"`
	Max      string  `bson:"max"`
}

type RatioFeeerJSONMarshaler

type RatioFeeerJSONMarshaler struct {
	hint.BaseHinter
	Receiver base.Address `json:"receiver"`
	Ratio    float64      `json:"ratio"`
	Min      string       `json:"min"`
	Max      string       `json:"max"`
}

type RatioFeeerJSONUnmarshaler

type RatioFeeerJSONUnmarshaler struct {
	Hint     hint.Hint `json:"_hint"`
	Receiver string    `json:"receiver"`
	Ratio    float64   `json:"ratio"`
	Min      string    `json:"min"`
	Max      string    `json:"max"`
}

type StringAddress

type StringAddress struct {
	BaseStringAddress
}

func NewStringAddress

func NewStringAddress(s string) StringAddress

func ParseStringAddress

func ParseStringAddress(s string) (StringAddress, error)

func (StringAddress) IsValid

func (ad StringAddress) IsValid([]byte) error

func (StringAddress) MarshalBSONValue

func (ad StringAddress) MarshalBSONValue() (bsontype.Type, []byte, error)

func (*StringAddress) UnmarshalText

func (ad *StringAddress) UnmarshalText(b []byte) error

type SuffrageInflation

type SuffrageInflation struct {
	BaseNodeOperation
}

func NewSuffrageInflation

func NewSuffrageInflation(
	fact SuffrageInflationFact,
) (SuffrageInflation, error)

func (*SuffrageInflation) DecodeBSON

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

func (*SuffrageInflation) DecodeJSON

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

func (SuffrageInflation) Process

type SuffrageInflationFact

type SuffrageInflationFact struct {
	base.BaseFact
	// contains filtered or unexported fields
}

func NewSuffrageInflationFact

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

func (SuffrageInflationFact) Bytes

func (fact SuffrageInflationFact) Bytes() []byte

func (*SuffrageInflationFact) DecodeBSON

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

func (*SuffrageInflationFact) DecodeJSON

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

func (SuffrageInflationFact) GenerateHash

func (fact SuffrageInflationFact) GenerateHash() util.Hash

func (SuffrageInflationFact) Hash

func (fact SuffrageInflationFact) Hash() util.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() base.Token

type SuffrageInflationFactBSONUnmarshaler

type SuffrageInflationFactBSONUnmarshaler struct {
	Hint  string     `bson:"_hint"`
	Items []bson.Raw `bson:"items"`
}

type SuffrageInflationFactJSONMarshaler

type SuffrageInflationFactJSONMarshaler struct {
	base.BaseFactJSONMarshaler
	Items []SuffrageInflationItem `json:"items"`
}

type SuffrageInflationFactJSONUnmarshaler

type SuffrageInflationFactJSONUnmarshaler struct {
	base.BaseFactJSONUnmarshaler
	Items []json.RawMessage `json:"items"`
}

type SuffrageInflationItem

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

func NewSuffrageInflationItem

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

func (SuffrageInflationItem) Amount

func (it SuffrageInflationItem) Amount() Amount

func (SuffrageInflationItem) Bytes

func (it SuffrageInflationItem) Bytes() []byte

func (*SuffrageInflationItem) DecodeBSON

func (it *SuffrageInflationItem) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*SuffrageInflationItem) DecodeJSON

func (it *SuffrageInflationItem) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (SuffrageInflationItem) IsValid

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

func (SuffrageInflationItem) MarshalBSON

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

func (SuffrageInflationItem) MarshalJSON

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

func (SuffrageInflationItem) Receiver

func (it SuffrageInflationItem) Receiver() base.Address

type SuffrageInflationItemBSONUnmarshaler

type SuffrageInflationItemBSONUnmarshaler struct {
	Hint     string   `bson:"_hint"`
	Receiver string   `bson:"receiver"`
	Amount   bson.Raw `bson:"amount"`
}

type SuffrageInflationItemJSONMarshaler

type SuffrageInflationItemJSONMarshaler struct {
	hint.BaseHinter
	Receiver base.Address `json:"receiver"`
	Amount   Amount       `json:"amount"`
}

type SuffrageInflationItemJSONUnmarshaler

type SuffrageInflationItemJSONUnmarshaler struct {
	HT       hint.Hint       `json:"_hint"`
	Receiver string          `json:"receiver"`
	Amount   json.RawMessage `json:"amount"`
}

type SuffrageInflationProcessor

type SuffrageInflationProcessor struct {
	*base.BaseOperationProcessor
	// contains filtered or unexported fields
}

func (*SuffrageInflationProcessor) Close

func (opp *SuffrageInflationProcessor) Close() error

func (*SuffrageInflationProcessor) PreProcess

func (*SuffrageInflationProcessor) Process

type TransferFactJSONMarshaler

type TransferFactJSONMarshaler struct {
	base.BaseFactJSONMarshaler
	Sender base.Address    `json:"sender"`
	Items  []TransfersItem `json:"items"`
}

type Transfers

type Transfers struct {
	BaseOperation
}

func NewTransfers

func NewTransfers(fact TransfersFact) (Transfers, error)

func (*Transfers) DecodeBSON

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

func (*Transfers) DecodeJSON

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

func (*Transfers) HashSign

func (op *Transfers) HashSign(priv base.Privatekey, networkID base.NetworkID) error

func (Transfers) MarshalBSON

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

func (Transfers) MarshalJSON

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

func (Transfers) Process

type TransfersFact

type TransfersFact struct {
	base.BaseFact
	// 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) DecodeBSON

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

func (*TransfersFact) DecodeJSON

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

func (TransfersFact) GenerateHash

func (fact TransfersFact) GenerateHash() util.Hash

func (TransfersFact) Hash

func (fact TransfersFact) Hash() util.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() base.Token

type TransfersFactBSONUnmarshaler

type TransfersFactBSONUnmarshaler struct {
	Hint   string   `bson:"_hint"`
	Sender string   `bson:"sender"`
	Items  bson.Raw `bson:"items"`
}

type TransfersFactJSONUnmarshaler

type TransfersFactJSONUnmarshaler struct {
	base.BaseFactJSONUnmarshaler
	Sender string          `json:"sender"`
	Items  json.RawMessage `json:"items"`
}

type TransfersItem

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

type TransfersItemBSONUnmarshaler

type TransfersItemBSONUnmarshaler struct {
	Hint     string   `bson:"_hint"`
	Receiver string   `bson:"receiver"`
	Amounts  bson.Raw `bson:"amounts"`
}

type TransfersItemJSONPacker

type TransfersItemJSONPacker struct {
	hint.BaseHinter
	Receiver base.Address `json:"receiver"`
	Amounts  []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(
	ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc,
) error

func (*TransfersItemProcessor) Process

func (opp *TransfersItemProcessor) Process(
	ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc,
) ([]base.StateMergeValue, 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 {
	*base.BaseOperationProcessor
	// contains filtered or unexported fields
}

func (*TransfersProcessor) Close

func (opp *TransfersProcessor) Close() error

func (*TransfersProcessor) PreProcess

func (*TransfersProcessor) Process

Source Files

Jump to

Keyboard shortcuts

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