Documentation
¶
Overview ¶
Copyright © 2019 Annchain Authors <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- type AccountData
- type BalanceSet
- func (b *BalanceSet) Copy() BalanceSet
- func (b *BalanceSet) IsEmpty() bool
- func (b *BalanceSet) MarshalMsg(bts []byte) (o []byte, err error)
- func (b *BalanceSet) Msgsize() int
- func (b *BalanceSet) PreAdd(tokenID int32, increment *math.BigInt) *math.BigInt
- func (b *BalanceSet) PreSub(tokenID int32, decrement *math.BigInt) *math.BigInt
- func (b *BalanceSet) UnmarshalMsg(bts []byte) (o []byte, err error)
- type Database
- type JournalEntry
- type PreloadDB
- func (pd *PreloadDB) AddBalance(addr common.Address, increment *math.BigInt)
- func (pd *PreloadDB) AddLog(l *vmtypes.Log)
- func (pd *PreloadDB) AddPreimage(common.Hash, []byte)
- func (pd *PreloadDB) AddRefund(uint64)
- func (pd *PreloadDB) AddTokenBalance(addr common.Address, tokenID int32, increment *math.BigInt)
- func (pd *PreloadDB) AppendJournal(entry JournalEntry)
- func (pd *PreloadDB) Commit() (common.Hash, error)
- func (pd *PreloadDB) CreateAccount(addr common.Address)
- func (pd *PreloadDB) Empty(addr common.Address) bool
- func (pd *PreloadDB) Exist(addr common.Address) bool
- func (pd *PreloadDB) ForEachStorage(common.Address, func(common.Hash, common.Hash) bool)
- func (pd *PreloadDB) GetBalance(addr common.Address) *math.BigInt
- func (pd *PreloadDB) GetCode(addr common.Address) []byte
- func (pd *PreloadDB) GetCodeHash(addr common.Address) common.Hash
- func (pd *PreloadDB) GetCodeSize(addr common.Address) int
- func (pd *PreloadDB) GetCommittedState(addr common.Address, key common.Hash) common.Hash
- func (pd *PreloadDB) GetNonce(addr common.Address) uint64
- func (pd *PreloadDB) GetRefund() uint64
- func (pd *PreloadDB) GetState(addr common.Address, key common.Hash) common.Hash
- func (pd *PreloadDB) GetTokenBalance(addr common.Address, tokenID int32) *math.BigInt
- func (pd *PreloadDB) HasSuicided(addr common.Address) bool
- func (pd *PreloadDB) Reset()
- func (pd *PreloadDB) RevertToSnapshot(int)
- func (pd *PreloadDB) SetCode(addr common.Address, code []byte)
- func (pd *PreloadDB) SetNonce(addr common.Address, nonce uint64)
- func (pd *PreloadDB) SetState(addr common.Address, key, value common.Hash)
- func (ps *PreloadDB) SetTokenBalance(addr common.Address, tokenID int32, balance *math.BigInt)
- func (pd *PreloadDB) Snapshot() int
- func (pd *PreloadDB) String() string
- func (pd *PreloadDB) SubBalance(addr common.Address, decrement *math.BigInt)
- func (pd *PreloadDB) SubRefund(uint64)
- func (pd *PreloadDB) SubTokenBalance(addr common.Address, tokenID int32, decrement *math.BigInt)
- func (pd *PreloadDB) Suicide(addr common.Address) bool
- type StateDB
- func (sd *StateDB) AddBalance(addr common.Address, increment *math.BigInt)
- func (sd *StateDB) AddLog(l *vmtypes.Log)
- func (sd *StateDB) AddPreimage(h common.Hash, b []byte)
- func (sd *StateDB) AddRefund(increment uint64)
- func (sd *StateDB) AddTokenBalance(addr common.Address, tokenID int32, increment *math.BigInt)
- func (sd *StateDB) AppendJournal(entry JournalEntry)
- func (sd *StateDB) ClearJournalAndRefund()
- func (sd *StateDB) Commit() (common.Hash, error)
- func (sd *StateDB) CreateAccount(addr common.Address)
- func (sd *StateDB) Database() Database
- func (sd *StateDB) DeleteStateObject(addr common.Address) error
- func (sd *StateDB) DestroyToken(tokenID int32) error
- func (sd *StateDB) Empty(addr common.Address) bool
- func (sd *StateDB) Exist(addr common.Address) bool
- func (sd *StateDB) ForEachStorage(addr common.Address, f func(key, value common.Hash) bool)
- func (sd *StateDB) GetAllTokenBalance(addr common.Address) BalanceSet
- func (sd *StateDB) GetBalance(addr common.Address) *math.BigInt
- func (sd *StateDB) GetCode(addr common.Address) []byte
- func (sd *StateDB) GetCodeHash(addr common.Address) common.Hash
- func (sd *StateDB) GetCodeSize(addr common.Address) int
- func (sd *StateDB) GetCommittedState(addr common.Address, key common.Hash) common.Hash
- func (sd *StateDB) GetNonce(addr common.Address) uint64
- func (sd *StateDB) GetOrCreateStateObject(addr common.Address) *StateObject
- func (sd *StateDB) GetRefund() uint64
- func (sd *StateDB) GetState(addr common.Address, key common.Hash) common.Hash
- func (sd *StateDB) GetStateObject(addr common.Address) *StateObject
- func (sd *StateDB) GetTokenBalance(addr common.Address, tokenID int32) *math.BigInt
- func (sd *StateDB) GetTokenObject(tokenID int32) *TokenObject
- func (sd *StateDB) HasSuicided(addr common.Address) bool
- func (sd *StateDB) IssueToken(issuer common.Address, name, symbol string, reIssuable bool, ...) (int32, error)
- func (sd *StateDB) LatestTokenID() int32
- func (sd *StateDB) ReIssueToken(tokenID int32, amount *math.BigInt) error
- func (sd *StateDB) RevertToSnapshot(snapshotid int)
- func (sd *StateDB) Root() common.Hash
- func (sd *StateDB) SetBalance(addr common.Address, balance *math.BigInt)
- func (sd *StateDB) SetCode(addr common.Address, code []byte)
- func (sd *StateDB) SetNonce(addr common.Address, nonce uint64)
- func (sd *StateDB) SetState(addr common.Address, key, value common.Hash)
- func (sd *StateDB) SetStateObject(addr common.Address, stobj *StateObject)
- func (sd *StateDB) SetTokenBalance(addr common.Address, tokenID int32, balance *math.BigInt)
- func (sd *StateDB) Snapshot() int
- func (sd *StateDB) Stop()
- func (sd *StateDB) String() string
- func (sd *StateDB) SubBalance(addr common.Address, decrement *math.BigInt)
- func (sd *StateDB) SubRefund(decrement uint64)
- func (sd *StateDB) SubTokenBalance(addr common.Address, tokenID int32, decrement *math.BigInt)
- func (sd *StateDB) Suicide(addr common.Address) bool
- type StateDBConfig
- type StateDBInterface
- type StateObject
- func (s *StateObject) AddBalance(tokenID int32, increment *math.BigInt)
- func (s *StateObject) CommitStorage(db Database, preCommit bool) error
- func (s *StateObject) Copy(src *StateObject)
- func (s *StateObject) Decode(b []byte, db *StateDB) error
- func (z *StateObject) DecodeMsg(dc *msgp.Reader) (err error)
- func (s *StateObject) Encode() ([]byte, error)
- func (z StateObject) EncodeMsg(en *msgp.Writer) (err error)
- func (s *StateObject) GetAllBalance() BalanceSet
- func (s *StateObject) GetBalance(tokenID int32) *math.BigInt
- func (s *StateObject) GetCode(db Database) []byte
- func (s *StateObject) GetCodeHash() common.Hash
- func (s *StateObject) GetCodeSize(db Database) (int, error)
- func (s *StateObject) GetCommittedState(db Database, key common.Hash) common.Hash
- func (s *StateObject) GetNonce() uint64
- func (s *StateObject) GetState(db Database, key common.Hash) common.Hash
- func (s *StateObject) Map() map[string]interface{}
- func (z StateObject) MarshalMsg(b []byte) (o []byte, err error)
- func (z StateObject) Msgsize() (s int)
- func (s *StateObject) SetBalance(tokenID int32, balance *math.BigInt)
- func (s *StateObject) SetCode(codehash common.Hash, code []byte)
- func (s *StateObject) SetNonce(nonce uint64)
- func (s *StateObject) SetState(db Database, key, value common.Hash)
- func (s *StateObject) String() string
- func (s *StateObject) SubBalance(tokenID int32, decrement *math.BigInt)
- func (s *StateObject) Uncache()
- func (z *StateObject) UnmarshalMsg(bts []byte) (o []byte, err error)
- type TokenObject
- func (t *TokenObject) AllIssues() []*math.BigInt
- func (t *TokenObject) CanReIssue() bool
- func (t *TokenObject) CopyRaw(tObj *TokenObject)
- func (t *TokenObject) Decode(b []byte) error
- func (z *TokenObject) DecodeMsg(dc *msgp.Reader) (err error)
- func (t *TokenObject) Destroy()
- func (t *TokenObject) Encode() ([]byte, error)
- func (z *TokenObject) EncodeMsg(en *msgp.Writer) (err error)
- func (t *TokenObject) GetID() int32
- func (t *TokenObject) GetName() string
- func (t *TokenObject) GetSymbol() string
- func (z *TokenObject) MarshalMsg(b []byte) (o []byte, err error)
- func (z *TokenObject) Msgsize() (s int)
- func (t *TokenObject) OneIssue(term int) *math.BigInt
- func (t *TokenObject) ReIssue(amount *math.BigInt) error
- func (z *TokenObject) UnmarshalMsg(bts []byte) (o []byte, err error)
- type Trie
Constants ¶
const ( MaxTokenName = 20 MaxTokenSymbol = 5 )
const TokenNotDirtied int32 = -1
Variables ¶
var MaxTrieCacheGen = uint16(120)
MaxTrieCacheGen is trie cache generation limit after which to evict trie nodes from memory.
Functions ¶
This section is empty.
Types ¶
type AccountData ¶ added in v0.0.2
type AccountData struct {
Address common.Address
Balances BalanceSet
Nonce uint64
Root common.Hash
CodeHash []byte
}
func NewAccountData ¶ added in v0.0.2
func NewAccountData() AccountData
func (*AccountData) DecodeMsg ¶ added in v0.0.2
func (z *AccountData) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*AccountData) EncodeMsg ¶ added in v0.0.2
func (z *AccountData) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*AccountData) MarshalMsg ¶ added in v0.0.2
func (z *AccountData) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*AccountData) Msgsize ¶ added in v0.0.2
func (z *AccountData) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*AccountData) UnmarshalMsg ¶ added in v0.0.2
func (z *AccountData) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type BalanceSet ¶ added in v0.0.2
BalanceSet
func NewBalanceSet ¶ added in v0.0.2
func NewBalanceSet() BalanceSet
func (*BalanceSet) Copy ¶ added in v0.0.2
func (b *BalanceSet) Copy() BalanceSet
func (*BalanceSet) IsEmpty ¶ added in v0.0.2
func (b *BalanceSet) IsEmpty() bool
func (*BalanceSet) MarshalMsg ¶ added in v0.0.2
func (b *BalanceSet) MarshalMsg(bts []byte) (o []byte, err error)
MarshalMsg - For every [key, value] pair, marshal it in [size (int32) + key (int32) + bigint.bytes]
func (*BalanceSet) Msgsize ¶ added in v0.0.2
func (b *BalanceSet) Msgsize() int
Msgsize - BalanceSet size = size (4 bytes for int32) + every key pair size
func (*BalanceSet) UnmarshalMsg ¶ added in v0.0.2
func (b *BalanceSet) UnmarshalMsg(bts []byte) (o []byte, err error)
type Database ¶
type Database interface {
// OpenTrie opens the main account trie.
OpenTrie(root common.Hash) (Trie, error)
// OpenStorageTrie opens the storage trie of an account.
OpenStorageTrie(addrHash, root common.Hash) (Trie, error)
// CopyTrie returns an independent copy of the given trie.
CopyTrie(Trie) Trie
// ContractCode retrieves a particular contract's code.
ContractCode(addrHash, codeHash common.Hash) ([]byte, error)
// ContractCodeSize retrieves a particular contracts code's size.
ContractCodeSize(addrHash, codeHash common.Hash) (int, error)
// TrieDB retrieves the low level trie database used for data storage.
TrieDB() *trie.Database
}
Database wraps access to tries and contract code.
func NewDatabase ¶
NewDatabase creates a backing store for state. The returned database is safe for concurrent use and retains cached trie nodes in memory. The pool is an optional intermediate trie-node memory pool between the low level storage layer and the high level trie abstraction.
type JournalEntry ¶ added in v0.0.2
type JournalEntry interface {
// revert undoes the changes introduced by this journal entry.
Revert(db *StateDB)
// dirtied returns the address modified by this journal entry.
Dirtied() *common.Address
// TokenDirtied returns the Token ID modified by this journal entry.
TokenDirtied() int32
}
journalEntry is a modification entry in the state change journal that can be reverted on demand.
type PreloadDB ¶ added in v0.0.2
type PreloadDB struct {
// contains filtered or unexported fields
}
func NewPreloadDB ¶ added in v0.0.2
func (*PreloadDB) AddBalance ¶ added in v0.0.2
func (*PreloadDB) AddPreimage ¶ added in v0.0.2
func (*PreloadDB) AddTokenBalance ¶ added in v0.0.2
func (*PreloadDB) AppendJournal ¶ added in v0.0.2
func (pd *PreloadDB) AppendJournal(entry JournalEntry)
func (*PreloadDB) CreateAccount ¶ added in v0.0.2
func (*PreloadDB) Empty ¶ added in v0.0.2
Empty returns whether the given account is empty. Empty is defined according to EIP161 (balance = nonce = code = 0).
func (*PreloadDB) Exist ¶ added in v0.0.2
Exist reports whether the given account exists in state. Notably this should also return true for suicided accounts.
func (*PreloadDB) ForEachStorage ¶ added in v0.0.2
func (*PreloadDB) GetBalance ¶ added in v0.0.2
Retrieve the balance from the given address or 0 if object not found
func (*PreloadDB) GetCodeHash ¶ added in v0.0.2
func (*PreloadDB) GetCodeSize ¶ added in v0.0.2
func (*PreloadDB) GetCommittedState ¶ added in v0.0.2
func (*PreloadDB) GetState ¶ added in v0.0.2
GetState retrieves a value from the given account's storage trie.
func (*PreloadDB) GetTokenBalance ¶ added in v0.0.2
func (*PreloadDB) HasSuicided ¶ added in v0.0.2
func (*PreloadDB) RevertToSnapshot ¶ added in v0.0.2
RevertToSnapshot reverts all state changes made since the given revision.
func (*PreloadDB) SetTokenBalance ¶ added in v0.0.2
func (*PreloadDB) SubBalance ¶ added in v0.0.2
func (*PreloadDB) SubTokenBalance ¶ added in v0.0.2
type StateDB ¶
type StateDB struct {
// contains filtered or unexported fields
}
StateDB stores account's data. Account's data include address, balance, nonce, code and its contract db if it is an contract address. An account is stored as a StateObject, for more detail please check StateObject struct.
func NewStateDB ¶
func (*StateDB) AddBalance ¶
AddBalance
func (*StateDB) AddTokenBalance ¶ added in v0.0.2
func (*StateDB) AppendJournal ¶ added in v0.0.2
func (sd *StateDB) AppendJournal(entry JournalEntry)
func (*StateDB) ClearJournalAndRefund ¶ added in v0.0.3
func (sd *StateDB) ClearJournalAndRefund()
func (*StateDB) CreateAccount ¶
CreateAccount will create a new state for input address.
func (*StateDB) DeleteStateObject ¶
DeleteStateObject remove a state from StateDB. Return error if it fails.
func (*StateDB) DestroyToken ¶ added in v0.0.3
func (*StateDB) ForEachStorage ¶
func (*StateDB) GetAllTokenBalance ¶ added in v0.0.2
func (sd *StateDB) GetAllTokenBalance(addr common.Address) BalanceSet
func (*StateDB) GetCommittedState ¶
func (*StateDB) GetOrCreateStateObject ¶
func (sd *StateDB) GetOrCreateStateObject(addr common.Address) *StateObject
GetOrCreateStateObject will find a state from memory by account address. If state not exists, it will load a state from db.
func (*StateDB) GetStateObject ¶
func (sd *StateDB) GetStateObject(addr common.Address) *StateObject
GetStateObject get a state from StateDB. If state not exist, load it from db.
func (*StateDB) GetTokenBalance ¶ added in v0.0.2
func (*StateDB) GetTokenObject ¶ added in v0.0.3
func (sd *StateDB) GetTokenObject(tokenID int32) *TokenObject
GetTokenObject get token object from StateDB.tokens . If not exists then try to load from trie db.
func (*StateDB) IssueToken ¶ added in v0.0.3
func (sd *StateDB) IssueToken(issuer common.Address, name, symbol string, reIssuable bool, fstIssue *math.BigInt) (int32, error)
IssueToken creates a new token according to offered token information.
func (*StateDB) LatestTokenID ¶ added in v0.0.3
func (*StateDB) ReIssueToken ¶ added in v0.0.3
func (*StateDB) RevertToSnapshot ¶
func (*StateDB) SetBalance ¶
SetBalance set origin OG token balance. TODO should be modified to satisfy all tokens.
func (*StateDB) SetStateObject ¶
func (sd *StateDB) SetStateObject(addr common.Address, stobj *StateObject)
func (*StateDB) SetTokenBalance ¶ added in v0.0.2
func (*StateDB) SubBalance ¶
SubBalance
func (*StateDB) SubTokenBalance ¶ added in v0.0.2
type StateDBConfig ¶
func DefaultStateDBConfig ¶
func DefaultStateDBConfig() StateDBConfig
type StateDBInterface ¶ added in v0.0.2
type StateDBInterface interface {
CreateAccount(common.Address)
SubBalance(common.Address, *math.BigInt)
SubTokenBalance(common.Address, int32, *math.BigInt)
AddBalance(common.Address, *math.BigInt)
AddTokenBalance(common.Address, int32, *math.BigInt)
SetTokenBalance(common.Address, int32, *math.BigInt)
// Retrieve the balance from the given address or 0 if object not found
GetBalance(common.Address) *math.BigInt
GetTokenBalance(common.Address, int32) *math.BigInt
GetNonce(common.Address) uint64
SetNonce(common.Address, uint64)
GetCodeHash(common.Address) common.Hash
GetCode(common.Address) []byte
SetCode(common.Address, []byte)
GetCodeSize(common.Address) int
// AddRefund adds gas to the refund counter
AddRefund(uint64)
// SubRefund removes gas from the refund counter.
// This method will panic if the refund counter goes below zero
SubRefund(uint64)
// GetRefund returns the current value of the refund counter.
GetRefund() uint64
GetCommittedState(common.Address, common.Hash) common.Hash
// GetState retrieves a value from the given account's storage trie.
GetState(common.Address, common.Hash) common.Hash
SetState(common.Address, common.Hash, common.Hash)
AppendJournal(JournalEntry)
// Suicide marks the given account as suicided.
// This clears the account balance.
//
// The account's state object is still available until the state is committed,
// getStateObject will return a non-nil account after Suicide.
Suicide(common.Address) bool
HasSuicided(common.Address) bool
// Exist reports whether the given account exists in state.
// Notably this should also return true for suicided accounts.
Exist(common.Address) bool
// Empty returns whether the given account is empty. Empty
// is defined according to EIP161 (balance = nonce = code = 0).
Empty(common.Address) bool
// RevertToSnapshot reverts all state changes made since the given revision.
RevertToSnapshot(int)
// Snapshot creates a new revision
Snapshot() int
//AddLog(*Log)
AddPreimage(common.Hash, []byte)
ForEachStorage(common.Address, func(common.Hash, common.Hash) bool)
// for debug.
String() string
}
StateDB is an OVM database for full state querying.
type StateObject ¶
type StateObject struct {
// contains filtered or unexported fields
}
func NewStateObject ¶
func NewStateObject(addr common.Address, db StateDBInterface) *StateObject
func (*StateObject) AddBalance ¶
func (s *StateObject) AddBalance(tokenID int32, increment *math.BigInt)
func (*StateObject) CommitStorage ¶
func (s *StateObject) CommitStorage(db Database, preCommit bool) error
func (*StateObject) Copy ¶ added in v0.0.2
func (s *StateObject) Copy(src *StateObject)
func (*StateObject) DecodeMsg ¶
func (z *StateObject) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*StateObject) Encode ¶
func (s *StateObject) Encode() ([]byte, error)
func (StateObject) EncodeMsg ¶
func (z StateObject) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*StateObject) GetAllBalance ¶ added in v0.0.2
func (s *StateObject) GetAllBalance() BalanceSet
func (*StateObject) GetBalance ¶
func (s *StateObject) GetBalance(tokenID int32) *math.BigInt
func (*StateObject) GetCode ¶
func (s *StateObject) GetCode(db Database) []byte
func (*StateObject) GetCodeHash ¶
func (s *StateObject) GetCodeHash() common.Hash
func (*StateObject) GetCodeSize ¶
func (s *StateObject) GetCodeSize(db Database) (int, error)
func (*StateObject) GetCommittedState ¶
func (*StateObject) GetNonce ¶
func (s *StateObject) GetNonce() uint64
func (*StateObject) Map ¶ added in v0.0.2
func (s *StateObject) Map() map[string]interface{}
func (StateObject) MarshalMsg ¶
func (z StateObject) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (StateObject) Msgsize ¶
func (z StateObject) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*StateObject) SetBalance ¶
func (s *StateObject) SetBalance(tokenID int32, balance *math.BigInt)
func (*StateObject) SetNonce ¶
func (s *StateObject) SetNonce(nonce uint64)
func (*StateObject) String ¶ added in v0.0.2
func (s *StateObject) String() string
func (*StateObject) SubBalance ¶
func (s *StateObject) SubBalance(tokenID int32, decrement *math.BigInt)
func (*StateObject) Uncache ¶
func (s *StateObject) Uncache()
Uncache clears dirtyStorage and committedStorage. This is aimed to check if state is committed into db.
Note that this function is for test debug only, should not be called by other functions.
func (*StateObject) UnmarshalMsg ¶
func (z *StateObject) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type TokenObject ¶ added in v0.0.3
type TokenObject struct {
TokenID int32
Name string
Symbol string
Issuer common.Address
ReIssuable bool
Issues []*math.BigInt
Destroyed bool
// contains filtered or unexported fields
}
func NewTokenObject ¶ added in v0.0.3
func NewTokenObject(tokenID int32, issuer common.Address, name, symbol string, reIssuable bool, fstIssue *math.BigInt, db StateDBInterface) *TokenObject
func (*TokenObject) AllIssues ¶ added in v0.0.3
func (t *TokenObject) AllIssues() []*math.BigInt
func (*TokenObject) CanReIssue ¶ added in v0.0.3
func (t *TokenObject) CanReIssue() bool
func (*TokenObject) CopyRaw ¶ added in v0.0.3
func (t *TokenObject) CopyRaw(tObj *TokenObject)
func (*TokenObject) Decode ¶ added in v0.0.3
func (t *TokenObject) Decode(b []byte) error
func (*TokenObject) DecodeMsg ¶ added in v0.0.3
func (z *TokenObject) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (*TokenObject) Destroy ¶ added in v0.0.3
func (t *TokenObject) Destroy()
func (*TokenObject) Encode ¶ added in v0.0.3
func (t *TokenObject) Encode() ([]byte, error)
func (*TokenObject) EncodeMsg ¶ added in v0.0.3
func (z *TokenObject) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*TokenObject) GetID ¶ added in v0.0.3
func (t *TokenObject) GetID() int32
func (*TokenObject) GetName ¶ added in v0.0.3
func (t *TokenObject) GetName() string
func (*TokenObject) GetSymbol ¶ added in v0.0.3
func (t *TokenObject) GetSymbol() string
func (*TokenObject) MarshalMsg ¶ added in v0.0.3
func (z *TokenObject) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*TokenObject) Msgsize ¶ added in v0.0.3
func (z *TokenObject) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*TokenObject) OneIssue ¶ added in v0.0.3
func (t *TokenObject) OneIssue(term int) *math.BigInt
func (*TokenObject) ReIssue ¶ added in v0.0.3
func (t *TokenObject) ReIssue(amount *math.BigInt) error
func (*TokenObject) UnmarshalMsg ¶ added in v0.0.3
func (z *TokenObject) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Trie ¶
type Trie interface {
TryGet(key []byte) ([]byte, error)
TryUpdate(key, value []byte) error
TryDelete(key []byte) error
// preCommit is a flag for pre confirming sequencer. Because pre confirm uses the
// same trie db in real sequencer confirm and the db will be modified during db commit.
// To avoid this, add a flag to let pre confirm process not modify trie db anymore.
Commit(onleaf trie.LeafCallback, preCommit bool) (common.Hash, error)
Hash() common.Hash
NodeIterator(startKey []byte) trie.NodeIterator
GetKey([]byte) []byte // TODO(fjl): remove this when SecureTrie is removed
Prove(key []byte, fromLevel uint, proofDb ogdb.Putter) error
}
Trie is a Ethereum Merkle Trie.