vmserver

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultGasPrice = 200000000000

DefaultGasPrice is the default gas price for debugging

Variables

View Source
var ErrAccountDoesntExist = errors.New("account does not exist")

ErrAccountDoesntExist signals an error

View Source
var ErrInvalidArgumentEncoding = errors.New("invalid contract argument encoding")

ErrInvalidArgumentEncoding signals an error

Functions

This section is empty.

Types

type ContractRequestBase

type ContractRequestBase struct {
	RequestBase
	ImpersonatedHex string
	Impersonated    []byte
	Value           string
	ValueAsBigInt   *big.Int
	GasPrice        uint64
	GasLimit        uint64
}

ContractRequestBase is a CLI / REST request message

type ContractResponseBase

type ContractResponseBase struct {
	ResponseBase
	Input            *vmcommon.VMInput
	Output           *vmcommon.VMOutput
	ReturnCodeString string
}

ContractResponseBase is a CLI / REST response message

type CreateAccountRequest

type CreateAccountRequest struct {
	RequestBase
	AddressHex      string
	Address         []byte
	Balance         string
	BalanceAsBigInt *big.Int
	Nonce           uint64
}

CreateAccountRequest is a CLI / REST request message

type CreateAccountResponse

type CreateAccountResponse struct {
	Account *worldmock.Account
}

CreateAccountResponse is a CLI / REST response message

type DebugFacade

type DebugFacade struct {
}

DebugFacade is the debug facade

func NewDebugFacade

func NewDebugFacade() *DebugFacade

NewDebugFacade creates a new debug facade

func (*DebugFacade) CreateAccount

func (f *DebugFacade) CreateAccount(request CreateAccountRequest) (*CreateAccountResponse, error)

CreateAccount creates a test account

func (*DebugFacade) DeploySmartContract

func (f *DebugFacade) DeploySmartContract(request DeployRequest) (*DeployResponse, error)

DeploySmartContract deploys a smart contract

func (*DebugFacade) QuerySmartContract

func (f *DebugFacade) QuerySmartContract(request QueryRequest) (*QueryResponse, error)

QuerySmartContract queries a pure function of the smart contract

func (*DebugFacade) RunSmartContract

func (f *DebugFacade) RunSmartContract(request RunRequest) (*RunResponse, error)

RunSmartContract executes a smart contract function

func (*DebugFacade) UpgradeSmartContract

func (f *DebugFacade) UpgradeSmartContract(request UpgradeRequest) (*UpgradeResponse, error)

UpgradeSmartContract upgrades a smart contract

type DebugServer

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

DebugServer is the debugging server

func NewDebugServer

func NewDebugServer(facade *DebugFacade, address string) *DebugServer

NewDebugServer creates a Server object

func (*DebugServer) Start

func (server *DebugServer) Start() error

StartServer starts the debugging server

type DeployRequest

type DeployRequest struct {
	ContractRequestBase
	CodeHex           string
	Code              []byte
	CodePath          string
	CodeMetadata      string
	CodeMetadataBytes []byte
	ArgumentsHex      []string
	Arguments         [][]byte
}

DeployRequest is a CLI / REST request message

type DeployResponse

type DeployResponse struct {
	ContractResponseBase
	ContractAddress    []byte
	ContractAddressHex string
}

DeployResponse is a CLI / REST response message

type QueryRequest

type QueryRequest struct {
	RunRequest
}

QueryRequest is a CLI / REST request message

type QueryResponse

type QueryResponse struct {
	ContractResponseBase
}

QueryResponse is a CLI / REST response message

type RequestBase

type RequestBase struct {
	DatabasePath string
	World        string
	Outcome      string
}

RequestBase is a CLI / REST request message

type RequestError

type RequestError struct {
	Message  string
	InnerErr error
}

RequestError signals an error

func NewRequestError

func NewRequestError(message string) *RequestError

NewRequestError -

func NewRequestErrorInner

func NewRequestErrorInner(err error) *RequestError

NewRequestErrorInner -

func NewRequestErrorMessageInner

func NewRequestErrorMessageInner(message string, err error) *RequestError

NewRequestErrorMessageInner -

func (*RequestError) Error

func (err *RequestError) Error() string

func (*RequestError) Unwrap

func (err *RequestError) Unwrap() error

Unwrap unwraps the inner error

type ResponseBase

type ResponseBase struct {
	Error error
}

ResponseBase is a CLI / REST response message

type RunRequest

type RunRequest struct {
	ContractRequestBase
	ContractAddressHex string
	ContractAddress    []byte
	Function           string
	ArgumentsHex       []string
	Arguments          [][]byte
}

RunRequest is a CLI / REST request message

type RunResponse

type RunResponse struct {
	ContractResponseBase
}

RunResponse is a CLI / REST response message

type UpgradeRequest

type UpgradeRequest struct {
	DeployRequest
	ContractAddressHex string
	ContractAddress    []byte
}

UpgradeRequest is a CLI / REST request message

type UpgradeResponse

type UpgradeResponse struct {
	ContractResponseBase
}

UpgradeResponse is a CLI / REST response message

Jump to

Keyboard shortcuts

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