iotex-core: github.com/iotexproject/iotex-core/gasstation Index | Files

package gasstation

import "github.com/iotexproject/iotex-core/gasstation"

Index

Package Files

gasstattion.go

type BlockDAO Uses

type BlockDAO interface {
    GetBlockHash(uint64) (hash.Hash256, error)
    GetBlockByHeight(uint64) (*block.Block, error)
}

BlockDAO represents the block data access object

type GasStation Uses

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

GasStation provide gas related api

func NewGasStation Uses

func NewGasStation(bc blockchain.Blockchain, simulator SimulateFunc, dao BlockDAO, cfg config.API) *GasStation

NewGasStation creates a new gas station

func (*GasStation) EstimateGasForAction Uses

func (gs *GasStation) EstimateGasForAction(actPb *iotextypes.Action) (uint64, error)

EstimateGasForAction estimate gas for action

func (*GasStation) IsSystemAction Uses

func (gs *GasStation) IsSystemAction(act action.SealedEnvelope) bool

IsSystemAction determine whether input action belongs to system action

func (*GasStation) SuggestGasPrice Uses

func (gs *GasStation) SuggestGasPrice() (uint64, error)

SuggestGasPrice suggest gas price

type SimulateFunc Uses

type SimulateFunc func(context.Context, address.Address, *action.Execution, evm.GetBlockHash) ([]byte, *action.Receipt, error)

SimulateFunc is function that simulate execution

Package gasstation imports 11 packages (graph) and is imported by 1 packages. Updated 2020-04-05. Refresh now. Tools for package owners.