Documentation ¶
Index ¶
- type ChainContext
- func (cc *ChainContext) APIs(_ ethconsensus.ChainReader) []ethrpc.API
- func (cc *ChainContext) Author(_ *ethtypes.Header) (ethcommon.Address, error)
- func (cc *ChainContext) CalcDifficulty(_ ethconsensus.ChainReader, _ uint64, _ *ethtypes.Header) *big.Int
- func (cc *ChainContext) Engine() ethconsensus.Engine
- func (cc *ChainContext) Finalize(_ ethconsensus.ChainReader, _ *ethtypes.Header, _ *ethstate.StateDB, ...) (*ethtypes.Block, error)
- func (cc *ChainContext) GetHeader(ethcommon.Hash, uint64) *ethtypes.Header
- func (cc *ChainContext) Prepare(_ ethconsensus.ChainReader, _ *ethtypes.Header) error
- func (cc *ChainContext) Seal(_ ethconsensus.ChainReader, _ *ethtypes.Block, _ <-chan struct{}) (*ethtypes.Block, error)
- func (cc *ChainContext) VerifyHeader(_ ethconsensus.ChainReader, _ *ethtypes.Header, _ bool) error
- func (cc *ChainContext) VerifyHeaders(_ ethconsensus.ChainReader, _ []*ethtypes.Header, _ []bool) (chan<- struct{}, <-chan error)
- func (cc *ChainContext) VerifySeal(_ ethconsensus.ChainReader, _ *ethtypes.Header) error
- func (cc *ChainContext) VerifyUncles(_ ethconsensus.ChainReader, _ *ethtypes.Block) error
- type EthereumDB
- func (edb *EthereumDB) Close()
- func (edb *EthereumDB) Delete(key []byte) error
- func (edb *EthereumDB) Get(key []byte) ([]byte, error)
- func (edb *EthereumDB) Has(key []byte) (bool, error)
- func (edb *EthereumDB) NewBatch() ethdb.Batch
- func (edb *EthereumDB) Put(key []byte, value []byte) error
- func (edb *EthereumDB) Reset()
- func (edb *EthereumDB) ValueSize() int
- func (edb *EthereumDB) Write() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainContext ¶
ChainContext implements Ethereum's core.ChainContext and consensus.Engine interfaces. It is needed in order to apply and process Ethereum transactions. There should only be a single implementation in Ethermint. For the purposes of Ethermint, it should be support retrieving headers and consensus parameters from the current blockchain to be used during transaction processing.
NOTE: Ethermint will distribute the fees out to validators, so the structure and functionality of this is a WIP and subject to change.
func (*ChainContext) APIs ¶
func (cc *ChainContext) APIs(_ ethconsensus.ChainReader) []ethrpc.API
APIs implements Ethereum's core.ChainContext interface. It currently performs a no-op.
TODO: Do we need to support such RPC APIs? This will tie into a bigger discussion on if we want to support web3.
func (*ChainContext) Author ¶
Author implements Ethereum's consensus.Engine interface. It is responsible for returned the address of the validtor to receive any fees. This function is only invoked if the given author in the ApplyTransaction call is nil.
NOTE: Ethermint will distribute the fees out to validators, so the structure and functionality of this is a WIP and subject to change.
func (*ChainContext) CalcDifficulty ¶
func (cc *ChainContext) CalcDifficulty(_ ethconsensus.ChainReader, _ uint64, _ *ethtypes.Header) *big.Int
CalcDifficulty implements Ethereum's core.ChainContext interface. It currently performs a no-op.
func (*ChainContext) Engine ¶
func (cc *ChainContext) Engine() ethconsensus.Engine
Engine implements Ethereum's core.ChainContext interface. As a ChainContext implements the consensus.Engine interface, it is simply returned.
func (*ChainContext) Finalize ¶
func (cc *ChainContext) Finalize( _ ethconsensus.ChainReader, _ *ethtypes.Header, _ *ethstate.StateDB, _ []*ethtypes.Transaction, _ []*ethtypes.Header, _ []*ethtypes.Receipt, ) (*ethtypes.Block, error)
Finalize implements Ethereum's core.ChainContext interface. It currently performs a no-op.
TODO: Figure out if this needs to be hooked up to any part of the ABCI?
func (*ChainContext) GetHeader ¶
GetHeader implements Ethereum's core.ChainContext interface. It currently performs a no-op.
TODO: The Cosmos SDK supports retreiving such information in contexts and multi-store, so this will be need to be integrated.
func (*ChainContext) Prepare ¶
func (cc *ChainContext) Prepare(_ ethconsensus.ChainReader, _ *ethtypes.Header) error
Prepare implements Ethereum's core.ChainContext interface. It currently performs a no-op.
TODO: Figure out if this needs to be hooked up to any part of the ABCI?
func (*ChainContext) Seal ¶
func (cc *ChainContext) Seal(_ ethconsensus.ChainReader, _ *ethtypes.Block, _ <-chan struct{}) (*ethtypes.Block, error)
Seal implements Ethereum's core.ChainContext interface. It currently performs a no-op.
TODO: Figure out if this needs to be hooked up to any part of the ABCI?
func (*ChainContext) VerifyHeader ¶
func (cc *ChainContext) VerifyHeader(_ ethconsensus.ChainReader, _ *ethtypes.Header, _ bool) error
VerifyHeader implements Ethereum's core.ChainContext interface. It currently performs a no-op.
TODO: Figure out if this needs to be hooked up to any part of the Cosmos SDK handlers?
func (*ChainContext) VerifyHeaders ¶
func (cc *ChainContext) VerifyHeaders(_ ethconsensus.ChainReader, _ []*ethtypes.Header, _ []bool) (chan<- struct{}, <-chan error)
VerifyHeaders implements Ethereum's core.ChainContext interface. It currently performs a no-op.
TODO: Figure out if this needs to be hooked up to any part of the Cosmos SDK handlers?
func (*ChainContext) VerifySeal ¶
func (cc *ChainContext) VerifySeal(_ ethconsensus.ChainReader, _ *ethtypes.Header) error
VerifySeal implements Ethereum's core.ChainContext interface. It currently performs a no-op.
TODO: Figure out if this needs to be hooked up to any part of the Cosmos SDK handlers?
func (*ChainContext) VerifyUncles ¶
func (cc *ChainContext) VerifyUncles(_ ethconsensus.ChainReader, _ *ethtypes.Block) error
VerifyUncles implements Ethereum's core.ChainContext interface. It currently performs a no-op.
type EthereumDB ¶
EthereumDB implements Ethereum's ethdb.Database and ethdb.Batch interfaces. It will be used to facilitate persistence of codeHash => code mappings.
func (*EthereumDB) Close ¶
func (edb *EthereumDB) Close()
Close implements Ethereum's ethdb.Database interface. It closes the underlying database.
func (*EthereumDB) Delete ¶
func (edb *EthereumDB) Delete(key []byte) error
Delete implements Ethereum's ethdb.Database interface. It removes a given key from the underlying database.
func (*EthereumDB) Get ¶
func (edb *EthereumDB) Get(key []byte) ([]byte, error)
Get implements Ethereum's ethdb.Database interface. It returns a value for a given key.
func (*EthereumDB) Has ¶
func (edb *EthereumDB) Has(key []byte) (bool, error)
Has implements Ethereum's ethdb.Database interface. It returns a boolean determining if the underlying database has the given key or not.
func (*EthereumDB) NewBatch ¶
func (edb *EthereumDB) NewBatch() ethdb.Batch
NewBatch implements Ethereum's ethdb.Database interface. It returns a new Batch object used for batch database operations.
func (*EthereumDB) Put ¶
func (edb *EthereumDB) Put(key []byte, value []byte) error
Put implements Ethereum's ethdb.Putter interface. It wraps the database write operation supported by both batches and regular databases.
func (*EthereumDB) Reset ¶
func (edb *EthereumDB) Reset()
Reset implements Ethereum's ethdb.Database interface. It performs a no-op.
func (*EthereumDB) ValueSize ¶
func (edb *EthereumDB) ValueSize() int
ValueSize implements Ethereum's ethdb.Database interface. It performs a no-op.
func (*EthereumDB) Write ¶
func (edb *EthereumDB) Write() error
Write implements Ethereum's ethdb.Database interface. It performs a no-op.