autonity

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: GPL-3.0, GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAutonityContract = errors.New("could not call Autonity contract")

Functions

This section is empty.

Types

type Blockchainer

type Blockchainer interface {
	ChainContext
	GetVMConfig() *vm.Config
	Config() *params.ChainConfig

	UpdateEnodeWhitelist(newWhitelist *types.Nodes)
	ReadEnodeWhitelist(openNetwork bool) *types.Nodes
}

type ChainContext

type ChainContext interface {
	// Engine retrieves the chain's consensus engine.
	Engine() consensus.Engine

	// GetHeader returns the hash corresponding to their hash.
	GetHeader(common.Hash, uint64) *types.Header
}

type Contract

type Contract struct {
	SavedValidatorsRetriever func(i uint64) ([]common.Address, error)

	GetHashFn func(ref *types.Header, chain ChainContext) func(n uint64) common.Hash
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewAutonityContract

func NewAutonityContract(
	bc Blockchainer,
	canTransfer func(db vm.StateDB, addr common.Address, amount *big.Int) bool,
	transfer func(db vm.StateDB, sender, recipient common.Address, amount *big.Int),
	GetHashFn func(ref *types.Header, chain ChainContext) func(n uint64) common.Hash,
) *Contract

func (*Contract) Address

func (ac *Contract) Address() common.Address

func (*Contract) ApplyPerformRedistribution

func (ac *Contract) ApplyPerformRedistribution(transactions types.Transactions, receipts types.Receipts, header *types.Header, statedb *state.StateDB) error

func (*Contract) ContractGetValidators

func (ac *Contract) ContractGetValidators(chain consensus.ChainReader, header *types.Header, statedb *state.StateDB) ([]common.Address, error)

func (*Contract) DeployAutonityContract

func (ac *Contract) DeployAutonityContract(chain consensus.ChainReader, header *types.Header, statedb *state.StateDB) (common.Address, error)

deployContract deploys the contract contained within the genesis field bytecode

func (*Contract) GetMinimumGasPrice

func (ac *Contract) GetMinimumGasPrice(block *types.Block, db *state.StateDB) (uint64, error)

func (*Contract) GetWhitelist

func (ac *Contract) GetWhitelist(block *types.Block, db *state.StateDB) (*types.Nodes, error)

func (*Contract) PerformRedistribution

func (ac *Contract) PerformRedistribution(header *types.Header, db *state.StateDB, gasUsed *big.Int) error

func (*Contract) SetMinimumGasPrice

func (ac *Contract) SetMinimumGasPrice(block *types.Block, db *state.StateDB, price *big.Int) error

func (*Contract) UpdateEnodesWhitelist

func (ac *Contract) UpdateEnodesWhitelist(state *state.StateDB, block *types.Block) error

Jump to

Keyboard shortcuts

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