Documentation ¶
Index ¶
- Variables
- type Block
- type ETHChain
- func (self *ETHChain) APIBackend() *eth.EthAPIBackend
- func (self *ETHChain) Accept(block *types.Block) error
- func (self *ETHChain) AddLocalTxs(txs []*types.Transaction) []error
- func (self *ETHChain) AddRemoteTxs(txs []*types.Transaction) []error
- func (self *ETHChain) AttachEthService(handler *rpc.Server, namespaces []string)
- func (self *ETHChain) BlockChain() *core.BlockChain
- func (self *ETHChain) BlockState(block *types.Block) (*state.StateDB, error)
- func (self *ETHChain) CurrentState() (*state.StateDB, error)
- func (self *ETHChain) GenBlock()
- func (self *ETHChain) GetBlockByHash(hash common.Hash) *types.Block
- func (self *ETHChain) GetBlockByNumber(num uint64) *types.Block
- func (self *ETHChain) GetGenesisBlock() *types.Block
- func (self *ETHChain) GetReceiptsByHash(hash common.Hash) types.Receipts
- func (self *ETHChain) GetTxAcceptedSubmitCh() <-chan core.NewTxsEvent
- func (self *ETHChain) GetTxPool() *core.TxPool
- func (self *ETHChain) GetTxSubmitCh() <-chan core.NewTxsEvent
- func (self *ETHChain) InsertChain(chain []*types.Block) (int, error)
- func (self *ETHChain) LastAcceptedBlock() *types.Block
- func (self *ETHChain) PendingSize() (int, error)
- func (self *ETHChain) SetGasPrice(newGasPrice *big.Int)
- func (self *ETHChain) SetOnAPIs(cb dummy.OnAPIsCallbackType)
- func (self *ETHChain) SetOnExtraStateChange(cb dummy.OnExtraStateChangeType)
- func (self *ETHChain) SetOnFinalize(cb dummy.OnFinalizeCallbackType)
- func (self *ETHChain) SetOnFinalizeAndAssemble(cb dummy.OnFinalizeAndAssembleCallbackType)
- func (self *ETHChain) SetOnSeal(cb func(*types.Block) error)
- func (self *ETHChain) SetOnSealDrop(cb func(*types.Block))
- func (self *ETHChain) SetOnSealFinish(cb func(*types.Block) error)
- func (self *ETHChain) SetOnSealHash(cb func(*types.Header))
- func (self *ETHChain) SetPreference(block *types.Block) error
- func (self *ETHChain) Start() error
- func (self *ETHChain) Stop()
- func (self *ETHChain) SubscribeNewMinedBlockEvent() *event.TypeMuxSubscription
- func (self *ETHChain) ValidateCanonicalChain() error
- func (self *ETHChain) WriteCanonicalFromCurrentBlock(toBlock *types.Block) error
- type Hash
- type Tx
Constants ¶
This section is empty.
Variables ¶
var (
BlackholeAddr = common.Address{
1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
}
)
Functions ¶
This section is empty.
Types ¶
type ETHChain ¶
type ETHChain struct {
// contains filtered or unexported fields
}
func NewDefaultChain ¶
func NewDefaultChain(t *testing.T) (*ETHChain, chan *types.Block, chan core.NewTxPoolHeadEvent, <-chan core.NewTxsEvent)
func NewETHChain ¶
func NewETHChain(config *eth.Config, nodecfg *node.Config, chainDB ethdb.Database, settings eth.Settings, initGenesis bool, onTxSubmitted func(*types.Transaction) error) *ETHChain
NewETHChain creates an Ethereum blockchain with the given configs.
func (*ETHChain) APIBackend ¶
func (self *ETHChain) APIBackend() *eth.EthAPIBackend
func (*ETHChain) Accept ¶
Accept sets a minimum height at which no reorg can pass. Additionally, this function may trigger a reorg if the block being accepted is not in the canonical chain.
func (*ETHChain) AddLocalTxs ¶
func (self *ETHChain) AddLocalTxs(txs []*types.Transaction) []error
func (*ETHChain) AddRemoteTxs ¶
func (self *ETHChain) AddRemoteTxs(txs []*types.Transaction) []error
func (*ETHChain) AttachEthService ¶
func (*ETHChain) BlockChain ¶
func (self *ETHChain) BlockChain() *core.BlockChain
func (*ETHChain) BlockState ¶
Returns a new mutable state based on the given block.
func (*ETHChain) CurrentState ¶
Returns a new mutable state based on the current HEAD block.
func (*ETHChain) GetBlockByHash ¶
Retrives a block from the database by hash.
func (*ETHChain) GetBlockByNumber ¶
Retrives a block from the database by number.
func (*ETHChain) GetGenesisBlock ¶
func (*ETHChain) GetReceiptsByHash ¶
func (*ETHChain) GetTxAcceptedSubmitCh ¶
func (self *ETHChain) GetTxAcceptedSubmitCh() <-chan core.NewTxsEvent
func (*ETHChain) GetTxSubmitCh ¶
func (self *ETHChain) GetTxSubmitCh() <-chan core.NewTxsEvent
func (*ETHChain) LastAcceptedBlock ¶
LastAcceptedBlock returns the last block to be marked as accepted.
func (*ETHChain) PendingSize ¶
func (*ETHChain) SetGasPrice ¶
SetGasPrice sets the gas price on the backend
func (*ETHChain) SetOnAPIs ¶
func (self *ETHChain) SetOnAPIs(cb dummy.OnAPIsCallbackType)
func (*ETHChain) SetOnExtraStateChange ¶
func (self *ETHChain) SetOnExtraStateChange(cb dummy.OnExtraStateChangeType)
func (*ETHChain) SetOnFinalize ¶
func (self *ETHChain) SetOnFinalize(cb dummy.OnFinalizeCallbackType)
func (*ETHChain) SetOnFinalizeAndAssemble ¶
func (self *ETHChain) SetOnFinalizeAndAssemble(cb dummy.OnFinalizeAndAssembleCallbackType)
func (*ETHChain) SetOnSealDrop ¶
func (*ETHChain) SetOnSealFinish ¶
func (*ETHChain) SetOnSealHash ¶
func (*ETHChain) SetPreference ¶
SetPreference sets the current head block to the one provided as an argument regardless of what the chain contents were prior.
func (*ETHChain) SubscribeNewMinedBlockEvent ¶
func (self *ETHChain) SubscribeNewMinedBlockEvent() *event.TypeMuxSubscription
func (*ETHChain) ValidateCanonicalChain ¶
Validate the canonical chain from current block to the genesis. This should only be called as a convenience method in tests, not in production as it traverses the entire chain.
type Tx ¶
type Tx = types.Transaction