evm

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: Apache-2.0 Imports: 5 Imported by: 10

Documentation

Index

Constants

View Source
const ModuleName = "evm"

ModuleName is the EVM module name.

Variables

This section is empty.

Functions

func DecodeEvent

func DecodeEvent(event *types.Event) ([]client.DecodedEvent, error)

DecodeEvent decodes an evm event.

Types

type BalanceQuery

type BalanceQuery struct {
	Address []byte `json:"address"`
}

BalanceQuery queries the EVM account balance.

type Call

type Call struct {
	Address []byte `json:"address"`
	Value   []byte `json:"value"`
	Data    []byte `json:"data"`
}

Call is an EVM CALL transaction.

type CodeQuery

type CodeQuery struct {
	Address []byte `json:"address"`
}

CodeQuery queries the EVM code storage.

type Create

type Create struct {
	Value    []byte `json:"value"`
	InitCode []byte `json:"init_code"`
}

Create is an EVM CREATE transaction.

type Event

type Event struct {
	Address []byte   `json:"address"`
	Topics  [][]byte `json:"topics"`
	Data    []byte   `json:"data"`
}

Event is an event emitted by the EVM module.

type GasCosts

type GasCosts struct{}

GasCosts are the EVM module gas costs.

type Parameters

type Parameters struct {
	GasCosts GasCosts `json:"gas_costs"`
}

Parameters are the parameters for the EVM module.

type SimulateCallQuery

type SimulateCallQuery struct {
	GasPrice []byte `json:"gas_price"`
	GasLimit uint64 `json:"gas_limit"`
	Caller   []byte `json:"caller"`
	Address  []byte `json:"address"`
	Value    []byte `json:"value"`
	Data     []byte `json:"data"`
}

SimulateCallQuery simulates an EVM CALL.

type StorageQuery

type StorageQuery struct {
	Address []byte `json:"address"`
	Index   []byte `json:"index"`
}

StorageQuery queries the EVM storage.

type V1

type V1 interface {
	client.EventDecoder

	// Create generates an EVM CREATE transaction.
	// Note that the transaction's gas limit should be set to cover both the
	// SDK gas limit and the EVM gas limit.  The transaction fee should be
	// high enough to cover the EVM gas price multiplied by the EVM gas limit.
	Create(value []byte, initCode []byte) *client.TransactionBuilder

	// Call generates an EVM CALL transaction.
	// Note that the transaction's gas limit should be set to cover both the
	// SDK gas limit and the EVM gas limit.  The transaction fee should be
	// high enough to cover the EVM gas price multiplied by the EVM gas limit.
	Call(address []byte, value []byte, data []byte) *client.TransactionBuilder

	// Storage queries the EVM storage.
	Storage(ctx context.Context, round uint64, address []byte, index []byte) ([]byte, error)

	// Code queries the EVM code storage.
	Code(ctx context.Context, round uint64, address []byte) ([]byte, error)

	// Balance queries the EVM account balance.
	Balance(ctx context.Context, round uint64, address []byte) (*types.Quantity, error)

	// SimulateCall simulates an EVM CALL.
	SimulateCall(ctx context.Context, round uint64, gasPrice []byte, gasLimit uint64, caller []byte, address []byte, value []byte, data []byte) ([]byte, error)

	// Parameters queries the EVM module parameters.
	Parameters(ctx context.Context, round uint64) (*Parameters, error)

	// GetEvents returns events emitted by the EVM module.
	GetEvents(ctx context.Context, round uint64) ([]*Event, error)
}

V1 is the v1 EVM module interface.

func NewV1

func NewV1(rtc client.RuntimeClient) V1

NewV1 generates a V1 client helper for the EVM module.

Jump to

Keyboard shortcuts

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