gas

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: Apache-2.0 Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGasLimit

func GetGasLimit(tx *common.Transaction) uint64

GetGasLimit get `gasLimit` field from tx

func IsGasEnabled

func IsGasEnabled(txSimContext protocol.TxSimContext) bool

IsGasEnabled check tha `enable_gas` flag

func MultiplyGasPrice

func MultiplyGasPrice(dataSize int, gasPrice float32) (uint64, error)

MultiplyGasPrice calculate multiplication of contract size(int) and gas price(float32)

Types

type GasConfig

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

GasConfig `gas config` born from GasAccountConfig

func NewGasConfig

func NewGasConfig(config *configPb.GasAccountConfig) *GasConfig

NewGasConfig create GasConfig Object

func (*GasConfig) GetBaseGasForInstall

func (c *GasConfig) GetBaseGasForInstall() uint64

GetBaseGasForInstall get gas number for install user contract

func (*GasConfig) GetBaseGasForInvoke

func (c *GasConfig) GetBaseGasForInvoke() uint64

GetBaseGasForInvoke get gas number for invoke user contract

func (*GasConfig) GetGasPriceForInstall

func (c *GasConfig) GetGasPriceForInstall() float32

GetGasPriceForInstall get gas price for install user contract

func (*GasConfig) GetGasPriceForInvoke

func (c *GasConfig) GetGasPriceForInvoke() float32

GetGasPriceForInvoke get gas price for invoke user contract

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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