vm

package
v1.0.44 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2019 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInputArgsIsNil = errors.New("input system smart contract arguments are nil")

ErrInputArgsIsNil signals that input arguments are nil for system smart contract

View Source
var ErrInputCallValueIsNil = errors.New("input value for system smart contract is nil")

ErrInputCallValueIsNil signals that input call value is nil for system smart contract

View Source
var ErrInputCallerAddrIsNil = errors.New("input called address for system smart contract is nil")

ErrInputCallerAddrIsNil signals that input caller address is nil for system smart contract

View Source
var ErrInputFunctionIsNil = errors.New("input function for system smart contract is nil")

ErrInputFunctionIsNil signals that input function is nil for system smart contract

View Source
var ErrInputRecipientAddrIsNil = errors.New("input recipient address for system smart contract is nil")

ErrInputRecipientAddrIsNil signals that input recipient address for system smart contract is nil

View Source
var ErrNegativeInitialStakeValue = errors.New("initial stake value is negative")

ErrNegativeInitialStakeValue signals that a negative initial stake value was provided

View Source
var ErrNilBlockchainHook = errors.New("blockchain hook is nil")

ErrNilBlockchainHook signals that blockchain hook is nil

View Source
var ErrNilCryptoHook = errors.New("crypto hook is nil")

ErrNilCryptoHook signals that crypto hook is nil

View Source
var ErrNilEconomicsData = errors.New("nil economics data")

ErrNilEconomicsData signals that nil economics data has been provided

View Source
var ErrNilInitialStakeValue = errors.New("initial stake value is nil")

ErrNilInitialStakeValue signals that nil initial stake value was provided

View Source
var ErrNilOrEmptyKey = errors.New("nil or empty key")

ErrNilOrEmptyKey signals that key is nil or empty

View Source
var ErrNilSystemContractsContainer = errors.New("system contract container is nil")

ErrNilSystemContractsContainer signals that the provided system contract container is nil

View Source
var ErrNilSystemEnvironmentInterface = errors.New("system environment interface is nil")

ErrNilSystemEnvironmentInterface signals that a nil system environment interface was provided

View Source
var ErrNilVMType = errors.New("vm type is nil")

ErrNilVMType signals that the provided vm type is nil

View Source
var ErrUnknownSystemSmartContract = errors.New("missing system smart contract on selected address")

ErrUnknownSystemSmartContract signals that there is no system smart contract on the provided address

Functions

This section is empty.

Types

type PeerChangesEI added in v1.0.28

type PeerChangesEI interface {
	GetPeerState()
	SetPeerState()

	CleanCache()
	CreatePeerChangesOutput()
	IsInterfaceNil() bool
}

PeerChangesEI defines the environment interface system smart contract can use to write peer changes

type SystemEI

type SystemEI interface {
	Transfer(destination []byte, sender []byte, value *big.Int, input []byte) error
	GetBalance(addr []byte) *big.Int
	SetStorage(key []byte, value []byte)
	GetStorage(key []byte) []byte
	SelfDestruct(beneficiary []byte)
	Finish(value []byte)
	BlockChainHook() vmcommon.BlockchainHook
	CryptoHook() vmcommon.CryptoHook

	CreateVMOutput() *vmcommon.VMOutput
	CleanCache()
	SetSCAddress(addr []byte)
	AddCode(addr []byte, code []byte)
	AddTxValueToSmartContract(value *big.Int, scAddress []byte)

	IsInterfaceNil() bool
}

SystemEI defines the environment interface system smart contract can use

type SystemSCContainer

type SystemSCContainer interface {
	Get(key []byte) (SystemSmartContract, error)
	Add(key []byte, val SystemSmartContract) error
	Replace(key []byte, val SystemSmartContract) error
	Remove(key []byte)
	Len() int
	Keys() [][]byte
	IsInterfaceNil() bool
}

SystemSCContainer defines a system smart contract holder data type with basic functionality

type SystemSCContainerFactory

type SystemSCContainerFactory interface {
	Create() (SystemSCContainer, error)
	IsInterfaceNil() bool
}

SystemSCContainerFactory defines the functionality to create a system smart contract container

type SystemSmartContract

type SystemSmartContract interface {
	Execute(args *vmcommon.ContractCallInput) vmcommon.ReturnCode
	ValueOf(key interface{}) interface{}
	IsInterfaceNil() bool
}

SystemSmartContract interface defines the function a system smart contract should have

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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