vm

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JunoAppendActualFee added in v0.6.0

func JunoAppendActualFee(readerHandle C.uintptr_t, ptr unsafe.Pointer)

func JunoAppendResponse

func JunoAppendResponse(readerHandle C.uintptr_t, ptr unsafe.Pointer)

func JunoAppendTrace added in v0.6.0

func JunoAppendTrace(readerHandle C.uintptr_t, jsonBytes *C.void, bytesLen C.size_t)

func JunoFree

func JunoFree(ptr unsafe.Pointer)

func JunoReportError

func JunoReportError(readerHandle C.uintptr_t, txnIndex C.long, str *C.char)

func JunoStateGetClassHashAt

func JunoStateGetClassHashAt(readerHandle C.uintptr_t, contractAddress unsafe.Pointer) unsafe.Pointer

func JunoStateGetCompiledClass

func JunoStateGetCompiledClass(readerHandle C.uintptr_t, classHash unsafe.Pointer) unsafe.Pointer

func JunoStateGetNonceAt

func JunoStateGetNonceAt(readerHandle C.uintptr_t, contractAddress unsafe.Pointer) unsafe.Pointer

func JunoStateGetStorageAt

func JunoStateGetStorageAt(readerHandle C.uintptr_t, contractAddress, storageLocation unsafe.Pointer) unsafe.Pointer

Types

type DataAvailabilityMode added in v0.8.0

type DataAvailabilityMode uint32
const (
	DAModeL1 DataAvailabilityMode = iota
	DAModeL2
)

func (DataAvailabilityMode) MarshalJSON added in v0.8.0

func (m DataAvailabilityMode) MarshalJSON() ([]byte, error)

type Resource added in v0.8.0

type Resource uint32
const (
	ResourceL1Gas Resource = iota + 1
	ResourceL2Gas
)

func (Resource) MarshalJSON added in v0.8.0

func (r Resource) MarshalJSON() ([]byte, error)

func (Resource) MarshalText added in v0.8.0

func (r Resource) MarshalText() ([]byte, error)

type ResourceBounds added in v0.8.0

type ResourceBounds struct {
	MaxAmount       *felt.Felt `json:"max_amount"`
	MaxPricePerUnit *felt.Felt `json:"max_price_per_unit"`
}

type Transaction added in v0.8.0

type Transaction struct {
	Version               *felt.Felt                   `json:"version,omitempty"`
	ContractAddress       *felt.Felt                   `json:"contract_address,omitempty"`
	ContractAddressSalt   *felt.Felt                   `json:"contract_address_salt,omitempty"`
	ClassHash             *felt.Felt                   `json:"class_hash,omitempty"`
	ConstructorCallData   *[]*felt.Felt                `json:"constructor_calldata,omitempty"`
	SenderAddress         *felt.Felt                   `json:"sender_address,omitempty"`
	MaxFee                *felt.Felt                   `json:"max_fee,omitempty"`
	Signature             *[]*felt.Felt                `json:"signature,omitempty"`
	CallData              *[]*felt.Felt                `json:"calldata,omitempty"`
	EntryPointSelector    *felt.Felt                   `json:"entry_point_selector,omitempty"`
	Nonce                 *felt.Felt                   `json:"nonce,omitempty"`
	CompiledClassHash     *felt.Felt                   `json:"compiled_class_hash,omitempty"`
	ResourceBounds        *map[Resource]ResourceBounds `json:"resource_bounds,omitempty"`
	Tip                   *felt.Felt                   `json:"tip,omitempty"`
	NonceDAMode           *DataAvailabilityMode        `json:"nonce_data_availability_mode,omitempty"`
	FeeDAMode             *DataAvailabilityMode        `json:"fee_data_availability_mode,omitempty"`
	AccountDeploymentData *[]*felt.Felt                `json:"account_deployment_data,omitempty"`
	PaymasterData         *[]*felt.Felt                `json:"paymaster_data,omitempty"`
}

type TransactionExecutionError added in v0.8.0

type TransactionExecutionError struct {
	Index uint64
	Cause error
}

func (TransactionExecutionError) Error added in v0.8.0

func (TransactionExecutionError) Unwrap added in v0.8.0

func (e TransactionExecutionError) Unwrap() error

type VM added in v0.5.0

type VM interface {
	Call(contractAddr, classHash, selector *felt.Felt, calldata []felt.Felt, blockNumber,
		blockTimestamp uint64, state core.StateReader, network utils.Network,
	) ([]*felt.Felt, error)
	Execute(txns []core.Transaction, declaredClasses []core.Class, blockNumber, blockTimestamp uint64,
		sequencerAddress *felt.Felt, state core.StateReader, network utils.Network, paidFeesOnL1 []*felt.Felt,
		skipChargeFee, skipValidate, errOnRevert bool, gasPriceWEI *felt.Felt, gasPriceSTRK *felt.Felt, legacyTraceJSON bool,
	) ([]*felt.Felt, []json.RawMessage, error)
}

func New added in v0.5.0

func New(log utils.SimpleLogger) VM

Jump to

Keyboard shortcuts

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