core

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: Apache-2.0 Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanTransfer

func CanTransfer(db vm.StateDB, addr common.Address, amount *big.Int) bool

CanTransfer checks wether there are enough funds in the address' account to make a transfer. This does not take the necessary gas in to account to make the transfer valid.

func GetHashFn

func GetHashFn(ref *types.Header, chain ChainContext) func(n uint64) common.Hash

GetHashFn returns a GetHashFunc which retrieves header hashes by number

func NewEVMContext

func NewEVMContext(msg IMessage, author *common.Address, height uint64, blockTime time.Time) vm.Context

NewEVMContext creates a new context for use in the EVM.

func Transfer

func Transfer(db vm.StateDB, sender, recipient common.Address, amount *big.Int)

Transfer subtracts amount from sender and adds amount to recipient using the given Db

Types

type ChainContext

type ChainContext interface {

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

ChainContext supports retrieving headers and consensus parameters from the current blockchain to be used during transaction processing.

type FooChainContext

type FooChainContext struct {
	// contains filtered or unexported fields
}

func (FooChainContext) GetHeader

func (self FooChainContext) GetHeader(hash common.Hash, number uint64) *types.Header

type IMessage

type IMessage interface {
	FromAddress() common.Address
}

Jump to

Keyboard shortcuts

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