Documentation ¶
Index ¶
- Constants
- func CallContractGasUsed(blockVersion uint32, gasConfig *gasutils.GasConfig, gasUsed uint64, ...) (uint64, error)
- func CallContractGasUsed2312(gasConfig *gasutils.GasConfig, gasUsed uint64, contractName string, ...) (uint64, error)
- func CheckGasLimit(gasUsed uint64) bool
- func ConsumeKeyHistoryIterGasUsed(blockVersion uint32, gasConfig *gasutils.GasConfig, gasUsed uint64) (uint64, error)
- func ConsumeKeyHistoryIterGasUsed2312(gasConfig *gasutils.GasConfig, gasUsed uint64) (uint64, error)
- func ConsumeKeyHistoryIterGasUsedLt2312(gasUsed uint64) (uint64, error)
- func ConsumeKeyHistoryIterNextGasUsed2312(gasConfig *gasutils.GasConfig, gasUsed uint64, value []byte) (uint64, error)
- func ConsumeKvIteratorGasUsed(blockVersion uint32, gasConfig *gasutils.GasConfig, gasUsed uint64) (uint64, error)
- func ConsumeKvIteratorGasUsed2312(gasConfig *gasutils.GasConfig, gasUsed uint64) (uint64, error)
- func ConsumeKvIteratorGasUsedLt2312(gasUsed uint64) (uint64, error)
- func ConsumeKvIteratorNextGasUsed2312(gasConfig *gasutils.GasConfig, gasUsed uint64, key string, field string, ...) (uint64, error)
- func ContractGasUsed(gasUsed uint64, method string, contractName string, byteCode []byte) (uint64, error)
- func CreateKeyHistoryIterGasUsed(blockVersion uint32, gasConfig *gasutils.GasConfig, params map[string][]byte, ...) (uint64, error)
- func CreateKeyHistoryIterGasUsed2312(gasConfig *gasutils.GasConfig, params map[string][]byte, gasUsed uint64, ...) (uint64, error)
- func CreateKeyHistoryIterGasUsedLt2312(gasUsed uint64) (uint64, error)
- func CreateKvIteratorGasUsed(blockVersion uint32, gasConfig *gasutils.GasConfig, params map[string][]byte, ...) (uint64, error)
- func CreateKvIteratorGasUsed2312(gasConfig *gasutils.GasConfig, params map[string][]byte, gasUsed uint64, ...) (uint64, error)
- func CreateKvIteratorGasUsedLt2312(gasUsed uint64) (uint64, error)
- func EmitEventGasUsed(blockVersion uint32, gasConfig *gasutils.GasConfig, gasUsed uint64, ...) (uint64, error)
- func EmitEventGasUsed2312(gasConfig *gasutils.GasConfig, gasUsed uint64, ...) (uint64, error)
- func EmitEventGasUsedLt2312(gasUsed uint64, contractEvent *common.ContractEvent) (uint64, error)
- func GetBatchStateGasUsed(blockVersion uint32, gasConfig *gasutils.GasConfig, gasUsed uint64, ...) (uint64, error)
- func GetBatchStateGasUsed2312(gasConfig *gasutils.GasConfig, gasUsed uint64, payload []byte) (uint64, error)
- func GetBatchStateGasUsedLt2312(gasUsed uint64, payload []byte) (uint64, error)
- func GetSenderAddressGasUsed(gasUsed uint64) (uint64, error)
- func GetStateGasUsed(blockVersion uint32, gasConfig *gasutils.GasConfig, gasUsed uint64, ...) (uint64, error)
- func GetStateGasUsed2312(gasConfig *gasutils.GasConfig, gasUsed uint64, contractName, key, field string, ...) (uint64, error)
- func GetStateGasUsedLt2312(gasUsed uint64, value []byte) (uint64, error)
- func InitFuncGasUsedLt2312(gasUsed, configDefaultGas uint64) (uint64, error)
- func PutStateGasUsed(blockVersion uint32, gasConfig *gasutils.GasConfig, gasUsed uint64, ...) (uint64, error)
- func PutStateGasUsed2312(gasConfig *gasutils.GasConfig, gasUsed uint64, contractName, key, field string, ...) (uint64, error)
- func PutStateGasUsedLt2312(gasUsed uint64, contractName, key, field string, value []byte) (uint64, error)
Constants ¶
const ( // function list gas price GetArgsGasPrice uint64 = 1 // GetArgsGasPrice GetStateGasPrice uint64 = 1 // GetStateGasPrice GetBatchStateGasPrice uint64 = 1 // GetBatchStateGasPrice PutStateGasPrice uint64 = 10 // PutStateGasPrice DelStateGasPrice uint64 = 10 // DelStateGasPrice GetCreatorOrgIdGasPrice uint64 = 1 // GetCreatorOrgIdGasPrice GetCreatorRoleGasPrice uint64 = 1 // GetCreatorRoleGasPrice GetCreatorPkGasPrice uint64 = 1 // GetCreatorPkGasPrice GetSenderOrgIdGasPrice uint64 = 1 //GetSenderOrgIdGasPrice GetSenderRoleGasPrice uint64 = 1 //GetSenderRoleGasPrice GetSenderPkGasPrice uint64 = 1 //GetSenderPkGasPrice GetBlockHeightGasPrice uint64 = 1 //GetBlockHeightGasPrice GetTxIdGasPrice uint64 = 1 //GetTxIdGasPrice GetTimeStampPrice uint64 = 1 //GetTimeStampPrice EmitEventGasPrice uint64 = 5 //EmitEventGasPrice LogGasPrice uint64 = 5 //LogGasPrice KvIteratorCreateGasPrice uint64 = 1 //KvIteratorCreateGasPrice KvPreIteratorCreateGasPrice uint64 = 1 //KvPreIteratorCreateGasPrice KvIteratorHasNextGasPrice uint64 = 1 //KvIteratorHasNextGasPrice KvIteratorNextGasPrice uint64 = 1 //KvIteratorNextGasPrice KvIteratorCloseGasPrice uint64 = 1 //KvIteratorCloseGasPrice KeyHistoryIterCreateGasPrice uint64 = 1 //KeyHistoryIterCreateGasPrice KeyHistoryIterHasNextGasPrice uint64 = 1 //KeyHistoryIterHasNextGasPrice KeyHistoryIterNextGasPrice uint64 = 1 //KeyHistoryIterNextGasPrice KeyHistoryIterCloseGasPrice uint64 = 1 //KeyHistoryIterCloseGasPrice GetSenderAddressGasPrice uint64 = 1 //GetSenderAddressGasPrice // special parameters passed to contract ContractParamCreatorOrgId = "__creator_org_id__" //ContractParamCreatorOrgId ContractParamCreatorRole = "__creator_role__" //ContractParamCreatorRole ContractParamCreatorPk = "__creator_pk__" //ContractParamCreatorPk ContractParamSenderOrgId = "__sender_org_id__" //ContractParamSenderOrgId ContractParamSenderRole = "__sender_role__" //ContractParamSenderRole ContractParamSenderPk = "__sender_pk__" //ContractParamSenderPk ContractParamBlockHeight = "__block_height__" //ContractParamBlockHeight ContractParamTxId = "__tx_id__" //ContractParamTxId ContractParamTxTimeStamp = "__tx_time_stamp__" //ContractParamTxTimeStamp )
nolint: revive
Variables ¶
This section is empty.
Functions ¶
func CallContractGasUsed ¶ added in v2.3.4
func CallContractGasUsed(blockVersion uint32, gasConfig *gasutils.GasConfig, gasUsed uint64, contractName string, contractMethod string, parameters map[string][]byte, txId string, log protocol.Logger) (uint64, error)
CallContractGasUsed return call contract gas used
func CallContractGasUsed2312 ¶ added in v2.3.4
func CallContractGasUsed2312(gasConfig *gasutils.GasConfig, gasUsed uint64, contractName string, contractMethod string, parameters map[string][]byte, txId string, log protocol.Logger) (uint64, error)
CallContractGasUsed2312 calculate gas for calling contract
func ConsumeKeyHistoryIterGasUsed ¶
func ConsumeKeyHistoryIterGasUsed(blockVersion uint32, gasConfig *gasutils.GasConfig, gasUsed uint64) (uint64, error)
ConsumeKeyHistoryIterGasUsed returns consume key history iter gas used
func ConsumeKeyHistoryIterGasUsed2312 ¶ added in v2.3.4
func ConsumeKeyHistoryIterGasUsed2312(gasConfig *gasutils.GasConfig, gasUsed uint64) (uint64, error)
ConsumeKeyHistoryIterGasUsed2312 calculate gas for key history iterator `HasNext/Close` operation
func ConsumeKeyHistoryIterGasUsedLt2312 ¶ added in v2.3.4
ConsumeKeyHistoryIterGasUsedLt2312 returns consume key history iter gas used
func ConsumeKeyHistoryIterNextGasUsed2312 ¶ added in v2.3.4
func ConsumeKeyHistoryIterNextGasUsed2312(gasConfig *gasutils.GasConfig, gasUsed uint64, value []byte) (uint64, error)
ConsumeKeyHistoryIterNextGasUsed2312 calculate gas for key-value iterator `Next` operation
func ConsumeKvIteratorGasUsed ¶
func ConsumeKvIteratorGasUsed(blockVersion uint32, gasConfig *gasutils.GasConfig, gasUsed uint64) (uint64, error)
ConsumeKvIteratorGasUsed returns kv iter gas used
func ConsumeKvIteratorGasUsed2312 ¶ added in v2.3.4
ConsumeKvIteratorGasUsed2312 calculate gas for key-value iterator `HasNext/Close` operation
func ConsumeKvIteratorGasUsedLt2312 ¶ added in v2.3.4
ConsumeKvIteratorGasUsedLt2312 returns kv iter gas used
func ConsumeKvIteratorNextGasUsed2312 ¶ added in v2.3.4
func ConsumeKvIteratorNextGasUsed2312(gasConfig *gasutils.GasConfig, gasUsed uint64, key string, field string, value []byte) (uint64, error)
ConsumeKvIteratorNextGasUsed2312 calculate gas for key-value iterator `Next` operation
func ContractGasUsed ¶
func ContractGasUsed(gasUsed uint64, method string, contractName string, byteCode []byte) (uint64, error)
ContractGasUsed returns contract gas used
func CreateKeyHistoryIterGasUsed ¶
func CreateKeyHistoryIterGasUsed(blockVersion uint32, gasConfig *gasutils.GasConfig, params map[string][]byte, gasUsed uint64, txId string, log protocol.Logger) (uint64, error)
CreateKeyHistoryIterGasUsed returns create key history iter gas used
func CreateKeyHistoryIterGasUsed2312 ¶ added in v2.3.4
func CreateKeyHistoryIterGasUsed2312(gasConfig *gasutils.GasConfig, params map[string][]byte, gasUsed uint64, txId string, log protocol.Logger) (uint64, error)
CreateKeyHistoryIterGasUsed2312 calculate gas for key history iterator `Create` operation
func CreateKeyHistoryIterGasUsedLt2312 ¶ added in v2.3.4
CreateKeyHistoryIterGasUsedLt2312 returns create key history iter gas used
func CreateKvIteratorGasUsed ¶
func CreateKvIteratorGasUsed(blockVersion uint32, gasConfig *gasutils.GasConfig, params map[string][]byte, gasUsed uint64, txId string, log protocol.Logger) (uint64, error)
CreateKvIteratorGasUsed create kv iter gas used
func CreateKvIteratorGasUsed2312 ¶ added in v2.3.4
func CreateKvIteratorGasUsed2312(gasConfig *gasutils.GasConfig, params map[string][]byte, gasUsed uint64, txId string, log protocol.Logger) (uint64, error)
CreateKvIteratorGasUsed2312 calculate gas for key-value iterator `Create` operation
func CreateKvIteratorGasUsedLt2312 ¶ added in v2.3.4
CreateKvIteratorGasUsedLt2312 create kv iter gas used
func EmitEventGasUsed ¶
func EmitEventGasUsed( blockVersion uint32, gasConfig *gasutils.GasConfig, gasUsed uint64, contractEvent *common.ContractEvent) (uint64, error)
EmitEventGasUsed returns emit event gas used
func EmitEventGasUsed2312 ¶ added in v2.3.4
func EmitEventGasUsed2312(gasConfig *gasutils.GasConfig, gasUsed uint64, contractEvent *common.ContractEvent) (uint64, error)
EmitEventGasUsed2312 returns emit event gas used
func EmitEventGasUsedLt2312 ¶ added in v2.3.4
func EmitEventGasUsedLt2312(gasUsed uint64, contractEvent *common.ContractEvent) (uint64, error)
EmitEventGasUsedLt2312 returns emit event gas used
func GetBatchStateGasUsed ¶
func GetBatchStateGasUsed( blockVersion uint32, gasConfig *gasutils.GasConfig, gasUsed uint64, payload []byte) (uint64, error)
GetBatchStateGasUsed returns get batch state gas used
func GetBatchStateGasUsed2312 ¶ added in v2.3.4
func GetBatchStateGasUsed2312(gasConfig *gasutils.GasConfig, gasUsed uint64, payload []byte) (uint64, error)
GetBatchStateGasUsed2312 returns get batch state gas used
func GetBatchStateGasUsedLt2312 ¶ added in v2.3.4
GetBatchStateGasUsedLt2312 returns get batch state gas used
func GetSenderAddressGasUsed ¶
GetSenderAddressGasUsed returns get sender address gas used
func GetStateGasUsed ¶
func GetStateGasUsed( blockVersion uint32, gasConfig *gasutils.GasConfig, gasUsed uint64, contractName, key, field string, value []byte) (uint64, error)
GetStateGasUsed returns put state gas used
func GetStateGasUsed2312 ¶ added in v2.3.4
func GetStateGasUsed2312(gasConfig *gasutils.GasConfig, gasUsed uint64, contractName, key, field string, value []byte) (uint64, error)
GetStateGasUsed2312 returns get state gas used
func GetStateGasUsedLt2312 ¶ added in v2.3.4
GetStateGasUsedLt2312 returns get state gas used
func InitFuncGasUsedLt2312 ¶ added in v2.3.4
InitFuncGasUsedLt2312 returns init func gas used
func PutStateGasUsed ¶
func PutStateGasUsed( blockVersion uint32, gasConfig *gasutils.GasConfig, gasUsed uint64, contractName, key, field string, value []byte) (uint64, error)
PutStateGasUsed returns put state gas used
Types ¶
This section is empty.