Versions in this module Expand all Collapse all v1 v1.0.0 Apr 12, 2019 Changes in this version + var AccFactory = &AccountFactory + func NewTxPool(chainconfig chain_config.ChainConfig, chain blockChain) *tx_pool.TxPool + type Account struct + Pk *ecdsa.PrivateKey + func ChangeVerBootNodeAddress() ([]Account, error) + func ChangeVerifierAddress(accounts []Account) ([]Account, error) + func NewAccount(pk *ecdsa.PrivateKey, address common.Address) *Account + func (a *Account) Address() common.Address + func (a *Account) SignHash(hash []byte) ([]byte, error) + type AccountFactory struct + func (acc *AccountFactory) GenAccount() Account + func (acc *AccountFactory) GenAccounts(x int) (r []Account) + func (acc *AccountFactory) GetAccount(index int) Account + type Accounts []Account + func (as Accounts) GetAddresses() (r []common.Address) + type BftChainState interface + SaveBftBlock func(block model.AbstractBlock, seenCommits []model.AbstractVerification) error + type BftCluster struct + BftStates []*state_machine.BftState + Verifiers []Account + func NewBftCluster(verifiers []Account) *BftCluster + func (bc *BftCluster) NewProposal(x int, round uint64, block model2.AbstractBlock) (p []*model.Proposal) + func (bc *BftCluster) NewRoundMsg(x int, h, round uint64) (r []*model.NewRoundMsg) + func (bc *BftCluster) NewVote(x int, round uint64, vt model2.VoteMsgType, block model2.AbstractBlock) (p []*model2.VoteMsg) + func (bc *BftCluster) StatesIter(cb func(*state_machine.BftState)) + type BlockBuilder struct + ChainState Chain + InvalidTxList []model.AbstractTransaction + MinerPk *ecdsa.PrivateKey + PreBlock model.AbstractBlock + Txs []*model.Transaction + Vers []model.AbstractVerification + func (builder *BlockBuilder) Build() model.AbstractBlock + func (builder *BlockBuilder) BuildFuture() model.AbstractBlock + func (builder *BlockBuilder) BuildSpecialBlock() model.AbstractBlock + func (builder *BlockBuilder) ClearInvalidTxList() + func (builder *BlockBuilder) SetMinerPk(pk *ecdsa.PrivateKey) + func (builder *BlockBuilder) SetPreBlock(block model.AbstractBlock) + func (builder *BlockBuilder) SetVerifivations(votes []model.AbstractVerification) + type Chain interface + type ChainHelper interface + GetChainConfig func() *chain_config.ChainConfig + GetChainDB func() chaindb.Database + GetEconomyModel func() economy_model.EconomyModel + type FakeBlockForBft struct + Num uint64 + PHash common.Hash + func (fb *FakeBlockForBft) Body() model2.AbstractBody + func (fb *FakeBlockForBft) CoinBase() *big.Int + func (fb *FakeBlockForBft) CoinBaseAddress() common.Address + func (fb *FakeBlockForBft) Difficulty() common.Difficulty + func (fb *FakeBlockForBft) EncodeRlpToBytes() ([]byte, error) + func (fb *FakeBlockForBft) FormatForRpc() interface{} + func (fb *FakeBlockForBft) GetAbsTransactions() []model2.AbstractTransaction + func (fb *FakeBlockForBft) GetBlockTxsBloom() *iblt.Bloom + func (fb *FakeBlockForBft) GetBloom() iblt.Bloom + func (fb *FakeBlockForBft) GetEiBloomBlockData(reqEstimator *iblt.HybridEstimator) *model2.BloomBlockData + func (fb *FakeBlockForBft) GetInterLinkRoot() (root common.Hash) + func (fb *FakeBlockForBft) GetInterlinks() model2.InterLink + func (fb *FakeBlockForBft) GetRegisterRoot() common.Hash + func (fb *FakeBlockForBft) GetTransactionFees() *big.Int + func (fb *FakeBlockForBft) GetTransactions() []*model2.Transaction + func (fb *FakeBlockForBft) GetVerifications() []model2.AbstractVerification + func (fb *FakeBlockForBft) Hash() common.Hash + func (fb *FakeBlockForBft) Header() model2.AbstractHeader + func (fb *FakeBlockForBft) IsSpecial() bool + func (fb *FakeBlockForBft) Nonce() common.BlockNonce + func (fb *FakeBlockForBft) Number() uint64 + func (fb *FakeBlockForBft) PreHash() common.Hash + func (fb *FakeBlockForBft) RefreshHashCache() common.Hash + func (fb *FakeBlockForBft) Seed() common.Hash + func (fb *FakeBlockForBft) SetInterLinkRoot(root common.Hash) + func (fb *FakeBlockForBft) SetInterLinks(inter model2.InterLink) + func (fb *FakeBlockForBft) SetNonce(nonce common.BlockNonce) + func (fb *FakeBlockForBft) SetRegisterRoot(root common.Hash) + func (fb *FakeBlockForBft) SetStateRoot(root common.Hash) + func (fb *FakeBlockForBft) SetVerifications(vs []model2.AbstractVerification) + func (fb *FakeBlockForBft) StateRoot() common.Hash + func (fb *FakeBlockForBft) Timestamp() *big.Int + func (fb *FakeBlockForBft) TxCount() int + func (fb *FakeBlockForBft) TxIterator(cb func(int, model2.AbstractTransaction) error) error + func (fb *FakeBlockForBft) TxRoot() common.Hash + func (fb *FakeBlockForBft) VerificationRoot() common.Hash + func (fb *FakeBlockForBft) VersIterator(func(int, model2.AbstractVerification, model2.AbstractBlock) error) error + func (fb *FakeBlockForBft) Version() uint64 + type GenesisEnv struct + func NewGenesisEnv(chainDB chaindb.Database, stateStorage state_processor.StateStorage, ...) *GenesisEnv + func (g *GenesisEnv) DefaultVerifiers() []Account + func (g *GenesisEnv) Miner() Account + func (g *GenesisEnv) VoteBlock(num int, round uint64, b model.AbstractBlock) (result []model.AbstractVerification) + type StateHelper interface + BuildStateProcessor func(preAccountStateRoot common.Hash) (*state_processor.AccountStateDB, error) + CurrentState func() (*state_processor.AccountStateDB, error) + GetStateStorage func() state_processor.StateStorage + StateAtByBlockNumber func(num uint64) (*state_processor.AccountStateDB, error) + StateAtByStateRoot func(root common.Hash) (*state_processor.AccountStateDB, error) + type StateReader interface + BlockProcessor func(root common.Hash) (*chain.BlockProcessor, error) + BlockProcessorByNumber func(num uint64) (*chain.BlockProcessor, error) + CurrentBlock func() model.AbstractBlock + CurrentHeader func() model.AbstractHeader + Genesis func() model.AbstractBlock + GetBlock func(hash common.Hash, number uint64) model.AbstractBlock + GetBlockByHash func(hash common.Hash) model.AbstractBlock + GetBlockByNumber func(number uint64) model.AbstractBlock + GetBlockNumber func(hash common.Hash) *uint64 + GetBody func(hash common.Hash) model.AbstractBody + GetBodyRLP func(hash common.Hash) rlp.RawValue + GetHeader func(hash common.Hash, number uint64) model.AbstractHeader + GetHeaderByHash func(hash common.Hash) model.AbstractHeader + GetHeaderByNumber func(number uint64) model.AbstractHeader + GetHeaderRLP func(hash common.Hash) rlp.RawValue + GetTransaction func(txHash common.Hash) (model.AbstractTransaction, common.Hash, uint64, uint64) + HasBlock func(hash common.Hash, number uint64) bool + HasHeader func(hash common.Hash, number uint64) bool + type StateWriter interface + SaveBlock func(block model.AbstractBlock) error + type TxBuilder struct + Amount *big.Int + Data []byte + Fee *big.Int + Nonce uint64 + Pk *ecdsa.PrivateKey + To common.Address + func (b *TxBuilder) Build() *model.Transaction + func (b *TxBuilder) BuildAbs() model.AbstractTransaction + func (b *TxBuilder) From() common.Address + type VerBuilder struct + Block model.AbstractBlock + Pk *ecdsa.PrivateKey + Round uint64 + VoteType model.VoteMsgType + func (b *VerBuilder) Build() model.AbstractVerification + type VerifierHelper interface + BuildRegisterProcessor func(preRoot common.Hash) (*registerdb.RegisterDB, error) + CurrentSeed func() (common.Hash, uint64) + GetCurrVerifiers func() []common.Address + GetLastChangePoint func(block model.AbstractBlock) *uint64 + GetNextVerifiers func() []common.Address + GetSlot func(block model.AbstractBlock) *uint64 + GetSlotByNum func(num uint64) *uint64 + GetVerifiers func(round uint64) []common.Address + IsChangePoint func(block model.AbstractBlock, isProcessPackageBlock bool) bool + NumBeforeLastBySlot func(slot uint64) *uint64