builtInFunctions

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthDct        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowDct          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupDct = fmt.Errorf("proto: unexpected end of group")
)

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 NewDCTTransferFunc

func NewDCTTransferFunc(
	funcGasCost uint64,
	marshalizer marshal.Marshalizer,
) (*dctTransfer, error)

NewDCTTransferFunc returns the dct transfer built-in function component

func NewSaveKeyValueStorageFunc

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

NewSaveKeyValueStorageFunc returns the save key-value storage built in function

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
	Marshalizer          marshal.Marshalizer
}

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
	DCTTransfer           uint64
}

BuiltInCost defines cost for built-in methods

type DCToken

type DCToken struct {
	Value *math_big.Int `` /* 134-byte string literal not displayed */
}

DCToken holds the data for a dharitri standard digital token transaction

func (*DCToken) Descriptor

func (*DCToken) Descriptor() ([]byte, []int)

func (*DCToken) Equal

func (this *DCToken) Equal(that interface{}) bool

func (*DCToken) GetValue

func (m *DCToken) GetValue() *math_big.Int

func (*DCToken) GoString

func (this *DCToken) GoString() string

func (*DCToken) Marshal

func (m *DCToken) Marshal() (dAtA []byte, err error)

func (*DCToken) MarshalTo

func (m *DCToken) MarshalTo(dAtA []byte) (int, error)

func (*DCToken) MarshalToSizedBuffer

func (m *DCToken) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DCToken) ProtoMessage

func (*DCToken) ProtoMessage()

func (*DCToken) Reset

func (m *DCToken) Reset()

func (*DCToken) Size

func (m *DCToken) Size() (n int)

func (*DCToken) String

func (this *DCToken) String() string

func (*DCToken) Unmarshal

func (m *DCToken) Unmarshal(dAtA []byte) error

func (*DCToken) XXX_DiscardUnknown

func (m *DCToken) XXX_DiscardUnknown()

func (*DCToken) XXX_Marshal

func (m *DCToken) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DCToken) XXX_Merge

func (m *DCToken) XXX_Merge(src proto.Message)

func (*DCToken) XXX_Size

func (m *DCToken) XXX_Size() int

func (*DCToken) XXX_Unmarshal

func (m *DCToken) XXX_Unmarshal(b []byte) error

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