engine

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: CC0-1.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgsForGetStorageAt

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

ArgsForGetStorageAt is used to process GetStorageAt endpoint arguments

func NewArgsForGetStorageAt

func NewArgsForGetStorageAt(addr common.Address, sSlot common.Uint256) *ArgsForGetStorageAt

NewArgsForGetStorageAt allocates and returns a new empty ArgsForGetStorageAt

func (*ArgsForGetStorageAt) Serialize

func (gs *ArgsForGetStorageAt) Serialize() ([]byte, error)

Serialize transforms ArgsForGetStorageAt to argsForGetStorageAtEngine, calls its Serialize method and returns the received buffer

type LogEventWithAddress

type LogEventWithAddress struct {
	Address [addrLength]uint8
	Topics  []RawU256
	Data    []uint8
}

LogEventWithAddress is the type used to handle engine's SubmitResultV2 response

type QueryResult

type QueryResult struct {
	Result []interface{}
}

QueryResult is the type received from engine for query (readonly) calls

func NewQueryResult

func NewQueryResult(resp interface{}) (*QueryResult, error)

NewQueryResult allocates and returns a new QueryResult object

func (*QueryResult) ToStringResponse

func (r *QueryResult) ToStringResponse() (*string, error)

ToStringResponse processes the engine query response, retrieves the `result` map and converts it to string response

func (*QueryResult) ToUint256Response

func (r *QueryResult) ToUint256Response() (*common.Uint256, error)

ToUint256Response processes the engine query response, retrieves the `result` map and converts it to Uint256 response

type RawU256

type RawU256 struct {
	Value [raw256Length]uint8
}

RawU256 is the type used to handle engine's LogEventWithAddress response

type SubmitResultV2

type SubmitResultV2 struct {
	Version uint8
	Status  TransactionStatus
	GasUsed uint64 `borsh_skip:"true"`
	// contains filtered or unexported fields
}

SubmitResultV2 is the type used to handle engine response for sendRawTransactionSync endpoint

func (*SubmitResultV2) Deserialize

func (sr *SubmitResultV2) Deserialize(buf []byte) error

Deserialize uses borsh to initialize the SubmitResultV2 from the provided buffer

func (*SubmitResultV2) Validate

func (sr *SubmitResultV2) Validate() error

Validate checks `SubmitResultV2.Status` to return the success or errors

type SubmitStatus

type SubmitStatus struct {
	StatusMap    map[string]interface{}
	SubmitResult *SubmitResultV2
	ResponseHash string
}

SubmitStatus is the type received from engine for submit (eg: sendRawTransactionSync) calls

func NewSubmitStatus

func NewSubmitStatus(respArg interface{}, txsHash string) (*SubmitStatus, error)

NewSubmitStatus allocates and returns a new SubmitStatus object

func (*SubmitStatus) ToResponse

func (ss *SubmitStatus) ToResponse() (*string, error)

ToResponse processes the engine query response, retrieves the `result` map and returns the hash

func (*SubmitStatus) Validate

func (ss *SubmitStatus) Validate() error

Validate checks `SubmitStatus.StatusMap` to return the success or errors

type TransactionForCall

type TransactionForCall struct {
	From     *primitives.Data20   `json:"from,omitempty"`
	To       *primitives.Data20   `json:"to,omitempty"`
	Gas      *primitives.Quantity `json:"gas,omitempty"`
	GasPrice *primitives.Quantity `json:"gasPrice,omitempty"`
	Value    *primitives.Quantity `json:"value,omitempty"`
	Data     *primitives.VarData  `json:"data,omitempty"`
}

TransactionForCall is the type used to serialize eth_call input

func (*TransactionForCall) Serialize

func (tc *TransactionForCall) Serialize() ([]byte, error)

Serialize transforms TransactionForCall to transactionForCallEngine, calls its Serialize method and returns the received buffer

func (*TransactionForCall) UnmarshalJSON

func (tc *TransactionForCall) UnmarshalJSON(data []byte) error

UnmarshalJSON implements jsoniter.Unmarshaler This method is needed to make `.To` field of the TransactionForCall struct required/mandatory

func (*TransactionForCall) Validate added in v1.1.0

func (tc *TransactionForCall) Validate() error

Validate checks the incoming object and returns error for incorrect fields

type TransactionRevertStatus

type TransactionRevertStatus struct {
	Output []uint8
}

TransactionRevertStatus is the type used to handle engine's TransactionStatus response

type TransactionStatus

type TransactionStatus struct {
	Enum        borsh.Enum `borsh_enum:"true"` // treat struct as complex enum when serializing/deserializing
	Success     TransactionSuccessStatus
	Revert      TransactionRevertStatus
	OutOfGas    borsh.Enum
	OutOfFund   borsh.Enum
	OutOfOffset borsh.Enum
	CallTooDeep borsh.Enum
}

TransactionStatus is the type used to handle engine's SubmitResultV2 response

func NewTransactionStatus

func NewTransactionStatus(respArg interface{}) (*TransactionStatus, error)

NewTransactionStatus allocates and returns a new TransactionStatus object

func (*TransactionStatus) ToResponse

func (ts *TransactionStatus) ToResponse() (*string, error)

ToResponse processes the engine query response (`TransactionStatus`) and returns output buffer or errors

func (*TransactionStatus) Validate

func (ts *TransactionStatus) Validate() ([]uint8, error)

Validate checks `TransactionStatus` to return the success or errors

type TransactionSuccessStatus

type TransactionSuccessStatus struct {
	Output []uint8
}

TransactionSuccessStatus is the type used to handle engine's TransactionStatus response

Jump to

Keyboard shortcuts

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