gasstation

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	SuggestBlockWindow: 20,
	DefaultGas:         uint64(unit.Qev),
	Percentile:         60,
}

DefaultConfig is the default config

Functions

This section is empty.

Types

type BlockDAO added in v0.11.0

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

BlockDAO represents the block data access object

type Config added in v1.10.0

type Config struct {
	SuggestBlockWindow int    `yaml:"suggestBlockWindow"`
	DefaultGas         uint64 `yaml:"defaultGas"`
	Percentile         int    `yaml:"Percentile"`
}

Config is the gas station config

type GasStation

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

GasStation provide gas related api

func NewGasStation

func NewGasStation(bc blockchain.Blockchain, dao BlockDAO, cfg Config) *GasStation

NewGasStation creates a new gas station

func (*GasStation) SuggestGasPrice

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

SuggestGasPrice suggest gas price

type SimulateFunc added in v0.11.0

SimulateFunc is function that simulate execution

Jump to

Keyboard shortcuts

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