smartContract

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllSCRs added in v1.1.1

func GetAllSCRs(scProcessorAsInterface interface{}) []data.TransactionHandler

GetAllSCRs returns all generated scrs

func GetLatestTestError added in v1.0.103

func GetLatestTestError(scProcessorAsInterface interface{}) error

GetLatestTestError should only be used in tests! It locates the latest error in the collection of smart contracts results

func NewArgumentParser added in v1.0.133

func NewArgumentParser() *argumentParser

NewArgumentParser creates a full argument parser component

func NewSmartContractProcessor

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

NewSmartContractProcessor creates a smart contract processor that 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
	BlockChainHook                 process.BlockChainHookHandler
	PubkeyConv                     core.PubkeyConverter
	Coordinator                    sharding.Coordinator
	ScrForwarder                   process.IntermediateTransactionHandler
	TxFeeHandler                   process.TransactionFeeHandler
	EconomicsFee                   process.FeeHandler
	TxTypeHandler                  process.TxTypeHandler
	GasHandler                     process.GasHandler
	GasSchedule                    map[string]map[string]uint64
	BuiltInFunctions               process.BuiltInFunctionContainer
	TxLogsProcessor                process.TransactionLogProcessor
	BadTxForwarder                 process.IntermediateTransactionHandler
	DeployEnableEpoch              uint32
	BuiltinEnableEpoch             uint32
	PenalizedTooMuchGasEnableEpoch uint32
	EpochNotifier                  process.EpochNotifier
}

ArgsNewSmartContractProcessor defines the arguments needed for new smart contract processor

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,
	economicsFee process.FeeHandler,
	blockChainHook process.BlockChainHookHandler,
	blockChain data.ChainHandler,
) (*SCQueryService, error)

NewSCQueryService returns a new instance of SCQueryService

func (*SCQueryService) ComputeScCallGasLimit

func (service *SCQueryService) ComputeScCallGasLimit(tx *transaction.Transaction) (uint64, error)

ComputeScCallGasLimit will estimate how many gas a transaction will consume

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