state

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2019 License: GPL-3.0 Imports: 20 Imported by: 19

Documentation

Overview

Package state provides a caching layer atop the Ethereum state trie.

Index

Constants

This section is empty.

Variables

View Source
var ErrSyncNode = errors.New("no enough stake value to sync node")
View Source
var MaxTrieCacheGen = uint16(120)

Trie cache generation limit after which to evic trie nodes from memory.

Functions

func CheckCodeEmpty

func CheckCodeEmpty(codeHash []byte) bool

if empty return true

func NewStateSync

func NewStateSync(root common.Hash, database trie.DatabaseReader) *trie.TrieSync

NewStateSync create a new state trie download scheduler.

func Rank

func Rank(candidateInfos CandidateInfos) ([]common.Address, []uint64)

func RankWithLenth

func RankWithLenth(candidateInfos CandidateInfos, lenth int, committeeMinStake uint64) ([]common.Address, []uint64)

Types

type Account

type Account struct {
	Nonce    uint64
	Balance  *big.Int
	Root     common.Hash // merkle root of the storage trie
	CodeHash []byte
}

Account is the Ethereum consensus representation of accounts. These objects are stored in the main account trie.

type CandidateInfo

type CandidateInfo struct {
	Signer common.Address // peer address
	Heft   uint64         // the sentinel of the peer
	//TODO May need to convert big int
	Stake uint64 // the stake of the peer
	Point uint64
}

type CandidateInfos

type CandidateInfos []CandidateInfo

func (CandidateInfos) Apply

func (c CandidateInfos) Apply()

func (CandidateInfos) Len

func (c CandidateInfos) Len() int

func (CandidateInfos) Less

func (c CandidateInfos) Less(i, j int) bool

func (CandidateInfos) Swap

func (c CandidateInfos) Swap(i, j int)

type Candidates

type Candidates []common.Address

func (*Candidates) DelCandidate

func (self *Candidates) DelCandidate(addr common.Address)

type Code

type Code []byte

func (Code) String

func (self Code) String() string

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

func NewDatabase(db ethdb.Database) Database

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 Dump

type Dump struct {
	Root     string                 `json:"root"`
	Accounts map[string]DumpAccount `json:"accounts"`
}

type DumpAccount

type DumpAccount struct {
	Balance  string            `json:"balance"`
	Nonce    uint64            `json:"nonce"`
	Root     string            `json:"root"`
	CodeHash string            `json:"codeHash"`
	Code     string            `json:"code"`
	Storage  map[string]string `json:"storage"`
}

type FilePropertie

type FilePropertie struct {
	StorageGas      uint64 `json:"sgas"`
	StorageGasUsed  uint64 `json:"sGasUsed"`
	StorageGasPrice uint64 `josn:"sGasPrice"`
	// Ssize represents Storage Size
	Ssize uint64 `json:"sSize"`
}

type ManagedState

type ManagedState struct {
	*StateDB
	// contains filtered or unexported fields
}

func ManageState

func ManageState(statedb *StateDB) *ManagedState

ManagedState returns a new managed state with the statedb as it's backing layer

func (*ManagedState) GetNonce

func (ms *ManagedState) GetNonce(addr common.Address) uint64

GetNonce returns the canonical nonce for the managed or unmanaged account.

Because GetNonce mutates the DB, we must take a write lock.

func (*ManagedState) HasAccount

func (ms *ManagedState) HasAccount(addr common.Address) bool

HasAccount returns whether the given address is managed or not

func (*ManagedState) NewNonce

func (ms *ManagedState) NewNonce(addr common.Address) uint64

NewNonce returns the new canonical nonce for the managed account

func (*ManagedState) RemoveNonce

func (ms *ManagedState) RemoveNonce(addr common.Address, n uint64)

RemoveNonce removed the nonce from the managed state and all future pending nonces

func (*ManagedState) SetNonce

func (ms *ManagedState) SetNonce(addr common.Address, nonce uint64)

SetNonce sets the new canonical nonce for the managed state

func (*ManagedState) SetState

func (ms *ManagedState) SetState(statedb *StateDB)

SetState sets the backing layer of the managed state

type NodeIterator

type NodeIterator struct {
	Hash   common.Hash // Hash of the current entry being iterated (nil if not standalone)
	Parent common.Hash // Hash of the first full ancestor node (nil if current is the root)

	Error error // Failure set in case of an internal error in the iterator
	// contains filtered or unexported fields
}

NodeIterator is an iterator to traverse the entire state trie post-order, including all of the contract code and contract state tries.

func NewNodeIterator

func NewNodeIterator(state *StateDB) *NodeIterator

NewNodeIterator creates an post-order state node iterator.

func (*NodeIterator) Next

func (it *NodeIterator) Next() bool

Next moves the iterator to the next node, returning whether there are any further nodes. In case of an internal error this method returns false and sets the Error field to the encountered failure.

type StateDB

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

StateDBs within the ethereum protocol are used to store anything within the merkle trie. StateDBs take care of caching and storing nested states. It's the general query interface to retrieve: * Contracts * Accounts

func New

func New(root common.Hash, db Database) (*StateDB, error)

Create a new state from a given trie.

func (*StateDB) AddAccountInForbidBackStakeList

func (self *StateDB) AddAccountInForbidBackStakeList(address common.Address) bool

func (*StateDB) AddAlreadyBackStack

func (self *StateDB) AddAlreadyBackStack(backStack common.AlreadyBackStake) bool

func (*StateDB) AddBalance

func (self *StateDB) AddBalance(addr common.Address, amount *big.Int)

AddBalance adds amount to the account associated with addr

func (*StateDB) AddCandidate

func (self *StateDB) AddCandidate(candidate common.Address) bool

func (*StateDB) AddLastRootState

func (self *StateDB) AddLastRootState(statehash common.Hash, blockNumber uint64) bool

func (*StateDB) AddLog

func (self *StateDB) AddLog(log *types.Log)

func (*StateDB) AddPreimage

func (self *StateDB) AddPreimage(hash common.Hash, preimage []byte)

AddPreimage records a SHA3 preimage seen by the VM.

func (*StateDB) AddPromissoryNote

func (self *StateDB) AddPromissoryNote(address common.Address, promissoryNote types.PromissoryNote) bool

func (*StateDB) AddRefund

func (self *StateDB) AddRefund(gas uint64)

func (*StateDB) AddTxInOptionTxTable

func (self *StateDB) AddTxInOptionTxTable(hash common.Hash, promissoryNotesOptionTx types.PromissoryNotesOptionTx, optionTxMemorySize uint64) bool

func (*StateDB) BackStake

func (self *StateDB) BackStake(id common.Address, blockNumber uint64) (bool, uint64)

func (*StateDB) BuyPromissoryNotes

func (self *StateDB) BuyPromissoryNotes(orderId common.Hash, address common.Address, optionTxMemorySize uint64) types.PromissoryNotesOptionTx

func (*StateDB) CarriedOutPromissoryNotes

func (self *StateDB) CarriedOutPromissoryNotes(orderId common.Hash, address common.Address, optionTxMemorySize uint64) types.PromissoryNotesOptionTx

func (*StateDB) CheckUnlockSharedKey

func (self *StateDB) CheckUnlockSharedKey(address common.Address, shareKeyId string) bool

func (*StateDB) Commit

func (s *StateDB) Commit(deleteEmptyObjects bool) (root common.Hash, err error)

Commit writes the state to the underlying in-memory trie database.

func (*StateDB) Copy

func (self *StateDB) Copy() *StateDB

Copy creates a deep, independent copy of the state. Snapshots of the copied state cannot be applied to the copy.

func (*StateDB) CreateAccount

func (self *StateDB) CreateAccount(addr common.Address)

CreateAccount explicitly creates a state object. If a state object with the address already exists the balance is carried over to the new account.

CreateAccount is called during the EVM CREATE operation. The situation might arise that a contract does the following:

  1. sends funds to sha(account ++ (nonce + 1))
  2. tx_create(sha(account ++ nonce)) (note that this gets the address of 1)

Carrying over the balance ensures that Ether doesn't disappear.

func (*StateDB) Database

func (self *StateDB) Database() Database

Database retrieves the low level database supporting the lower level trie ops.

func (*StateDB) DelAccountInForbidBackStakeList

func (self *StateDB) DelAccountInForbidBackStakeList(address common.Address) bool

func (*StateDB) DelCandidate

func (self *StateDB) DelCandidate(candidate common.Address) bool

func (*StateDB) DelMainAccountBinding

func (self *StateDB) DelMainAccountBinding(mianAccount common.Address) []common.Address

func (*StateDB) DelPromissoryNote

func (self *StateDB) DelPromissoryNote(address common.Address, promissoryNote types.PromissoryNote) bool

func (*StateDB) DelSubAccountBinding

func (self *StateDB) DelSubAccountBinding(subAccount common.Address) bool

func (*StateDB) DelTxInOptionTxTable

func (self *StateDB) DelTxInOptionTxTable(hash common.Hash, optionTxMemorySize uint64) bool

func (*StateDB) DeleteStake

func (self *StateDB) DeleteStake(id common.Address, stake uint64, blockNumber uint64) (bool, uint64)

func (*StateDB) DeleteSuicides

func (s *StateDB) DeleteSuicides()

DeleteSuicides flags the suicided objects for deletion so that it won't be referenced again when called / queried up on.

DeleteSuicides should not be used for consensus related updates under any circumstances.

func (*StateDB) Dump

func (self *StateDB) Dump() []byte

func (*StateDB) Empty

func (self *StateDB) Empty(addr common.Address) bool

Empty returns whether the state object is either non-existent or empty according to the EIP161 specification (balance = nonce = code = 0)

func (*StateDB) Error

func (self *StateDB) Error() error

func (*StateDB) Exist

func (self *StateDB) Exist(addr common.Address) bool

Exist reports whether the given account address exists in the state. Notably this also returns true for suicided accounts.

func (*StateDB) Finalise

func (s *StateDB) Finalise(deleteEmptyObjects bool)

Finalise finalises the state by removing the self destructed objects and clears the journal as well as the refunds.

func (*StateDB) ForEachStorage

func (db *StateDB) ForEachStorage(addr common.Address, cb func(key, value common.Hash) bool)

func (*StateDB) GetAccountAttributes

func (self *StateDB) GetAccountAttributes(addr common.Address) types.GenaroData

func (*StateDB) GetAccountData

func (self *StateDB) GetAccountData(address common.Address) *Account

func (*StateDB) GetAddressByNode

func (self *StateDB) GetAddressByNode(s string) string

func (*StateDB) GetAllPromissoryNotesNum

func (self *StateDB) GetAllPromissoryNotesNum(address common.Address) uint64

func (*StateDB) GetAlreadyBackStakeList

func (self *StateDB) GetAlreadyBackStakeList() (bool, common.BackStakeList)

func (*StateDB) GetBalance

func (self *StateDB) GetBalance(addr common.Address) *big.Int

Retrieve the balance from the given address or 0 if object not found

func (*StateDB) GetBeforPromissoryNotesNum

func (self *StateDB) GetBeforPromissoryNotesNum(address common.Address, blockNumber uint64) uint64

func (*StateDB) GetBucketApplyPrice

func (self *StateDB) GetBucketApplyPrice() *big.Int

func (*StateDB) GetBuckets

func (self *StateDB) GetBuckets(addr common.Address) (map[string]interface{}, error)

func (*StateDB) GetCandidateInfoWithAllSubAccounts

func (self *StateDB) GetCandidateInfoWithAllSubAccounts(candidate common.Address) (candidateInfo CandidateInfo)

func (*StateDB) GetCandidates

func (self *StateDB) GetCandidates() Candidates

func (*StateDB) GetCandidatesInfoInRange

func (self *StateDB) GetCandidatesInfoInRange(blockNumStart uint64, blockNumEnd uint64) []CandidateInfo

func (*StateDB) GetCandidatesInfoWithAllSubAccounts

func (self *StateDB) GetCandidatesInfoWithAllSubAccounts() []CandidateInfo

func (*StateDB) GetCode

func (self *StateDB) GetCode(addr common.Address) []byte

func (*StateDB) GetCodeHash

func (self *StateDB) GetCodeHash(addr common.Address) common.Hash

func (*StateDB) GetCodeSize

func (self *StateDB) GetCodeSize(addr common.Address) int

func (*StateDB) GetCommitteeRank

func (self *StateDB) GetCommitteeRank(blockNumStart uint64, blockNumEnd uint64) ([]common.Address, []uint64)

func (*StateDB) GetFileSharePublicKey

func (self *StateDB) GetFileSharePublicKey(addr common.Address) string

func (*StateDB) GetForbidBackStakeList

func (self *StateDB) GetForbidBackStakeList() types.ForbidBackStakeList

func (*StateDB) GetGenaroCodeHash

func (self *StateDB) GetGenaroCodeHash(addr common.Address) string

only used in genaro

func (*StateDB) GetGenaroPrice

func (self *StateDB) GetGenaroPrice() *types.GenaroPrice

func (*StateDB) GetHeft

func (self *StateDB) GetHeft(id common.Address) (uint64, error)

func (*StateDB) GetHeftLastDiff

func (self *StateDB) GetHeftLastDiff(id common.Address, lastBlockNum uint64) uint64

func (*StateDB) GetHeftLog

func (self *StateDB) GetHeftLog(id common.Address) types.NumLogs

func (*StateDB) GetHeftRangeDiff

func (self *StateDB) GetHeftRangeDiff(id common.Address, blockNumStart uint64, blockNumEnd uint64) uint64

func (*StateDB) GetLastSynState

func (self *StateDB) GetLastSynState() *types.LastSynState

func (*StateDB) GetLogs

func (self *StateDB) GetLogs(hash common.Hash) []*types.Log

func (*StateDB) GetMainAccount

func (self *StateDB) GetMainAccount(subAccount common.Address) *common.Address

func (*StateDB) GetMainAccountRank

func (self *StateDB) GetMainAccountRank() ([]common.Address, []uint64)

func (*StateDB) GetMainAccounts

func (self *StateDB) GetMainAccounts() map[common.Address][]common.Address

func (*StateDB) GetNameAccount

func (self *StateDB) GetNameAccount(name string) (addr common.Address, err error)

func (*StateDB) GetNonce

func (self *StateDB) GetNonce(addr common.Address) uint64

func (*StateDB) GetOneDayGesCost

func (self *StateDB) GetOneDayGesCost() *big.Int

func (*StateDB) GetOneDaySyncLogGsaCost

func (self *StateDB) GetOneDaySyncLogGsaCost() *big.Int

func (*StateDB) GetOptionTxTable

func (self *StateDB) GetOptionTxTable(hash common.Hash, optionTxMemorySize uint64) *types.OptionTxTable

func (*StateDB) GetOptionTxTableByAddress

func (self *StateDB) GetOptionTxTableByAddress(address common.Address) *types.OptionTxTable

func (*StateDB) GetOrNewStateObject

func (self *StateDB) GetOrNewStateObject(addr common.Address) *stateObject

Retrieve a state object or create a new state object if nil

func (*StateDB) GetPromissoryNotes

func (self *StateDB) GetPromissoryNotes(address common.Address) types.PromissoryNotes

func (*StateDB) GetRefund

func (self *StateDB) GetRefund() uint64

GetRefund returns the current value of the refund counter.

func (*StateDB) GetRewardsValues

func (self *StateDB) GetRewardsValues() *types.RewardsValues

func (*StateDB) GetSharedFile

func (self *StateDB) GetSharedFile(address common.Address, shareKeyId string) types.SynchronizeShareKey

func (*StateDB) GetStake

func (self *StateDB) GetStake(id common.Address) (uint64, error)

func (*StateDB) GetStakeLog

func (self *StateDB) GetStakeLog(id common.Address) types.NumLogs

func (*StateDB) GetStakePerNodePrice

func (self *StateDB) GetStakePerNodePrice() *big.Int

func (*StateDB) GetStakeRangeDiff

func (self *StateDB) GetStakeRangeDiff(id common.Address, blockNumStart uint64, blockNumEnd uint64) uint64

func (*StateDB) GetState

func (self *StateDB) GetState(a common.Address, b common.Hash) common.Hash

func (*StateDB) GetStorageGas

func (self *StateDB) GetStorageGas(userid common.Address, bucketID [32]byte) (uint64, error)

func (*StateDB) GetStorageGasPrice

func (self *StateDB) GetStorageGasPrice(userid common.Address, bucketID [32]byte) (uint64, error)

func (*StateDB) GetStorageGasUsed

func (self *StateDB) GetStorageGasUsed(userid common.Address, bucketID [32]byte) (uint64, error)

func (*StateDB) GetStorageNodes

func (self *StateDB) GetStorageNodes(addr common.Address) []string

func (*StateDB) GetStorageSize

func (self *StateDB) GetStorageSize(userid common.Address, bucketID [32]byte) (uint64, error)

func (*StateDB) GetSubAccounts

func (self *StateDB) GetSubAccounts(mianAccount common.Address) []common.Address

func (*StateDB) GetSubAccountsCount

func (self *StateDB) GetSubAccountsCount(mainAccount common.Address) int

func (*StateDB) GetTraffic

func (self *StateDB) GetTraffic(addr common.Address) uint64

func (*StateDB) GetTrafficApplyPrice

func (self *StateDB) GetTrafficApplyPrice() *big.Int

func (*StateDB) HasName

func (self *StateDB) HasName(addr common.Address, name string) bool

func (*StateDB) HasSuicided

func (self *StateDB) HasSuicided(addr common.Address) bool

func (*StateDB) IntermediateRoot

func (s *StateDB) IntermediateRoot(deleteEmptyObjects bool) common.Hash

IntermediateRoot computes the current root hash of the state trie. It is called in between transactions to get the root hash that goes into transaction receipts.

func (*StateDB) IsAccountExistInForbidBackStakeList

func (self *StateDB) IsAccountExistInForbidBackStakeList(address common.Address) bool

func (*StateDB) IsAlreadyBackStake

func (self *StateDB) IsAlreadyBackStake(addr common.Address) bool

func (*StateDB) IsBindingAccount

func (self *StateDB) IsBindingAccount(account common.Address) bool

func (*StateDB) IsBindingMainAccount

func (self *StateDB) IsBindingMainAccount(account common.Address) bool

func (*StateDB) IsBindingSubAccount

func (self *StateDB) IsBindingSubAccount(account common.Address) bool

func (*StateDB) IsCandidateExist

func (self *StateDB) IsCandidateExist(candidate common.Address) bool

func (*StateDB) IsContract

func (self *StateDB) IsContract(addr common.Address) bool

func (*StateDB) IsNameAccountExist

func (self *StateDB) IsNameAccountExist(name string) (bool, error)

func (*StateDB) Logs

func (self *StateDB) Logs() []*types.Log

func (*StateDB) MarkStateObjectDirty

func (self *StateDB) MarkStateObjectDirty(addr common.Address)

MarkStateObjectDirty adds the specified object to the dirty map to avoid costly state object cache iteration to find a handful of modified ones.

func (*StateDB) Preimages

func (self *StateDB) Preimages() map[common.Hash][]byte

Preimages returns a list of SHA3 preimages that have been submitted.

func (*StateDB) Prepare

func (self *StateDB) Prepare(thash, bhash common.Hash, ti int)

Prepare sets the current transaction hash and index and block hash which is used when the EVM emits new state logs.

func (*StateDB) PromissoryNotesWithdrawCash

func (self *StateDB) PromissoryNotesWithdrawCash(address common.Address, blockNumber uint64) uint64

func (*StateDB) RawDump

func (self *StateDB) RawDump() Dump

func (*StateDB) Reset

func (self *StateDB) Reset(root common.Hash) error

Reset clears out all ephemeral state objects from the state db, but keeps the underlying state trie to avoid reloading data for the next operations.

func (*StateDB) RevertToSnapshot

func (self *StateDB) RevertToSnapshot(revid int)

RevertToSnapshot reverts all state changes made since the given revision.

func (*StateDB) SetAlreadyBackStakeList

func (self *StateDB) SetAlreadyBackStakeList(backStacks common.BackStakeList) bool

func (*StateDB) SetBalance

func (self *StateDB) SetBalance(addr common.Address, amount *big.Int)

func (*StateDB) SetCode

func (self *StateDB) SetCode(addr common.Address, code []byte)

func (*StateDB) SetCodeHash

func (self *StateDB) SetCodeHash(addr common.Address, codeHash []byte)

only used in genaro genesis init

func (*StateDB) SetGenaroPrice

func (self *StateDB) SetGenaroPrice(genaroPrice types.GenaroPrice) bool

func (*StateDB) SetLastSynBlock

func (self *StateDB) SetLastSynBlock(blockNumber uint64, blockHash common.Hash) bool

func (*StateDB) SetNameAccount

func (self *StateDB) SetNameAccount(name string, addr common.Address) (err error)

func (*StateDB) SetNonce

func (self *StateDB) SetNonce(addr common.Address, nonce uint64)

func (*StateDB) SetRewardsValues

func (self *StateDB) SetRewardsValues(rewardsValues types.RewardsValues) bool

func (*StateDB) SetState

func (self *StateDB) SetState(addr common.Address, key common.Hash, value common.Hash)

func (*StateDB) SetTxStatusInOptionTxTable

func (self *StateDB) SetTxStatusInOptionTxTable(hash common.Hash, status bool, optionTxMemorySize uint64) bool

func (*StateDB) Snapshot

func (self *StateDB) Snapshot() int

Snapshot returns an identifier for the current revision of the state.

func (*StateDB) SpecialTxTypeMortgageInit

func (self *StateDB) SpecialTxTypeMortgageInit(address common.Address, specialTxTypeMortgageInit types.SpecialTxTypeMortgageInit) bool

func (*StateDB) SpecialTxTypeSyncSidechainStatus

func (self *StateDB) SpecialTxTypeSyncSidechainStatus(address common.Address, SpecialTxTypeSyncSidechainStatus types.SpecialTxTypeMortgageInit) (map[common.Address]*big.Int, bool)

func (*StateDB) StorageTrie

func (self *StateDB) StorageTrie(a common.Address) Trie

StorageTrie returns the storage trie of an account. The return value is a copy and is nil for non-existent accounts.

func (*StateDB) SubBalance

func (self *StateDB) SubBalance(addr common.Address, amount *big.Int)

SubBalance subtracts amount from the account associated with addr

func (*StateDB) Suicide

func (self *StateDB) Suicide(addr common.Address) bool

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.

func (*StateDB) SyncNode2Address

func (self *StateDB) SyncNode2Address(node2UserAccountIndexAddress common.Address, s string, userAddress string) error

func (*StateDB) SyncStakeNode

func (self *StateDB) SyncStakeNode(address common.Address, s string) error

func (*StateDB) SynchronizeShareKey

func (self *StateDB) SynchronizeShareKey(address common.Address, synchronizeShareKey types.SynchronizeShareKey) bool

func (*StateDB) TurnBuyPromissoryNotes

func (self *StateDB) TurnBuyPromissoryNotes(orderId common.Hash, optionPrice *hexutil.Big, address common.Address, optionTxMemorySize uint64) bool

func (*StateDB) TxLogByDataVersionRead

func (self *StateDB) TxLogByDataVersionRead(address common.Address, fileID [32]byte, dataVersion string) (map[common.Address]*hexutil.Big, error)

func (*StateDB) TxLogBydataVersionUpdate

func (self *StateDB) TxLogBydataVersionUpdate(address common.Address, fileID [32]byte, OfficialAddress common.Address) bool

func (*StateDB) UbindNode2Address

func (self *StateDB) UbindNode2Address(address common.Address, nodeId string) error

func (*StateDB) UnbindNode

func (self *StateDB) UnbindNode(address common.Address, nodeId string) error

func (*StateDB) UnlockSharedKey

func (self *StateDB) UnlockSharedKey(address common.Address, shareKeyId string) bool

func (*StateDB) UpdateAccountBinding

func (self *StateDB) UpdateAccountBinding(mainAccount common.Address, subAccount common.Address) bool

func (*StateDB) UpdateBucket

func (self *StateDB) UpdateBucket(addr common.Address, bucket types.BucketPropertie) bool

func (*StateDB) UpdateBucketApplyPrice

func (self *StateDB) UpdateBucketApplyPrice(address common.Address, price *hexutil.Big) bool

func (*StateDB) UpdateBucketProperties

func (self *StateDB) UpdateBucketProperties(userid common.Address, bucketid string, size uint64, backup uint64, timestart uint64, timeend uint64) bool

func (*StateDB) UpdateFileSharePublicKey

func (self *StateDB) UpdateFileSharePublicKey(id common.Address, publicKey string) bool

func (*StateDB) UpdateHeft

func (self *StateDB) UpdateHeft(id common.Address, heft uint64, blockNumber uint64) bool

func (*StateDB) UpdateOneDayGesCost

func (self *StateDB) UpdateOneDayGesCost(address common.Address, price *hexutil.Big) bool

func (*StateDB) UpdateOneDaySyncLogGsaCost

func (self *StateDB) UpdateOneDaySyncLogGsaCost(address common.Address, price *hexutil.Big) bool

func (*StateDB) UpdateStake

func (self *StateDB) UpdateStake(id common.Address, stake uint64, blockNumber uint64) bool

func (*StateDB) UpdateStakePerNodePrice

func (self *StateDB) UpdateStakePerNodePrice(address common.Address, price *hexutil.Big) bool

func (*StateDB) UpdateTraffic

func (self *StateDB) UpdateTraffic(id common.Address, traffic uint64) bool

func (*StateDB) UpdateTrafficApplyPrice

func (self *StateDB) UpdateTrafficApplyPrice(address common.Address, price *hexutil.Big) bool

type Storage

type Storage map[common.Hash]common.Hash

func (Storage) Copy

func (self Storage) Copy() Storage

func (Storage) String

func (self Storage) String() (str string)

type Trie

type Trie interface {
	TryGet(key []byte) ([]byte, error)
	TryUpdate(key, value []byte) error
	TryDelete(key []byte) error
	Commit(onleaf trie.LeafCallback) (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 ethdb.Putter) error
}

Trie is a Ethereum Merkle Trie.

Jump to

Keyboard shortcuts

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