blockchainer

package
v0.0.0-...-f94ef0f Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blockchainer

type Blockchainer interface {
	ApplyPolicyToTxSet([]*transaction.Transaction) []*transaction.Transaction
	AddBlock(block *block.Block) error
	AddHeaders(...*block.Header) error
	BlockHeight() uint32
	GetConfig() config.ProtocolConfiguration
	Close()
	Contracts() *native.Contracts
	IsTxStillRelevant(t *transaction.Transaction, txpool *mempool.Pool, isPartialTx bool) bool
	HeaderHeight() uint32
	GetBlock(hash common.Hash, full bool) (*block.Block, *types.Receipt, error)
	GetConsensusAddress() (common.Address, error)
	GetContractState(hash common.Address) *state.Contract
	IsBlocked(common.Address) bool
	GetHeaderHash(int) common.Hash
	GetHeader(hash common.Hash) (*block.Header, error)
	CurrentHeaderHash() common.Hash
	CurrentBlockHash() common.Hash
	HasBlock(common.Hash) bool
	HasTransaction(common.Hash) bool
	IsExtensibleAllowed(common.Address) bool
	GetNativeContractScriptHash(string) (common.Address, error)
	GetNatives() []state.NativeContract
	GetValidators(uint32) ([]*keys.PublicKey, error)
	GetCurrentValidators() ([]*keys.PublicKey, error)
	GetStateModule() StateRoot
	GetStorageItem(hash common.Address, key []byte) state.StorageItem
	GetStorageItems(hash common.Address) ([]state.StorageItemWithKey, error)
	GetTestVM(tx *transaction.Transaction, b *block.Block, tracer vm.EVMLogger) (*interop.Context, error)
	GetTransaction(common.Hash) (*transaction.Transaction, *types.Receipt, error)
	mempool.Feer // fee interface
	ManagementContractAddress() common.Address
	PoolTx(t *transaction.Transaction, pools ...*mempool.Pool) error
	PoolTxWithData(t *transaction.Transaction, data interface{}, mp *mempool.Pool, feer mempool.Feer, verificationFunction func(t *transaction.Transaction, data interface{}) error) error
	SubscribeForBlocks(ch chan<- *block.Block)
	SubscribeForExecutions(ch chan<- *types.Receipt)
	SubscribeForNotifications(ch chan<- *types.Log)
	SubscribeForTransactions(ch chan<- *transaction.Transaction)
	VerifyTx(*transaction.Transaction) error
	VerifyWitness(common.Address, hash.Hashable, *transaction.Witness) error
	GetMemPool() *mempool.Pool
	UnsubscribeFromBlocks(ch chan<- *block.Block)
	UnsubscribeFromExecutions(ch chan<- *types.Receipt)
	UnsubscribeFromNotifications(ch chan<- *types.Log)
	UnsubscribeFromTransactions(ch chan<- *transaction.Transaction)
	GetFeePerByte() uint64
	GetGasPrice() *big.Int
	GetNonce(addr common.Address) uint64
	GetPendingNonce(addr common.Address) uint64
	GetLogs(filter *filters.LogFilter) ([]*types.Log, error)
	GetMinted(id int64) (common.Hash, error)
}

Blockchainer is an interface that abstract the implementation of the blockchain.

type StateRoot

type StateRoot interface {
	CurrentLocalHeight() uint32
	CurrentLocalStateRoot() common.Hash
	CurrentValidatedHeight() uint32
	FindStates(root common.Hash, prefix, start []byte, max int) ([]storage.KeyValue, error)
	GetState(root common.Hash, key []byte) ([]byte, error)
	GetStateProof(root common.Hash, key []byte) ([][]byte, error)
	GetStateRoot(height uint32) (*state.MPTRoot, error)
}

StateRoot represents local state root module.

Jump to

Keyboard shortcuts

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