chain

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2020 License: LGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockChain

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

func NewBlockChain

func NewBlockChain(chainID uint16, deputyCount int, dbEngine database.DBEngine) (bc *BlockChain, err error)

func (*BlockChain) ChainID

func (bc *BlockChain) ChainID() uint16

ChainID

func (*BlockChain) CurrentBlock

func (bc *BlockChain) CurrentBlock() *types.Block

CurrentBlock get latest current block

func (*BlockChain) DeputyManager

func (bc *BlockChain) DeputyManager() *deputynode.Manager

func (*BlockChain) Genesis

func (bc *BlockChain) Genesis() *types.Block

Genesis genesis block

func (*BlockChain) GetBlockByHash

func (bc *BlockChain) GetBlockByHash(hash common.Hash) *types.Block

func (*BlockChain) GetBlockByHeight

func (bc *BlockChain) GetBlockByHeight(height uint32) *types.Block

func (*BlockChain) HasBlock

func (bc *BlockChain) HasBlock(hash common.Hash) bool

HasBlock has special block in local

func (*BlockChain) InsertBlock added in v1.2.0

func (bc *BlockChain) InsertBlock(block *types.Block) error

func (*BlockChain) InsertConfirms added in v1.2.0

func (bc *BlockChain) InsertConfirms(height uint32, blockHash common.Hash, sigList []types.SignData)

not used. just for implement interface

func (*BlockChain) InsertStableConfirms added in v1.2.0

func (bc *BlockChain) InsertStableConfirms(pack coreNet.BlockConfirms)

func (*BlockChain) IsInBlackList added in v1.2.0

func (bc *BlockChain) IsInBlackList(b *types.Block) bool

func (*BlockChain) StableBlock

func (bc *BlockChain) StableBlock() *types.Block

StableBlock get latest stable block

type ReBuildAccount

type ReBuildAccount struct {
	types.AccountData

	Store database.DBEngine
	Code  []byte

	AssetCodes    map[common.Hash]*types.Asset
	MetaDatas     map[common.Hash]string
	AssetEquities map[common.Hash]*types.AssetEquity
	Storage       map[common.Hash][]byte
	Events        []*types.Event

	IsCancelCandidate bool

	NextVersion map[types.ChangeLogType]uint32
	// contains filtered or unexported fields
}

func NewReBuildAccount

func NewReBuildAccount(store database.DBEngine, data *types.AccountData) *ReBuildAccount

func (*ReBuildAccount) BuildAccountData

func (account *ReBuildAccount) BuildAccountData() *types.AccountData

func (*ReBuildAccount) GetAddress

func (account *ReBuildAccount) GetAddress() common.Address

func (*ReBuildAccount) GetAssetCode

func (account *ReBuildAccount) GetAssetCode(code common.Hash) (*types.Asset, error)

func (*ReBuildAccount) GetAssetCodeFromDB

func (account *ReBuildAccount) GetAssetCodeFromDB(code common.Hash) (*types.Asset, error)

func (*ReBuildAccount) GetAssetCodeRoot

func (account *ReBuildAccount) GetAssetCodeRoot() common.Hash

func (*ReBuildAccount) GetAssetCodeState

func (account *ReBuildAccount) GetAssetCodeState(code common.Hash, key string) (string, error)

func (*ReBuildAccount) GetAssetCodeTotalSupply

func (account *ReBuildAccount) GetAssetCodeTotalSupply(code common.Hash) (*big.Int, error)

func (*ReBuildAccount) GetAssetIdRoot

func (account *ReBuildAccount) GetAssetIdRoot() common.Hash

func (*ReBuildAccount) GetAssetIdState

func (account *ReBuildAccount) GetAssetIdState(id common.Hash) (string, error)

func (*ReBuildAccount) GetBalance

func (account *ReBuildAccount) GetBalance() *big.Int

func (*ReBuildAccount) GetCandidate

func (account *ReBuildAccount) GetCandidate() types.Profile

func (*ReBuildAccount) GetCandidateState

func (account *ReBuildAccount) GetCandidateState(key string) string

func (*ReBuildAccount) GetCode

func (account *ReBuildAccount) GetCode() (types.Code, error)

func (*ReBuildAccount) GetCodeHash

func (account *ReBuildAccount) GetCodeHash() common.Hash

func (*ReBuildAccount) GetEquity

func (account *ReBuildAccount) GetEquity(id common.Hash) (*types.AssetEquity, error)

func (*ReBuildAccount) GetEquityRoot

func (account *ReBuildAccount) GetEquityRoot() common.Hash

func (*ReBuildAccount) GetEquityState

func (account *ReBuildAccount) GetEquityState(id common.Hash) (*types.AssetEquity, error)

func (*ReBuildAccount) GetEvents

func (account *ReBuildAccount) GetEvents() []*types.Event

func (*ReBuildAccount) GetNextVersion

func (account *ReBuildAccount) GetNextVersion(logType types.ChangeLogType) uint32

func (*ReBuildAccount) GetSigners added in v1.2.0

func (account *ReBuildAccount) GetSigners() types.Signers

func (*ReBuildAccount) GetStorageRoot

func (account *ReBuildAccount) GetStorageRoot() common.Hash

func (*ReBuildAccount) GetStorageState

func (account *ReBuildAccount) GetStorageState(key common.Hash) ([]byte, error)

func (*ReBuildAccount) GetSuicide

func (account *ReBuildAccount) GetSuicide() bool

func (*ReBuildAccount) GetVersion

func (account *ReBuildAccount) GetVersion(logType types.ChangeLogType) uint32

func (*ReBuildAccount) GetVoteFor

func (account *ReBuildAccount) GetVoteFor() common.Address

func (*ReBuildAccount) GetVotes

func (account *ReBuildAccount) GetVotes() *big.Int

func (*ReBuildAccount) IsEmpty

func (account *ReBuildAccount) IsEmpty() bool

func (*ReBuildAccount) MarshalJSON

func (account *ReBuildAccount) MarshalJSON() ([]byte, error)

func (*ReBuildAccount) PopEvent

func (account *ReBuildAccount) PopEvent() error

func (*ReBuildAccount) PushEvent

func (account *ReBuildAccount) PushEvent(event *types.Event)

func (*ReBuildAccount) SetAssetCode

func (account *ReBuildAccount) SetAssetCode(code common.Hash, asset *types.Asset) error

func (*ReBuildAccount) SetAssetCodeRoot

func (account *ReBuildAccount) SetAssetCodeRoot(root common.Hash)

func (*ReBuildAccount) SetAssetCodeState

func (account *ReBuildAccount) SetAssetCodeState(code common.Hash, key string, val string) error

func (*ReBuildAccount) SetAssetCodeTotalSupply

func (account *ReBuildAccount) SetAssetCodeTotalSupply(code common.Hash, val *big.Int) error

func (*ReBuildAccount) SetAssetIdRoot

func (account *ReBuildAccount) SetAssetIdRoot(root common.Hash)

func (*ReBuildAccount) SetAssetIdState

func (account *ReBuildAccount) SetAssetIdState(id common.Hash, data string) error

func (*ReBuildAccount) SetBalance

func (account *ReBuildAccount) SetBalance(balance *big.Int)

func (*ReBuildAccount) SetCandidate

func (account *ReBuildAccount) SetCandidate(profile types.Profile)

func (*ReBuildAccount) SetCandidateState

func (account *ReBuildAccount) SetCandidateState(key string, val string)

func (*ReBuildAccount) SetCode

func (account *ReBuildAccount) SetCode(code types.Code)

func (*ReBuildAccount) SetCodeHash

func (account *ReBuildAccount) SetCodeHash(codeHash common.Hash)

func (*ReBuildAccount) SetEquityRoot

func (account *ReBuildAccount) SetEquityRoot(root common.Hash)

func (*ReBuildAccount) SetEquityState

func (account *ReBuildAccount) SetEquityState(id common.Hash, equity *types.AssetEquity) error

func (*ReBuildAccount) SetSingers added in v1.2.0

func (account *ReBuildAccount) SetSingers(signers types.Signers) error

func (*ReBuildAccount) SetStorageRoot

func (account *ReBuildAccount) SetStorageRoot(root common.Hash)

func (*ReBuildAccount) SetStorageState

func (account *ReBuildAccount) SetStorageState(key common.Hash, value []byte) error

func (*ReBuildAccount) SetSuicide

func (account *ReBuildAccount) SetSuicide(suicided bool)

func (*ReBuildAccount) SetVoteFor

func (account *ReBuildAccount) SetVoteFor(addr common.Address)

func (*ReBuildAccount) SetVotes

func (account *ReBuildAccount) SetVotes(votes *big.Int)

type ReBuildEngine

type ReBuildEngine struct {
	Store                database.DBEngine
	Block                *types.Block
	ReBuildAccountsCache map[common.Address]*ReBuildAccount
}

func NewReBuildEngine

func NewReBuildEngine(store database.DBEngine, block *types.Block) *ReBuildEngine

func (*ReBuildEngine) Close

func (engine *ReBuildEngine) Close()

func (*ReBuildEngine) GetAccount

func (engine *ReBuildEngine) GetAccount(address common.Address) types.AccountAccessor

func (*ReBuildEngine) ReBuild

func (engine *ReBuildEngine) ReBuild() error

func (*ReBuildEngine) Save

func (engine *ReBuildEngine) Save() error

type TxPool

type TxPool struct {
}

TxPool add filter in future

func NewTxPool

func NewTxPool() *TxPool

func (*TxPool) AddTx

func (tp *TxPool) AddTx(tx *types.Transaction) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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