smartContract

package
v1.0.92 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2020 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSmartContractProcessor

func NewSmartContractProcessor(args ArgsNewSmartContractProcessor) (*scProcessor, error)

NewSmartContractProcessor create a smart contract processor creates and interprets VM data

Types

type ArgsNewSmartContractProcessor

type ArgsNewSmartContractProcessor struct {
	VmContainer   process.VirtualMachinesContainer
	ArgsParser    process.ArgumentsParser
	Hasher        hashing.Hasher
	Marshalizer   marshal.Marshalizer
	AccountsDB    state.AccountsAdapter
	TempAccounts  process.TemporaryAccountsHandler
	AdrConv       state.AddressConverter
	Coordinator   sharding.Coordinator
	ScrForwarder  process.IntermediateTransactionHandler
	TxFeeHandler  process.TransactionFeeHandler
	EconomicsFee  process.FeeHandler
	TxTypeHandler process.TxTypeHandler
	GasHandler    process.GasHandler
	GasMap        map[string]map[string]uint64
}

ArgsNewSmartContractProcessor defines the arguments needed for new smart contract processor

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
}

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

type SCQueryService

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

SCQueryService can execute Get functions over SC to fetch stored values

func NewSCQueryService

func NewSCQueryService(
	vmContainer process.VirtualMachinesContainer,
	gasLimitPerBlock uint64,
) (*SCQueryService, error)

NewSCQueryService returns a new instance of SCQueryService

func (*SCQueryService) ExecuteQuery

func (service *SCQueryService) ExecuteQuery(query *process.SCQuery) (*vmcommon.VMOutput, error)

ExecuteQuery returns the VMOutput resulted upon running the function on the smart contract

func (*SCQueryService) IsInterfaceNil

func (service *SCQueryService) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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