Documentation ¶
Index ¶
- Variables
- func DefineHashedType(Name string) uint16
- func EncodeTransaction(ChainID uint8, t uint16, tx Transaction) ([]byte, error)
- func HashTransaction(ChainID uint8, tx Transaction) hash.Hash256
- func HashTransactionByType(ChainID uint8, t uint16, tx Transaction) hash.Hash256
- func IsAllowedAccountName(Name string) bool
- func MarshalID(height uint32, index uint16, n uint16) uint64
- func NameOfHashedType(t uint16) string
- func ParseTransactionID(TXID string) (uint32, uint16, error)
- func ToTimeSlot(timestamp uint64) uint32
- func TransactionID(Height uint32, Index uint16) string
- func UnmarshalID(id uint64) (uint32, uint16, uint16)
- type Account
- type AddressAccountMap
- func (sm *AddressAccountMap) Delete(addr common.Address)
- func (sm *AddressAccountMap) EachAll(fn func(common.Address, Account) bool)
- func (sm *AddressAccountMap) Get(addr common.Address) (Account, bool)
- func (sm *AddressAccountMap) Has(addr common.Address) bool
- func (sm *AddressAccountMap) Len() int
- func (sm *AddressAccountMap) MarshalJSON() ([]byte, error)
- func (sm *AddressAccountMap) Put(addr common.Address, acc Account)
- type AddressAddressAmountMap
- func (sm *AddressAddressAmountMap) Delete(addr common.Address)
- func (sm *AddressAddressAmountMap) EachAll(fn func(common.Address, *AddressAmountMap) bool)
- func (sm *AddressAddressAmountMap) Get(addr common.Address) (*AddressAmountMap, bool)
- func (sm *AddressAddressAmountMap) Has(addr common.Address) bool
- func (sm *AddressAddressAmountMap) Len() int
- func (sm *AddressAddressAmountMap) MarshalJSON() ([]byte, error)
- func (sm *AddressAddressAmountMap) Put(addr common.Address, am *AddressAmountMap)
- type AddressAddressMap
- func (sm *AddressAddressMap) Delete(addr common.Address)
- func (sm *AddressAddressMap) EachAll(fn func(common.Address, common.Address) bool)
- func (sm *AddressAddressMap) Get(addr common.Address) (common.Address, bool)
- func (sm *AddressAddressMap) Has(addr common.Address) bool
- func (sm *AddressAddressMap) Len() int
- func (sm *AddressAddressMap) MarshalJSON() ([]byte, error)
- func (sm *AddressAddressMap) Put(addr common.Address, am common.Address)
- type AddressAmountMap
- func (sm *AddressAmountMap) Delete(addr common.Address)
- func (sm *AddressAmountMap) EachAll(fn func(common.Address, *amount.Amount) bool)
- func (sm *AddressAmountMap) Get(addr common.Address) (*amount.Amount, bool)
- func (sm *AddressAmountMap) Has(addr common.Address) bool
- func (sm *AddressAmountMap) Len() int
- func (sm *AddressAmountMap) MarshalJSON() ([]byte, error)
- func (sm *AddressAmountMap) Put(addr common.Address, am *amount.Amount)
- type AddressBoolMap
- func (sm *AddressBoolMap) Delete(addr common.Address)
- func (sm *AddressBoolMap) EachAll(fn func(common.Address, bool) bool)
- func (sm *AddressBoolMap) Get(addr common.Address) (bool, bool)
- func (sm *AddressBoolMap) Has(addr common.Address) bool
- func (sm *AddressBoolMap) Len() int
- func (sm *AddressBoolMap) MarshalJSON() ([]byte, error)
- func (sm *AddressBoolMap) Put(addr common.Address, value bool)
- type AddressUint32Map
- func (sm *AddressUint32Map) Delete(addr common.Address)
- func (sm *AddressUint32Map) EachAll(fn func(common.Address, uint32) bool)
- func (sm *AddressUint32Map) Get(addr common.Address) (uint32, bool)
- func (sm *AddressUint32Map) Has(addr common.Address) bool
- func (sm *AddressUint32Map) Len() int
- func (sm *AddressUint32Map) MarshalJSON() ([]byte, error)
- func (sm *AddressUint32Map) Put(addr common.Address, value uint32)
- type AddressUint64Map
- func (sm *AddressUint64Map) Delete(addr common.Address)
- func (sm *AddressUint64Map) EachAll(fn func(common.Address, uint64) bool)
- func (sm *AddressUint64Map) Get(addr common.Address) (uint64, bool)
- func (sm *AddressUint64Map) Has(addr common.Address) bool
- func (sm *AddressUint64Map) Len() int
- func (sm *AddressUint64Map) MarshalJSON() ([]byte, error)
- func (sm *AddressUint64Map) Put(addr common.Address, value uint64)
- type Application
- type ApplicationBase
- func (app *ApplicationBase) AfterExecuteTransactions(b *Block, ctw *ContextWrapper) error
- func (app *ApplicationBase) BeforeExecuteTransactions(ctw *ContextWrapper) error
- func (app *ApplicationBase) ID() uint8
- func (app *ApplicationBase) InitGenesis(ctw *ContextWrapper) error
- func (app *ApplicationBase) OnLoadChain(loader LoaderWrapper) error
- func (app *ApplicationBase) OnSaveData(b *Block, ctw *ContextWrapper) error
- type Block
- type BlockSign
- type Context
- func (ctx *Context) Account(addr common.Address) (Account, error)
- func (ctx *Context) AccountData(addr common.Address, pid uint8, name []byte) []byte
- func (ctx *Context) AddressByName(Name string) (common.Address, error)
- func (ctx *Context) ChainID() uint8
- func (ctx *Context) Commit(sn int)
- func (ctx *Context) CreateAccount(acc Account) error
- func (ctx *Context) CreateAccountIgnoreDelete(acc Account) error
- func (ctx *Context) CreateUTXO(id uint64, vout *TxOut) error
- func (ctx *Context) DeleteAccount(acc Account) error
- func (ctx *Context) DeleteUTXO(utxo *UTXO) error
- func (ctx *Context) Dump() string
- func (ctx *Context) EmitEvent(e Event) error
- func (ctx *Context) HasAccount(addr common.Address) (bool, error)
- func (ctx *Context) HasAccountName(Name string) (bool, error)
- func (ctx *Context) HasTimeSlot(slot uint32, key string) bool
- func (ctx *Context) HasUTXO(id uint64) (bool, error)
- func (ctx *Context) Hash() hash.Hash256
- func (ctx *Context) LastHash() hash.Hash256
- func (ctx *Context) LastStatus() (uint32, hash.Hash256)
- func (ctx *Context) LastTimestamp() uint64
- func (ctx *Context) Name() string
- func (ctx *Context) NextContext(NextHash hash.Hash256, Timestamp uint64) *Context
- func (ctx *Context) ProcessData(pid uint8, name []byte) []byte
- func (ctx *Context) Revert(sn int)
- func (ctx *Context) SetAccountData(addr common.Address, pid uint8, name []byte, value []byte)
- func (ctx *Context) SetProcessData(pid uint8, name []byte, value []byte)
- func (ctx *Context) Snapshot() int
- func (ctx *Context) StackSize() int
- func (ctx *Context) TargetHeight() uint32
- func (ctx *Context) Top() *ContextData
- func (ctx *Context) UTXO(id uint64) (*UTXO, error)
- func (ctx *Context) UseTimeSlot(slot uint32, key string) error
- func (ctx *Context) Version() uint16
- type ContextData
- func (ctd *ContextData) Account(addr common.Address) (Account, error)
- func (ctd *ContextData) AccountData(addr common.Address, pid uint8, name []byte) []byte
- func (ctd *ContextData) AddressByName(Name string) (common.Address, error)
- func (ctd *ContextData) CreateAccount(acc Account) error
- func (ctd *ContextData) CreateAccountIgnoreDelete(acc Account) error
- func (ctd *ContextData) CreateUTXO(id uint64, vout *TxOut) error
- func (ctd *ContextData) DeleteAccount(acc Account) error
- func (ctd *ContextData) DeleteUTXO(utxo *UTXO) error
- func (ctd *ContextData) Dump() string
- func (ctd *ContextData) EmitEvent(e Event) error
- func (ctd *ContextData) HasAccount(addr common.Address) (bool, error)
- func (ctd *ContextData) HasAccountName(Name string) (bool, error)
- func (ctd *ContextData) HasTimeSlot(slot uint32, key string) bool
- func (ctd *ContextData) HasUTXO(id uint64) (bool, error)
- func (ctd *ContextData) Hash() hash.Hash256
- func (ctd *ContextData) ProcessData(pid uint8, name []byte) []byte
- func (ctd *ContextData) SetAccountData(addr common.Address, pid uint8, name []byte, value []byte)
- func (ctd *ContextData) SetProcessData(pid uint8, name []byte, value []byte)
- func (ctd *ContextData) UTXO(id uint64) (*UTXO, error)
- func (ctd *ContextData) UseTimeSlot(slot uint32, key string) error
- type ContextWrapper
- func (ctw *ContextWrapper) Account(addr common.Address) (Account, error)
- func (ctw *ContextWrapper) AccountData(addr common.Address, name []byte) []byte
- func (ctw *ContextWrapper) AddressByName(Name string) (common.Address, error)
- func (ctw *ContextWrapper) ChainID() uint8
- func (ctw *ContextWrapper) Commit(sn int)
- func (ctw *ContextWrapper) CreateAccount(acc Account) error
- func (ctw *ContextWrapper) CreateAccountIgnoreDelete(acc Account) error
- func (ctw *ContextWrapper) CreateUTXO(id uint64, vout *TxOut) error
- func (ctw *ContextWrapper) DeleteAccount(acc Account) error
- func (ctw *ContextWrapper) DeleteUTXO(utxo *UTXO) error
- func (ctw *ContextWrapper) Dump() string
- func (ctw *ContextWrapper) EmitEvent(e Event) error
- func (ctw *ContextWrapper) HasAccount(addr common.Address) (bool, error)
- func (ctw *ContextWrapper) HasAccountName(Name string) (bool, error)
- func (ctw *ContextWrapper) HasTimeSlot(slot uint32, key string) bool
- func (ctw *ContextWrapper) HasUTXO(id uint64) (bool, error)
- func (ctw *ContextWrapper) Hash() hash.Hash256
- func (ctw *ContextWrapper) LastHash() hash.Hash256
- func (ctw *ContextWrapper) LastStatus() (uint32, hash.Hash256)
- func (ctw *ContextWrapper) LastTimestamp() uint64
- func (ctw *ContextWrapper) Name() string
- func (ctw *ContextWrapper) ProcessData(name []byte) []byte
- func (ctw *ContextWrapper) Revert(sn int)
- func (ctw *ContextWrapper) SetAccountData(addr common.Address, name []byte, value []byte)
- func (ctw *ContextWrapper) SetProcessData(name []byte, value []byte)
- func (ctw *ContextWrapper) Snapshot() int
- func (ctw *ContextWrapper) StackSize() int
- func (ctw *ContextWrapper) Switch(pid uint8) *ContextWrapper
- func (ctw *ContextWrapper) TargetHeight() uint32
- func (ctw *ContextWrapper) Top() *ContextData
- func (ctw *ContextWrapper) UTXO(id uint64) (*UTXO, error)
- func (ctw *ContextWrapper) Version() uint16
- type Event
- type Header
- type Loader
- type LoaderWrapper
- type Process
- type ProcessBase
- func (p *ProcessBase) AfterExecuteTransactions(b *Block, ctw *ContextWrapper) error
- func (p *ProcessBase) BeforeExecuteTransactions(ctw *ContextWrapper) error
- func (p *ProcessBase) InitGenesis(ctw *ContextWrapper) error
- func (p *ProcessBase) OnLoadChain(loader LoaderWrapper) error
- func (p *ProcessBase) OnSaveData(b *Block, ctw *ContextWrapper) error
- type ProcessManager
- type Provider
- type PublicHashBoolMap
- func (sm *PublicHashBoolMap) Delete(pubhash common.PublicHash)
- func (sm *PublicHashBoolMap) EachAll(fn func(common.PublicHash, bool) bool)
- func (sm *PublicHashBoolMap) Get(pubhash common.PublicHash) (bool, bool)
- func (sm *PublicHashBoolMap) Has(pubhash common.PublicHash) bool
- func (sm *PublicHashBoolMap) Len() int
- func (sm *PublicHashBoolMap) MarshalJSON() ([]byte, error)
- func (sm *PublicHashBoolMap) Put(pubhash common.PublicHash, value bool)
- type Register
- type Service
- type ServiceBase
- type StringAddressMap
- func (sm *StringAddressMap) Delete(key string)
- func (sm *StringAddressMap) EachAll(fn func(string, common.Address) bool)
- func (sm *StringAddressMap) EachPrefix(prefix string, fn func(string, common.Address) bool)
- func (sm *StringAddressMap) Get(key string) (common.Address, bool)
- func (sm *StringAddressMap) Has(key string) bool
- func (sm *StringAddressMap) Len() int
- func (sm *StringAddressMap) MarshalJSON() ([]byte, error)
- func (sm *StringAddressMap) Put(key string, addr common.Address)
- type StringBoolMap
- func (sm *StringBoolMap) Delete(key string)
- func (sm *StringBoolMap) EachAll(fn func(string, bool) bool)
- func (sm *StringBoolMap) EachPrefix(prefix string, fn func(string, bool) bool)
- func (sm *StringBoolMap) Get(key string) (bool, bool)
- func (sm *StringBoolMap) Has(key string) bool
- func (sm *StringBoolMap) Len() int
- func (sm *StringBoolMap) MarshalJSON() ([]byte, error)
- func (sm *StringBoolMap) Put(key string, value bool)
- type StringBytesMap
- func (sm *StringBytesMap) Delete(key string)
- func (sm *StringBytesMap) EachAll(fn func(string, []byte) bool)
- func (sm *StringBytesMap) EachPrefix(prefix string, fn func(string, []byte) bool)
- func (sm *StringBytesMap) Get(key string) ([]byte, bool)
- func (sm *StringBytesMap) Has(key string) bool
- func (sm *StringBytesMap) Len() int
- func (sm *StringBytesMap) Put(key string, value []byte)
- type StringStringMap
- func (sm *StringStringMap) Delete(key string)
- func (sm *StringStringMap) EachAll(fn func(string, string) bool)
- func (sm *StringStringMap) EachPrefix(prefix string, fn func(string, string) bool)
- func (sm *StringStringMap) Get(key string) (string, bool)
- func (sm *StringStringMap) Has(key string) bool
- func (sm *StringStringMap) Len() int
- func (sm *StringStringMap) MarshalJSON() ([]byte, error)
- func (sm *StringStringMap) Put(key string, value string)
- type Transaction
- type TransactionSign
- type TxIn
- type TxOut
- type UTXO
- type Uint32StringBoolMap
- func (sm *Uint32StringBoolMap) Delete(key uint32)
- func (sm *Uint32StringBoolMap) EachAll(fn func(uint32, *StringBoolMap) bool)
- func (sm *Uint32StringBoolMap) Get(key uint32) (*StringBoolMap, bool)
- func (sm *Uint32StringBoolMap) Has(key uint32) bool
- func (sm *Uint32StringBoolMap) Len() int
- func (sm *Uint32StringBoolMap) Put(key uint32, StringBoolMap *StringBoolMap)
- type Uint64BoolMap
- func (sm *Uint64BoolMap) Delete(key uint64)
- func (sm *Uint64BoolMap) EachAll(fn func(uint64, bool) bool)
- func (sm *Uint64BoolMap) Get(key uint64) (bool, bool)
- func (sm *Uint64BoolMap) Has(key uint64) bool
- func (sm *Uint64BoolMap) Len() int
- func (sm *Uint64BoolMap) MarshalJSON() ([]byte, error)
- func (sm *Uint64BoolMap) Put(key uint64, value bool)
- type Uint64TxOutMap
- func (sm *Uint64TxOutMap) Delete(key uint64)
- func (sm *Uint64TxOutMap) EachAll(fn func(uint64, *TxOut) bool)
- func (sm *Uint64TxOutMap) Get(key uint64) (*TxOut, bool)
- func (sm *Uint64TxOutMap) Has(key uint64) bool
- func (sm *Uint64TxOutMap) Len() int
- func (sm *Uint64TxOutMap) MarshalJSON() ([]byte, error)
- func (sm *Uint64TxOutMap) Put(key uint64, vout *TxOut)
- type Uint64UTXOMap
- func (sm *Uint64UTXOMap) Delete(key uint64)
- func (sm *Uint64UTXOMap) EachAll(fn func(uint64, *UTXO) bool)
- func (sm *Uint64UTXOMap) Get(key uint64) (*UTXO, bool)
- func (sm *Uint64UTXOMap) Has(key uint64) bool
- func (sm *Uint64UTXOMap) Len() int
- func (sm *Uint64UTXOMap) MarshalJSON() ([]byte, error)
- func (sm *Uint64UTXOMap) Put(key uint64, utxo *UTXO)
- type Uint8StringBytesMap
- func (sm *Uint8StringBytesMap) Delete(key uint8)
- func (sm *Uint8StringBytesMap) EachAll(fn func(uint8, *StringBytesMap) bool)
- func (sm *Uint8StringBytesMap) Get(key uint8) (*StringBytesMap, bool)
- func (sm *Uint8StringBytesMap) Has(key uint8) bool
- func (sm *Uint8StringBytesMap) Len() int
- func (sm *Uint8StringBytesMap) Put(key uint8, StringBytesMap *StringBytesMap)
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidAccountName = errors.New("invalid account name") ErrInvalidAccountType = errors.New("invalid account type") ErrExistAddress = errors.New("exist address") ErrExistAccount = errors.New("exist account") ErrExistAccountName = errors.New("exist account name") ErrNotExistAccount = errors.New("not exist account") ErrDeletedAccount = errors.New("deleted account") ErrInvalidProcess = errors.New("invalid process") ErrExistProcessName = errors.New("exist process name") ErrExistProcessID = errors.New("exist process id") ErrNotExistProcess = errors.New("not exist process") ErrExistUTXO = errors.New("exist utxo") ErrNotExistUTXO = errors.New("not exist utxo") ErrUsedUTXO = errors.New("used utxo") ErrInvalidTransactionCount = errors.New("invalid transaction count") ErrNotAllowedEmptyAddressAccount = errors.New("not allowed empty address account") ErrNotAllowedAddressAccountName = errors.New("not allowed address account name") ErrInvalidAddressHeight = errors.New("invalid address height") ErrInvalidSignerCount = errors.New("invalid signer count") ErrInvalidAccountSigner = errors.New("invalid account signer") ErrInvalidUTXOSigner = errors.New("invalid utxo signer") ErrInvalidTxInCount = errors.New("invalid tx in count") ErrInvalidOutputAmount = errors.New("invalid output amount") ErrDustAmount = errors.New("dust amount") ErrInvalidTransactionIDFormat = errors.New("invalid transaction id format") ErrUsedTimeSlot = errors.New("used timeslot") ErrInvalidTransactionTimeSlot = errors.New("invalid transaction timeslot") )
transaction errors
Functions ¶
func DefineHashedType ¶
DefineHashedType is return string hashed type
func EncodeTransaction ¶
func EncodeTransaction(ChainID uint8, t uint16, tx Transaction) ([]byte, error)
EncodeTransaction returns the encoded transaction
func HashTransaction ¶
func HashTransaction(ChainID uint8, tx Transaction) hash.Hash256
HashTransaction returns the hash of the transaction
func HashTransactionByType ¶
func HashTransactionByType(ChainID uint8, t uint16, tx Transaction) hash.Hash256
HashTransactionByType returns the hash of the transaction using the type
func IsAllowedAccountName ¶
IsAllowedAccountName returns it is allowed account name or not
func NameOfHashedType ¶
NameOfHashedType returns the name of the hashed type
func ParseTransactionID ¶
ParseTransactionID returns the id of the transaction
func ToTimeSlot ¶
ToTimeSlot returns the timeslot of the timestamp
func TransactionID ¶
TransactionID returns the id of the transaction
Types ¶
type Account ¶
type Account interface { json.Marshaler Address() common.Address Name() string Clone() Account Validate(loader LoaderWrapper, signers []common.PublicHash) error }
Account defines common account functions
type AddressAccountMap ¶
type AddressAccountMap struct {
// contains filtered or unexported fields
}
AddressAccountMap address and account map
func NewAddressAccountMap ¶
func NewAddressAccountMap() *AddressAccountMap
NewAddressAccountMap returns a AddressAccountMap
func (*AddressAccountMap) Delete ¶
func (sm *AddressAccountMap) Delete(addr common.Address)
Delete removes data of the key
func (*AddressAccountMap) EachAll ¶
func (sm *AddressAccountMap) EachAll(fn func(common.Address, Account) bool)
EachAll iterates all elements
func (*AddressAccountMap) Get ¶
func (sm *AddressAccountMap) Get(addr common.Address) (Account, bool)
Get returns data of the key
func (*AddressAccountMap) Has ¶
func (sm *AddressAccountMap) Has(addr common.Address) bool
Has returns data of the key is exist or not
func (*AddressAccountMap) Len ¶
func (sm *AddressAccountMap) Len() int
Len returns the length of the map
func (*AddressAccountMap) MarshalJSON ¶
func (sm *AddressAccountMap) MarshalJSON() ([]byte, error)
MarshalJSON is a marshaler function
type AddressAddressAmountMap ¶
type AddressAddressAmountMap struct {
// contains filtered or unexported fields
}
AddressAddressAmountMap address and AddressAmountMap map
func NewAddressAddressAmountMap ¶
func NewAddressAddressAmountMap() *AddressAddressAmountMap
NewAddressAddressAmountMap returns a AddressAddressAmountMap
func (*AddressAddressAmountMap) Delete ¶
func (sm *AddressAddressAmountMap) Delete(addr common.Address)
Delete removes data of the key
func (*AddressAddressAmountMap) EachAll ¶
func (sm *AddressAddressAmountMap) EachAll(fn func(common.Address, *AddressAmountMap) bool)
EachAll iterates all elements
func (*AddressAddressAmountMap) Get ¶
func (sm *AddressAddressAmountMap) Get(addr common.Address) (*AddressAmountMap, bool)
Get returns data of the key
func (*AddressAddressAmountMap) Has ¶
func (sm *AddressAddressAmountMap) Has(addr common.Address) bool
Has returns data of the key is exist or not
func (*AddressAddressAmountMap) Len ¶
func (sm *AddressAddressAmountMap) Len() int
Len returns the length of the map
func (*AddressAddressAmountMap) MarshalJSON ¶
func (sm *AddressAddressAmountMap) MarshalJSON() ([]byte, error)
MarshalJSON is a marshaler function
func (*AddressAddressAmountMap) Put ¶
func (sm *AddressAddressAmountMap) Put(addr common.Address, am *AddressAmountMap)
Put adds data of the key
type AddressAddressMap ¶
type AddressAddressMap struct {
// contains filtered or unexported fields
}
AddressAddressMap address and Amount map
func NewAddressAddressMap ¶
func NewAddressAddressMap() *AddressAddressMap
NewAddressAddressMap returns a AddressAddressMap
func (*AddressAddressMap) Delete ¶
func (sm *AddressAddressMap) Delete(addr common.Address)
Delete removes data of the key
func (*AddressAddressMap) Has ¶
func (sm *AddressAddressMap) Has(addr common.Address) bool
Has returns data of the key is exist or not
func (*AddressAddressMap) Len ¶
func (sm *AddressAddressMap) Len() int
Len returns the length of the map
func (*AddressAddressMap) MarshalJSON ¶
func (sm *AddressAddressMap) MarshalJSON() ([]byte, error)
MarshalJSON is a marshaler function
type AddressAmountMap ¶
type AddressAmountMap struct {
// contains filtered or unexported fields
}
AddressAmountMap address and Amount map
func NewAddressAmountMap ¶
func NewAddressAmountMap() *AddressAmountMap
NewAddressAmountMap returns a AddressAmountMap
func (*AddressAmountMap) Delete ¶
func (sm *AddressAmountMap) Delete(addr common.Address)
Delete removes data of the key
func (*AddressAmountMap) Has ¶
func (sm *AddressAmountMap) Has(addr common.Address) bool
Has returns data of the key is exist or not
func (*AddressAmountMap) Len ¶
func (sm *AddressAmountMap) Len() int
Len returns the length of the map
func (*AddressAmountMap) MarshalJSON ¶
func (sm *AddressAmountMap) MarshalJSON() ([]byte, error)
MarshalJSON is a marshaler function
type AddressBoolMap ¶
type AddressBoolMap struct {
// contains filtered or unexported fields
}
AddressBoolMap address and bool map
func NewAddressBoolMap ¶
func NewAddressBoolMap() *AddressBoolMap
NewAddressBoolMap returns a AddressBoolMap
func (*AddressBoolMap) Delete ¶
func (sm *AddressBoolMap) Delete(addr common.Address)
Delete removes data of the key
func (*AddressBoolMap) EachAll ¶
func (sm *AddressBoolMap) EachAll(fn func(common.Address, bool) bool)
EachAll iterates all elements
func (*AddressBoolMap) Get ¶
func (sm *AddressBoolMap) Get(addr common.Address) (bool, bool)
Get returns data of the key
func (*AddressBoolMap) Has ¶
func (sm *AddressBoolMap) Has(addr common.Address) bool
Has returns data of the key is exist or not
func (*AddressBoolMap) MarshalJSON ¶
func (sm *AddressBoolMap) MarshalJSON() ([]byte, error)
MarshalJSON is a marshaler function
type AddressUint32Map ¶
type AddressUint32Map struct {
// contains filtered or unexported fields
}
AddressUint32Map address and uint32 map
func NewAddressUint32Map ¶
func NewAddressUint32Map() *AddressUint32Map
NewAddressUint32Map returns a AddressUint32Map
func (*AddressUint32Map) Delete ¶
func (sm *AddressUint32Map) Delete(addr common.Address)
Delete removes data of the key
func (*AddressUint32Map) EachAll ¶
func (sm *AddressUint32Map) EachAll(fn func(common.Address, uint32) bool)
EachAll iterates all elements
func (*AddressUint32Map) Get ¶
func (sm *AddressUint32Map) Get(addr common.Address) (uint32, bool)
Get returns data of the key
func (*AddressUint32Map) Has ¶
func (sm *AddressUint32Map) Has(addr common.Address) bool
Has returns data of the key is exist or not
func (*AddressUint32Map) Len ¶
func (sm *AddressUint32Map) Len() int
Len returns the length of the map
func (*AddressUint32Map) MarshalJSON ¶
func (sm *AddressUint32Map) MarshalJSON() ([]byte, error)
MarshalJSON is a marshaler function
type AddressUint64Map ¶
type AddressUint64Map struct {
// contains filtered or unexported fields
}
AddressUint64Map address and uint64 map
func NewAddressUint64Map ¶
func NewAddressUint64Map() *AddressUint64Map
NewAddressUint64Map returns a AddressUint64Map
func (*AddressUint64Map) Delete ¶
func (sm *AddressUint64Map) Delete(addr common.Address)
Delete removes data of the key
func (*AddressUint64Map) EachAll ¶
func (sm *AddressUint64Map) EachAll(fn func(common.Address, uint64) bool)
EachAll iterates all elements
func (*AddressUint64Map) Get ¶
func (sm *AddressUint64Map) Get(addr common.Address) (uint64, bool)
Get returns data of the key
func (*AddressUint64Map) Has ¶
func (sm *AddressUint64Map) Has(addr common.Address) bool
Has returns data of the key is exist or not
func (*AddressUint64Map) Len ¶
func (sm *AddressUint64Map) Len() int
Len returns the length of the map
func (*AddressUint64Map) MarshalJSON ¶
func (sm *AddressUint64Map) MarshalJSON() ([]byte, error)
MarshalJSON is a marshaler function
type Application ¶
type Application interface { Process InitGenesis(ctw *ContextWrapper) error }
Application defines chain application functions
type ApplicationBase ¶
type ApplicationBase struct{}
ApplicationBase is a base handler of the chain process
func (*ApplicationBase) AfterExecuteTransactions ¶
func (app *ApplicationBase) AfterExecuteTransactions(b *Block, ctw *ContextWrapper) error
AfterExecuteTransactions called after processes transactions of the block
func (*ApplicationBase) BeforeExecuteTransactions ¶
func (app *ApplicationBase) BeforeExecuteTransactions(ctw *ContextWrapper) error
BeforeExecuteTransactions called before processes transactions of the block
func (*ApplicationBase) InitGenesis ¶
func (app *ApplicationBase) InitGenesis(ctw *ContextWrapper) error
InitGenesis initializes genesis data
func (*ApplicationBase) OnLoadChain ¶
func (app *ApplicationBase) OnLoadChain(loader LoaderWrapper) error
OnLoadChain called when the chain loaded
func (*ApplicationBase) OnSaveData ¶
func (app *ApplicationBase) OnSaveData(b *Block, ctw *ContextWrapper) error
OnSaveData called when the context of the block saved
type Block ¶
type Block struct { Header Header TransactionTypes []uint16 //MAXLEN : 65535 Transactions []Transaction //MAXLEN : 65535 TransactionSignatures [][]common.Signature //MAXLEN : 65535 Signatures []common.Signature //MAXLEN : 255 }
Block includes a block header and a block body
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context is an intermediate in-memory state using the context data stack between blocks
func (*Context) AccountData ¶
AccountData returns the account data from the top snapshot
func (*Context) AddressByName ¶
AddressByName returns the account address of the name
func (*Context) CreateAccount ¶
CreateAccount inserts the account to the top snapshot
func (*Context) CreateAccountIgnoreDelete ¶
CreateAccountIgnoreDelete inserts the account even account has deleted name
func (*Context) CreateUTXO ¶
CreateUTXO inserts the UTXO to the top snapshot
func (*Context) DeleteAccount ¶
DeleteAccount deletes the account from the top snapshot
func (*Context) DeleteUTXO ¶
DeleteUTXO deletes the UTXO from the top snapshot
func (*Context) HasAccount ¶
HasAccount checks that the account of the address is exist or not
func (*Context) HasAccountName ¶
HasAccountName checks that the account of the name is exist or not
func (*Context) HasTimeSlot ¶
HasTimeSlot returns timeslot is exist or not
func (*Context) LastStatus ¶
LastStatus returns the recored target height, prev hash and timestamp
func (*Context) LastTimestamp ¶
LastTimestamp returns the last timestamp of the chain
func (*Context) NextContext ¶
NextContext returns the next Context of the Context
func (*Context) ProcessData ¶
ProcessData returns the process data from the top snapshot
func (*Context) SetAccountData ¶
SetAccountData inserts the account data to the top snapshot
func (*Context) SetProcessData ¶
SetProcessData inserts the process data to the top snapshot
func (*Context) TargetHeight ¶
TargetHeight returns the recorded target height when context generation
func (*Context) UseTimeSlot ¶
UseTimeSlot consumes timeslot
type ContextData ¶
type ContextData struct { Parent *ContextData AccountMap *AddressAccountMap DeletedAccountMap *AddressAccountMap AccountNameMap *StringAddressMap AccountDataMap *StringBytesMap DeletedAccountDataMap *StringBoolMap ProcessDataMap *StringBytesMap DeletedProcessDataMap *StringBoolMap UTXOMap *Uint64UTXOMap CreatedUTXOMap *Uint64TxOutMap DeletedUTXOMap *Uint64UTXOMap Events []Event EventN uint16 TimeSlotMap *Uint32StringBoolMap // contains filtered or unexported fields }
ContextData is a state data of the context
func NewContextData ¶
func NewContextData(loader internalLoader, Parent *ContextData) *ContextData
NewContextData returns a ContextData
func (*ContextData) Account ¶
func (ctd *ContextData) Account(addr common.Address) (Account, error)
Account returns the account instance of the address
func (*ContextData) AccountData ¶
AccountData returns the account data
func (*ContextData) AddressByName ¶
func (ctd *ContextData) AddressByName(Name string) (common.Address, error)
AddressByName returns the account address of the name
func (*ContextData) CreateAccount ¶
func (ctd *ContextData) CreateAccount(acc Account) error
CreateAccount inserts the account
func (*ContextData) CreateAccountIgnoreDelete ¶
func (ctd *ContextData) CreateAccountIgnoreDelete(acc Account) error
CreateAccountIgnoreDelete inserts the account even account has deleted name
func (*ContextData) CreateUTXO ¶
func (ctd *ContextData) CreateUTXO(id uint64, vout *TxOut) error
CreateUTXO inserts the UTXO
func (*ContextData) DeleteAccount ¶
func (ctd *ContextData) DeleteAccount(acc Account) error
DeleteAccount deletes the account
func (*ContextData) DeleteUTXO ¶
func (ctd *ContextData) DeleteUTXO(utxo *UTXO) error
DeleteUTXO deletes the UTXO
func (*ContextData) EmitEvent ¶
func (ctd *ContextData) EmitEvent(e Event) error
EmitEvent creates the event to the top snapshot
func (*ContextData) HasAccount ¶
func (ctd *ContextData) HasAccount(addr common.Address) (bool, error)
HasAccount checks that the account of the address is exist or not
func (*ContextData) HasAccountName ¶
func (ctd *ContextData) HasAccountName(Name string) (bool, error)
HasAccountName checks that the account of the address is exist or not
func (*ContextData) HasTimeSlot ¶
func (ctd *ContextData) HasTimeSlot(slot uint32, key string) bool
HasTimeSlot returns timeslot is exist or not
func (*ContextData) HasUTXO ¶
func (ctd *ContextData) HasUTXO(id uint64) (bool, error)
HasUTXO checks that the utxo of the id is exist or not
func (*ContextData) Hash ¶
func (ctd *ContextData) Hash() hash.Hash256
Hash returns the hash value of it
func (*ContextData) ProcessData ¶
func (ctd *ContextData) ProcessData(pid uint8, name []byte) []byte
ProcessData returns the process data
func (*ContextData) SetAccountData ¶
SetAccountData inserts the account data
func (*ContextData) SetProcessData ¶
func (ctd *ContextData) SetProcessData(pid uint8, name []byte, value []byte)
SetProcessData inserts the process data
func (*ContextData) UTXO ¶
func (ctd *ContextData) UTXO(id uint64) (*UTXO, error)
UTXO returns the UTXO
func (*ContextData) UseTimeSlot ¶
func (ctd *ContextData) UseTimeSlot(slot uint32, key string) error
UseTimeSlot consumes timeslot
type ContextWrapper ¶
type ContextWrapper struct {
// contains filtered or unexported fields
}
ContextWrapper is an context for the process
func NewContextWrapper ¶
func NewContextWrapper(pid uint8, ctx *Context) *ContextWrapper
NewContextWrapper returns a ContextWrapper
func SwitchContextWrapper ¶
func SwitchContextWrapper(pid uint8, ctw *ContextWrapper) *ContextWrapper
SwitchContextWrapper returns a SwitchContextWrapper of the pid
func (*ContextWrapper) Account ¶
func (ctw *ContextWrapper) Account(addr common.Address) (Account, error)
Account returns the account instance of the address
func (*ContextWrapper) AccountData ¶
func (ctw *ContextWrapper) AccountData(addr common.Address, name []byte) []byte
AccountData returns the account data from the top snapshot
func (*ContextWrapper) AddressByName ¶
func (ctw *ContextWrapper) AddressByName(Name string) (common.Address, error)
AddressByName returns the account address of the name
func (*ContextWrapper) ChainID ¶
func (ctw *ContextWrapper) ChainID() uint8
ChainID returns the id of the chain
func (*ContextWrapper) Commit ¶
func (ctw *ContextWrapper) Commit(sn int)
Commit apply snapshots to the top after the snapshot number
func (*ContextWrapper) CreateAccount ¶
func (ctw *ContextWrapper) CreateAccount(acc Account) error
CreateAccount inserts the account to the top snapshot
func (*ContextWrapper) CreateAccountIgnoreDelete ¶
func (ctw *ContextWrapper) CreateAccountIgnoreDelete(acc Account) error
CreateAccountIgnoreDelete inserts the account even account has deleted name
func (*ContextWrapper) CreateUTXO ¶
func (ctw *ContextWrapper) CreateUTXO(id uint64, vout *TxOut) error
CreateUTXO inserts the UTXO to the top snapshot
func (*ContextWrapper) DeleteAccount ¶
func (ctw *ContextWrapper) DeleteAccount(acc Account) error
DeleteAccount deletes the account from the top snapshot
func (*ContextWrapper) DeleteUTXO ¶
func (ctw *ContextWrapper) DeleteUTXO(utxo *UTXO) error
DeleteUTXO deletes the UTXO from the top snapshot
func (*ContextWrapper) Dump ¶
func (ctw *ContextWrapper) Dump() string
Dump prints the top ContextWrapper data of the context
func (*ContextWrapper) EmitEvent ¶
func (ctw *ContextWrapper) EmitEvent(e Event) error
EmitEvent creates the event to the top snapshot
func (*ContextWrapper) HasAccount ¶
func (ctw *ContextWrapper) HasAccount(addr common.Address) (bool, error)
HasAccount checks that the account of the address is exist or not
func (*ContextWrapper) HasAccountName ¶
func (ctw *ContextWrapper) HasAccountName(Name string) (bool, error)
HasAccountName checks that the account of the name is exist or not
func (*ContextWrapper) HasTimeSlot ¶
func (ctw *ContextWrapper) HasTimeSlot(slot uint32, key string) bool
HasTimeSlot returns timeslot is exist or not
func (*ContextWrapper) HasUTXO ¶
func (ctw *ContextWrapper) HasUTXO(id uint64) (bool, error)
HasUTXO checks that the utxo of the id is exist or not
func (*ContextWrapper) Hash ¶
func (ctw *ContextWrapper) Hash() hash.Hash256
Hash returns the hash value of it
func (*ContextWrapper) LastHash ¶
func (ctw *ContextWrapper) LastHash() hash.Hash256
LastHash returns the recorded prev hash when ContextWrapper generation
func (*ContextWrapper) LastStatus ¶
func (ctw *ContextWrapper) LastStatus() (uint32, hash.Hash256)
LastStatus returns the recored target height, prev hash
func (*ContextWrapper) LastTimestamp ¶
func (ctw *ContextWrapper) LastTimestamp() uint64
LastTimestamp returns the last timestamp of the chain
func (*ContextWrapper) Name ¶
func (ctw *ContextWrapper) Name() string
Name returns the name of the chain
func (*ContextWrapper) ProcessData ¶
func (ctw *ContextWrapper) ProcessData(name []byte) []byte
ProcessData returns the process data from the top snapshot
func (*ContextWrapper) Revert ¶
func (ctw *ContextWrapper) Revert(sn int)
Revert removes snapshots after the snapshot number
func (*ContextWrapper) SetAccountData ¶
func (ctw *ContextWrapper) SetAccountData(addr common.Address, name []byte, value []byte)
SetAccountData inserts the account data to the top snapshot
func (*ContextWrapper) SetProcessData ¶
func (ctw *ContextWrapper) SetProcessData(name []byte, value []byte)
SetProcessData inserts the process data to the top snapshot
func (*ContextWrapper) Snapshot ¶
func (ctw *ContextWrapper) Snapshot() int
Snapshot push a snapshot and returns the snapshot number of it
func (*ContextWrapper) StackSize ¶
func (ctw *ContextWrapper) StackSize() int
StackSize returns the size of the context data stack
func (*ContextWrapper) Switch ¶
func (ctw *ContextWrapper) Switch(pid uint8) *ContextWrapper
Switch returns a SwitchContextWrapper of the pid
func (*ContextWrapper) TargetHeight ¶
func (ctw *ContextWrapper) TargetHeight() uint32
TargetHeight returns the recorded target height when ContextWrapper generation
func (*ContextWrapper) Top ¶
func (ctw *ContextWrapper) Top() *ContextData
Top returns the top snapshot
func (*ContextWrapper) UTXO ¶
func (ctw *ContextWrapper) UTXO(id uint64) (*UTXO, error)
UTXO returns the UTXO from the top snapshot
func (*ContextWrapper) Version ¶
func (ctw *ContextWrapper) Version() uint16
Version returns the version of the chain
type Header ¶
type Header struct { ChainID uint8 Version uint16 Height uint32 PrevHash hash.Hash256 LevelRootHash hash.Hash256 ContextHash hash.Hash256 Timestamp uint64 Generator common.Address ConsensusData []byte }
Header is validation informations
type Loader ¶
type Loader interface { ChainID() uint8 Name() string Version() uint16 TargetHeight() uint32 Account(addr common.Address) (Account, error) AddressByName(Name string) (common.Address, error) HasAccount(addr common.Address) (bool, error) HasAccountName(Name string) (bool, error) HasUTXO(id uint64) (bool, error) UTXO(id uint64) (*UTXO, error) HasTimeSlot(slot uint32, key string) bool }
Loader defines functions that loads state data from the target chain
type LoaderWrapper ¶
type LoaderWrapper interface { Loader AccountData(addr common.Address, name []byte) []byte ProcessData(name []byte) []byte }
LoaderWrapper is an interface to load state data from the target chain
func NewLoaderWrapper ¶
func NewLoaderWrapper(pid uint8, loader Loader) LoaderWrapper
NewLoaderWrapper returns a LoaderWrapper
type Process ¶
type Process interface { ID() uint8 Version() string Name() string Init(reg *Register, pm ProcessManager, cn Provider) error OnLoadChain(loader LoaderWrapper) error BeforeExecuteTransactions(ctw *ContextWrapper) error AfterExecuteTransactions(b *Block, ctw *ContextWrapper) error OnSaveData(b *Block, ctw *ContextWrapper) error }
Process defines process functions
type ProcessBase ¶
type ProcessBase struct{}
ProcessBase is a base handler of the chain process
func (*ProcessBase) AfterExecuteTransactions ¶
func (p *ProcessBase) AfterExecuteTransactions(b *Block, ctw *ContextWrapper) error
AfterExecuteTransactions called after processes transactions of the block
func (*ProcessBase) BeforeExecuteTransactions ¶
func (p *ProcessBase) BeforeExecuteTransactions(ctw *ContextWrapper) error
BeforeExecuteTransactions called before processes transactions of the block
func (*ProcessBase) InitGenesis ¶
func (p *ProcessBase) InitGenesis(ctw *ContextWrapper) error
InitGenesis initializes genesis data
func (*ProcessBase) OnLoadChain ¶
func (p *ProcessBase) OnLoadChain(loader LoaderWrapper) error
OnLoadChain called when the chain loaded
func (*ProcessBase) OnSaveData ¶
func (p *ProcessBase) OnSaveData(b *Block, ctw *ContextWrapper) error
OnSaveData called when the context of the block saved
type ProcessManager ¶
type ProcessManager interface { Processes() []Process Process(id uint8) (Process, error) ProcessByName(name string) (Process, error) Services() []Service ServiceByName(name string) (Service, error) }
ProcessManager managers processes in the chain
type Provider ¶
type Provider interface { ChainID() uint8 Symbol() string Usage() string Version() uint16 Height() uint32 LastStatus() (uint32, hash.Hash256) LastHash() hash.Hash256 LastTimestamp() uint64 Hash(height uint32) (hash.Hash256, error) Header(height uint32) (*Header, error) Block(height uint32) (*Block, error) Events(From uint32, To uint32) ([]Event, error) NewLoaderWrapper(pid uint8) LoaderWrapper NewAddress(height uint32, index uint16) common.Address }
Provider defines functions that loads chain data from the chain
type PublicHashBoolMap ¶
type PublicHashBoolMap struct {
// contains filtered or unexported fields
}
PublicHashBoolMap PublicHash and bool map
func NewPublicHashBoolMap ¶
func NewPublicHashBoolMap() *PublicHashBoolMap
NewPublicHashBoolMap returns a PublicHashBoolMap
func (*PublicHashBoolMap) Delete ¶
func (sm *PublicHashBoolMap) Delete(pubhash common.PublicHash)
Delete removes data of the key
func (*PublicHashBoolMap) EachAll ¶
func (sm *PublicHashBoolMap) EachAll(fn func(common.PublicHash, bool) bool)
EachAll iterates all elements
func (*PublicHashBoolMap) Get ¶
func (sm *PublicHashBoolMap) Get(pubhash common.PublicHash) (bool, bool)
Get returns data of the key
func (*PublicHashBoolMap) Has ¶
func (sm *PublicHashBoolMap) Has(pubhash common.PublicHash) bool
Has returns data of the key is exist or not
func (*PublicHashBoolMap) Len ¶
func (sm *PublicHashBoolMap) Len() int
Len returns the length of the map
func (*PublicHashBoolMap) MarshalJSON ¶
func (sm *PublicHashBoolMap) MarshalJSON() ([]byte, error)
MarshalJSON is a marshaler function
func (*PublicHashBoolMap) Put ¶
func (sm *PublicHashBoolMap) Put(pubhash common.PublicHash, value bool)
Put adds data of the key
type Register ¶
type Register struct {
// contains filtered or unexported fields
}
Register adds types of the process to the encoding factory
func (*Register) RegisterAccount ¶
RegisterAccount adds the type of the account of the process to the encoding factory
func (*Register) RegisterEvent ¶
RegisterEvent adds the type of the event of the process to the encoding factory
func (*Register) RegisterTransaction ¶
func (reg *Register) RegisterTransaction(t uint8, tx Transaction) uint16
RegisterTransaction adds the type of the transaction of the process to the encoding factory
type Service ¶
type Service interface { Name() string Init(pm ProcessManager, cn Provider) error OnLoadChain(loader Loader) error OnBlockConnected(b *Block, events []Event, loader Loader) OnTransactionInPoolExpired(txs []Transaction) }
Service defines service functions
type ServiceBase ¶
type ServiceBase struct{}
ServiceBase is a base handler of the chain service
func (*ServiceBase) OnBlockConnected ¶
func (s *ServiceBase) OnBlockConnected(b *Block, events []Event, loader Loader)
OnBlockConnected called when a block is connected to the chain
func (*ServiceBase) OnLoadChain ¶
func (s *ServiceBase) OnLoadChain(loader Loader) error
OnLoadChain called when the chain loaded
func (*ServiceBase) OnTransactionInPoolExpired ¶
func (s *ServiceBase) OnTransactionInPoolExpired(txs []Transaction)
OnTransactionInPoolExpired called when a transaction in pool is expired
type StringAddressMap ¶
type StringAddressMap struct {
// contains filtered or unexported fields
}
StringAddressMap address and common.Address map
func NewStringAddressMap ¶
func NewStringAddressMap() *StringAddressMap
NewStringAddressMap returns a StringAddressMap
func (*StringAddressMap) Delete ¶
func (sm *StringAddressMap) Delete(key string)
Delete removes data of the key
func (*StringAddressMap) EachAll ¶
func (sm *StringAddressMap) EachAll(fn func(string, common.Address) bool)
EachAll iterates all elements
func (*StringAddressMap) EachPrefix ¶
EachPrefix iterates elements that has the given prefix
func (*StringAddressMap) Get ¶
func (sm *StringAddressMap) Get(key string) (common.Address, bool)
Get returns data of the key
func (*StringAddressMap) Has ¶
func (sm *StringAddressMap) Has(key string) bool
Has returns data of the key is exist or not
func (*StringAddressMap) Len ¶
func (sm *StringAddressMap) Len() int
Len returns the length of the map
func (*StringAddressMap) MarshalJSON ¶
func (sm *StringAddressMap) MarshalJSON() ([]byte, error)
MarshalJSON is a marshaler function
type StringBoolMap ¶
type StringBoolMap struct {
// contains filtered or unexported fields
}
StringBoolMap string and bool map
func NewStringBoolMap ¶
func NewStringBoolMap() *StringBoolMap
NewStringBoolMap returns a StringBoolMap
func (*StringBoolMap) Delete ¶
func (sm *StringBoolMap) Delete(key string)
Delete removes data of the key
func (*StringBoolMap) EachAll ¶
func (sm *StringBoolMap) EachAll(fn func(string, bool) bool)
EachAll iterates all elements
func (*StringBoolMap) EachPrefix ¶
func (sm *StringBoolMap) EachPrefix(prefix string, fn func(string, bool) bool)
EachPrefix iterates elements that has the given prefix
func (*StringBoolMap) Get ¶
func (sm *StringBoolMap) Get(key string) (bool, bool)
Get returns data of the key
func (*StringBoolMap) Has ¶
func (sm *StringBoolMap) Has(key string) bool
Has returns data of the key is exist or not
func (*StringBoolMap) MarshalJSON ¶
func (sm *StringBoolMap) MarshalJSON() ([]byte, error)
MarshalJSON is a marshaler function
func (*StringBoolMap) Put ¶
func (sm *StringBoolMap) Put(key string, value bool)
Put adds data of the key
type StringBytesMap ¶
type StringBytesMap struct {
// contains filtered or unexported fields
}
StringBytesMap string and []byte map
func NewStringBytesMap ¶
func NewStringBytesMap() *StringBytesMap
NewStringBytesMap returns a StringBytesMap
func (*StringBytesMap) Delete ¶
func (sm *StringBytesMap) Delete(key string)
Delete removes data of the key
func (*StringBytesMap) EachAll ¶
func (sm *StringBytesMap) EachAll(fn func(string, []byte) bool)
EachAll iterates all elements
func (*StringBytesMap) EachPrefix ¶
func (sm *StringBytesMap) EachPrefix(prefix string, fn func(string, []byte) bool)
EachPrefix iterates elements that has the given prefix
func (*StringBytesMap) Get ¶
func (sm *StringBytesMap) Get(key string) ([]byte, bool)
Get returns data of the key
func (*StringBytesMap) Has ¶
func (sm *StringBytesMap) Has(key string) bool
Has returns data of the key is exist or not
func (*StringBytesMap) Put ¶
func (sm *StringBytesMap) Put(key string, value []byte)
Put adds data of the key
type StringStringMap ¶
type StringStringMap struct {
// contains filtered or unexported fields
}
StringStringMap string and string map
func NewStringStringMap ¶
func NewStringStringMap() *StringStringMap
NewStringStringMap returns a StringStringMap
func (*StringStringMap) Delete ¶
func (sm *StringStringMap) Delete(key string)
Delete removes data of the key
func (*StringStringMap) EachAll ¶
func (sm *StringStringMap) EachAll(fn func(string, string) bool)
EachAll iterates all elements
func (*StringStringMap) EachPrefix ¶
func (sm *StringStringMap) EachPrefix(prefix string, fn func(string, string) bool)
EachPrefix iterates elements that has the given prefix
func (*StringStringMap) Get ¶
func (sm *StringStringMap) Get(key string) (string, bool)
Get returns data of the key
func (*StringStringMap) Has ¶
func (sm *StringStringMap) Has(key string) bool
Has returns data of the key is exist or not
func (*StringStringMap) Len ¶
func (sm *StringStringMap) Len() int
Len returns the length of the map
func (*StringStringMap) MarshalJSON ¶
func (sm *StringStringMap) MarshalJSON() ([]byte, error)
MarshalJSON is a marshaler function
func (*StringStringMap) Put ¶
func (sm *StringStringMap) Put(key string, value string)
Put adds data of the key
type Transaction ¶
type Transaction interface { json.Marshaler Timestamp() uint64 Validate(p Process, loader LoaderWrapper, signers []common.PublicHash) error Execute(p Process, ctx *ContextWrapper, index uint16) error }
Transaction defines common transaction functions
func DecodeTransaction ¶
DecodeTransaction returns the encoded transaction
type TransactionSign ¶
TransactionSign is the signature of the transaction creator
type TxOut ¶
type TxOut struct { Amount *amount.Amount PublicHash common.PublicHash }
TxOut represents recipient of the UTXO
func (*TxOut) MarshalJSON ¶
MarshalJSON is a marshaler function
type Uint32StringBoolMap ¶
type Uint32StringBoolMap struct {
// contains filtered or unexported fields
}
Uint32StringBoolMap StringBoolMapess and *StringBoolMap map
func NewUint32StringBoolMap ¶
func NewUint32StringBoolMap() *Uint32StringBoolMap
NewUint32StringBoolMap returns a Uint32StringBoolMap
func (*Uint32StringBoolMap) Delete ¶
func (sm *Uint32StringBoolMap) Delete(key uint32)
Delete removes data of the key
func (*Uint32StringBoolMap) EachAll ¶
func (sm *Uint32StringBoolMap) EachAll(fn func(uint32, *StringBoolMap) bool)
EachAll iterates all elements
func (*Uint32StringBoolMap) Get ¶
func (sm *Uint32StringBoolMap) Get(key uint32) (*StringBoolMap, bool)
Get returns data of the key
func (*Uint32StringBoolMap) Has ¶
func (sm *Uint32StringBoolMap) Has(key uint32) bool
Has returns data of the key is exist or not
func (*Uint32StringBoolMap) Len ¶
func (sm *Uint32StringBoolMap) Len() int
Len returns the length of the map
func (*Uint32StringBoolMap) Put ¶
func (sm *Uint32StringBoolMap) Put(key uint32, StringBoolMap *StringBoolMap)
Put adds data of the key
type Uint64BoolMap ¶
type Uint64BoolMap struct {
// contains filtered or unexported fields
}
Uint64BoolMap uint64 and bool map
func NewUint64BoolMap ¶
func NewUint64BoolMap() *Uint64BoolMap
NewUint64BoolMap returns a Uint64BoolMap
func (*Uint64BoolMap) Delete ¶
func (sm *Uint64BoolMap) Delete(key uint64)
Delete removes data of the key
func (*Uint64BoolMap) EachAll ¶
func (sm *Uint64BoolMap) EachAll(fn func(uint64, bool) bool)
EachAll iterates all elements
func (*Uint64BoolMap) Get ¶
func (sm *Uint64BoolMap) Get(key uint64) (bool, bool)
Get returns data of the key
func (*Uint64BoolMap) Has ¶
func (sm *Uint64BoolMap) Has(key uint64) bool
Has returns data of the key is exist or not
func (*Uint64BoolMap) MarshalJSON ¶
func (sm *Uint64BoolMap) MarshalJSON() ([]byte, error)
MarshalJSON is a marshaler function
func (*Uint64BoolMap) Put ¶
func (sm *Uint64BoolMap) Put(key uint64, value bool)
Put adds data of the key
type Uint64TxOutMap ¶
type Uint64TxOutMap struct {
// contains filtered or unexported fields
}
Uint64TxOutMap voutess and *TxOut map
func NewUint64TxOutMap ¶
func NewUint64TxOutMap() *Uint64TxOutMap
NewUint64TxOutMap returns a Uint64TxOutMap
func (*Uint64TxOutMap) Delete ¶
func (sm *Uint64TxOutMap) Delete(key uint64)
Delete removes data of the key
func (*Uint64TxOutMap) EachAll ¶
func (sm *Uint64TxOutMap) EachAll(fn func(uint64, *TxOut) bool)
EachAll iterates all elements
func (*Uint64TxOutMap) Get ¶
func (sm *Uint64TxOutMap) Get(key uint64) (*TxOut, bool)
Get returns data of the key
func (*Uint64TxOutMap) Has ¶
func (sm *Uint64TxOutMap) Has(key uint64) bool
Has returns data of the key is exist or not
func (*Uint64TxOutMap) MarshalJSON ¶
func (sm *Uint64TxOutMap) MarshalJSON() ([]byte, error)
MarshalJSON is a marshaler function
func (*Uint64TxOutMap) Put ¶
func (sm *Uint64TxOutMap) Put(key uint64, vout *TxOut)
Put adds data of the key
type Uint64UTXOMap ¶
type Uint64UTXOMap struct {
// contains filtered or unexported fields
}
Uint64UTXOMap utxoess and *UTXO map
func NewUint64UTXOMap ¶
func NewUint64UTXOMap() *Uint64UTXOMap
NewUint64UTXOMap returns a Uint64UTXOMap
func (*Uint64UTXOMap) Delete ¶
func (sm *Uint64UTXOMap) Delete(key uint64)
Delete removes data of the key
func (*Uint64UTXOMap) EachAll ¶
func (sm *Uint64UTXOMap) EachAll(fn func(uint64, *UTXO) bool)
EachAll iterates all elements
func (*Uint64UTXOMap) Get ¶
func (sm *Uint64UTXOMap) Get(key uint64) (*UTXO, bool)
Get returns data of the key
func (*Uint64UTXOMap) Has ¶
func (sm *Uint64UTXOMap) Has(key uint64) bool
Has returns data of the key is exist or not
func (*Uint64UTXOMap) MarshalJSON ¶
func (sm *Uint64UTXOMap) MarshalJSON() ([]byte, error)
MarshalJSON is a marshaler function
func (*Uint64UTXOMap) Put ¶
func (sm *Uint64UTXOMap) Put(key uint64, utxo *UTXO)
Put adds data of the key
type Uint8StringBytesMap ¶
type Uint8StringBytesMap struct {
// contains filtered or unexported fields
}
Uint8StringBytesMap StringBytesMapess and *StringBytesMap map
func NewUint8StringBytesMap ¶
func NewUint8StringBytesMap() *Uint8StringBytesMap
NewUint8StringBytesMap returns a Uint8StringBytesMap
func (*Uint8StringBytesMap) Delete ¶
func (sm *Uint8StringBytesMap) Delete(key uint8)
Delete removes data of the key
func (*Uint8StringBytesMap) EachAll ¶
func (sm *Uint8StringBytesMap) EachAll(fn func(uint8, *StringBytesMap) bool)
EachAll iterates all elements
func (*Uint8StringBytesMap) Get ¶
func (sm *Uint8StringBytesMap) Get(key uint8) (*StringBytesMap, bool)
Get returns data of the key
func (*Uint8StringBytesMap) Has ¶
func (sm *Uint8StringBytesMap) Has(key uint8) bool
Has returns data of the key is exist or not
func (*Uint8StringBytesMap) Len ¶
func (sm *Uint8StringBytesMap) Len() int
Len returns the length of the map
func (*Uint8StringBytesMap) Put ¶
func (sm *Uint8StringBytesMap) Put(key uint8, StringBytesMap *StringBytesMap)
Put adds data of the key
Source Files ¶
- account.go
- application.go
- block.go
- block_header.go
- block_sign.go
- context.go
- context_cache.go
- context_data.go
- context_wrapper.go
- errors.go
- event.go
- hashed_type.go
- loader.go
- loader_wapper.go
- map_address_account.go
- map_address_address.go
- map_address_address_amount.go
- map_address_amount.go
- map_address_bool.go
- map_address_uint32.go
- map_address_uint64.go
- map_publichash_bool.go
- map_string_address.go
- map_string_bool.go
- map_string_bytes.go
- map_string_string.go
- map_uint16_string_bytes.go
- map_uint32_string_bool.go
- map_uint64_bool.go
- map_uint64_txout.go
- map_uint64_utxo.go
- process.go
- process_manager.go
- provider.go
- register.go
- service.go
- transaction.go
- transaction_sign.go
- txin.go
- txout.go
- util.go
- utxo.go