builtInFunctions

package
v1.0.109 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBuiltInFunctionContainer

func CreateBuiltInFunctionContainer(args ArgsCreateBuiltInFunctionContainer) (process.BuiltInFunctionContainer, error)

CreateBuiltInFunctionContainer will create the list of built-in functions

func NewBuiltInFunctionContainer

func NewBuiltInFunctionContainer() *functionContainer

NewBuiltInFunctionContainer will create a new instance of a container

func NewChangeOwnerAddressFunc

func NewChangeOwnerAddressFunc(gasCost uint64) *changeOwnerAddress

NewChangeOwnerAddressFunc create a new change owner built in function

func NewClaimDeveloperRewardsFunc

func NewClaimDeveloperRewardsFunc(gasCost uint64) *claimDeveloperRewards

NewClaimDeveloperRewardsFunc returns a new developer rewards implementation

func NewSaveKeyValueStorageFunc

func NewSaveKeyValueStorageFunc(
	gasConfig BaseOperationCost,
	funcGasCost uint64,
) *saveKeyValueStorage

NewSaveKeyValueStorageFunc returns the key-value

func NewSaveUserNameFunc

func NewSaveUserNameFunc(
	gasCost uint64,
	mapDnsAddresses map[string]struct{},
	enableChange bool,
) (*saveUserName, error)

NewSaveUserNameFunc returns a username built in function implementation

Types

type ArgsCreateBuiltInFunctionContainer

type ArgsCreateBuiltInFunctionContainer struct {
	GasMap               map[string]map[string]uint64
	MapDNSAddresses      map[string]struct{}
	EnableUserNameChange bool
}

ArgsCreateBuiltInFunctionContainer -

type BaseOperationCost

type BaseOperationCost struct {
	StorePerByte    uint64
	ReleasePerByte  uint64
	DataCopyPerByte uint64
	PersistPerByte  uint64
	CompilePerByte  uint64
}

BaseOperationCost defines cost for base operation cost

type BuiltInCost

type BuiltInCost struct {
	ChangeOwnerAddress    uint64
	ClaimDeveloperRewards uint64
	SaveUserName          uint64
	SaveKeyValue          uint64
}

BuiltInCost defines cost for built-in methods

type GasCost

type GasCost struct {
	BaseOperationCost BaseOperationCost
	BuiltInCost       BuiltInCost
}

GasCost holds all the needed gas costs for system smart contracts

Jump to

Keyboard shortcuts

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