gas

package
v2.3.6 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// function list gas price
	GetArgsGasPrice               uint64 = 1
	GetStateGasPrice              uint64 = 1
	GetBatchStateGasPrice         uint64 = 1
	PutStateGasPrice              uint64 = 10
	DelStateGasPrice              uint64 = 10
	GetCreatorOrgIdGasPrice       uint64 = 1
	GetCreatorRoleGasPrice        uint64 = 1
	GetCreatorPkGasPrice          uint64 = 1
	GetSenderOrgIdGasPrice        uint64 = 1
	GetSenderRoleGasPrice         uint64 = 1
	GetSenderPkGasPrice           uint64 = 1
	GetBlockHeightGasPrice        uint64 = 1
	GetTxIdGasPrice               uint64 = 1
	GetTimeStampPrice             uint64 = 1
	EmitEventGasPrice             uint64 = 5
	LogGasPrice                   uint64 = 5
	KvIteratorCreateGasPrice      uint64 = 1
	KvPreIteratorCreateGasPrice   uint64 = 1
	KvIteratorHasNextGasPrice     uint64 = 1
	KvIteratorNextGasPrice        uint64 = 1
	KvIteratorCloseGasPrice       uint64 = 1
	KeyHistoryIterCreateGasPrice  uint64 = 1
	KeyHistoryIterHasNextGasPrice uint64 = 1
	KeyHistoryIterNextGasPrice    uint64 = 1
	KeyHistoryIterCloseGasPrice   uint64 = 1
	GetSenderAddressGasPrice      uint64 = 1

	// special parameters passed to contract
	ContractParamCreatorOrgId = "__creator_org_id__"
	ContractParamCreatorRole  = "__creator_role__"
	ContractParamCreatorPk    = "__creator_pk__"
	ContractParamSenderOrgId  = "__sender_org_id__"
	ContractParamSenderRole   = "__sender_role__"
	ContractParamSenderPk     = "__sender_pk__"
	ContractParamBlockHeight  = "__block_height__"
	ContractParamTxId         = "__tx_id__"
	ContractParamTxTimeStamp  = "__tx_time_stamp__"
)

Variables

This section is empty.

Functions

func CheckGasLimit

func CheckGasLimit(gasUsed uint64) bool

func ConsumeKeyHistoryIterGasUsed

func ConsumeKeyHistoryIterGasUsed(gasUsed uint64) (uint64, error)

func ConsumeKvIteratorGasUsed

func ConsumeKvIteratorGasUsed(gasUsed uint64) (uint64, error)

func ContractGasUsed

func ContractGasUsed(txSimContext protocol.TxSimContext, gasUsed uint64, method string,
	contractName string, byteCode []byte) (uint64, error)

func CreateKeyHistoryIterGasUsed

func CreateKeyHistoryIterGasUsed(gasUsed uint64) (uint64, error)

func CreateKvIteratorGasUsed

func CreateKvIteratorGasUsed(gasUsed uint64) (uint64, error)

func DelStateGasUsed

func DelStateGasUsed(gasUsed uint64, value []byte) (uint64, error)

func EmitEventGasUsed

func EmitEventGasUsed(gasUsed uint64, contractEvent *common.ContractEvent) (uint64, error)

func GetArgsGasUsed

func GetArgsGasUsed(gasUsed uint64, args map[string]string) (uint64, error)

func GetBatchStateGasUsed added in v2.3.0

func GetBatchStateGasUsed(gasUsed uint64, payload []byte) (uint64, error)

func GetSenderAddressGasUsed added in v2.2.0

func GetSenderAddressGasUsed(gasUsed uint64) (uint64, error)

func GetStateGasUsed

func GetStateGasUsed(gasUsed uint64, value []byte) (uint64, error)

func InitFuncGasUsed

func InitFuncGasUsed(gasUsed uint64, parameters map[string][]byte) (uint64, error)

func InitFuncGasUsedLT2310 added in v2.3.2

func InitFuncGasUsedLT2310(gasUsed uint64, parameters map[string][]byte) (uint64, error)

func PutStateGasUsed

func PutStateGasUsed(gasUsed uint64, contractName, key, field string, value []byte) (uint64, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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