core

package
v0.0.0-...-ebde1c0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainContext

type ChainContext struct {
	Coinbase ethcommon.Address
}

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

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

func (cc *ChainContext) Author(_ *ethtypes.Header) (ethcommon.Address, error)

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

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

func (cc *ChainContext) GetHeader(ethcommon.Hash, uint64) *ethtypes.Header

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

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

type EthereumDB struct {
	CodeDB dbm.DB
}

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.

Jump to

Keyboard shortcuts

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