Documentation ¶
Index ¶
- type DryCallOption
- func WithExtraPrecompiledContracts(pcs []types.PrecompiledContract) DryCallOption
- func WithStateOverrideBalance(addr gethCommon.Address, balance *big.Int) DryCallOption
- func WithStateOverrideCode(addr gethCommon.Address, code []byte) DryCallOption
- func WithStateOverrideNonce(addr gethCommon.Address, nonce uint64) DryCallOption
- func WithStateOverrideState(addr gethCommon.Address, slots map[gethCommon.Hash]gethCommon.Hash) DryCallOption
- func WithStateOverrideStateDiff(addr gethCommon.Address, slots map[gethCommon.Hash]gethCommon.Hash) DryCallOption
- func WithTracer(tracer *gethTracers.Tracer) DryCallOption
- type View
- func (v *View) DryCall(from gethCommon.Address, to gethCommon.Address, data []byte, value *big.Int, ...) (*types.Result, error)
- func (v *View) GetBalance(addr gethCommon.Address) (*big.Int, error)
- func (v *View) GetCode(addr gethCommon.Address) ([]byte, error)
- func (v *View) GetCodeHash(addr gethCommon.Address) (gethCommon.Hash, error)
- func (v *View) GetNonce(addr gethCommon.Address) (uint64, error)
- func (v *View) GetSlab(addr gethCommon.Address, key gethCommon.Hash) (gethCommon.Hash, error)
- type ViewProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DryCallOption ¶
DryRunOption captures a options to be applied before the execution of a dry call.
func WithExtraPrecompiledContracts ¶
func WithExtraPrecompiledContracts(pcs []types.PrecompiledContract) DryCallOption
WithExtraPrecompiledContracts constructs a dry call option that allows adding the precompiled contracts while executing the dry-call.
this method can be used with remote PC caller for cadence arch calls
func WithStateOverrideBalance ¶
func WithStateOverrideBalance( addr gethCommon.Address, balance *big.Int, ) DryCallOption
WithStateOverrideBalance constructs a dry call option that replaces the balance of an address before the execution a dry call.
func WithStateOverrideCode ¶
func WithStateOverrideCode( addr gethCommon.Address, code []byte, ) DryCallOption
WithStateOverrideCode constructs a dry call option that replaces the code of an address before the dry call.
func WithStateOverrideNonce ¶
func WithStateOverrideNonce( addr gethCommon.Address, nonce uint64, ) DryCallOption
WithStateOverrideNonce constructs a dry call option that replaces the nonce of an address before the execution a dry call.
func WithStateOverrideState ¶
func WithStateOverrideState( addr gethCommon.Address, slots map[gethCommon.Hash]gethCommon.Hash, ) DryCallOption
WithStateOverrideState constructs a dry call option that overrides all slots in the account storage before executing the call.
func WithStateOverrideStateDiff ¶
func WithStateOverrideStateDiff( addr gethCommon.Address, slots map[gethCommon.Hash]gethCommon.Hash, ) DryCallOption
WithStateOverrideStateDiff constructs a dry call option that overrides slots of an account before executing the call.
func WithTracer ¶
func WithTracer( tracer *gethTracers.Tracer, ) DryCallOption
WithTracer constructs a dry call option that allows running the dry call with the custom tracer.
type View ¶
type View struct {
// contains filtered or unexported fields
}
View provides query capabilities over an specific state of the EVM chain.
func NewView ¶
func NewView( chainID flow.ChainID, rootAddr flow.Address, storage *storage.EphemeralStorage, blockSnapshot types.BlockSnapshot, maxCallGasLimit uint64, ) *View
NewView constructs a new view.
func (*View) DryCall ¶
func (v *View) DryCall( from gethCommon.Address, to gethCommon.Address, data []byte, value *big.Int, gasLimit uint64, opts ...DryCallOption, ) (*types.Result, error)
DryCall runs a call off-chain and returns the results accepts override storage and precompiled call options as well as custom tracer.
func (*View) GetBalance ¶
GetBalance returns the balance for the given address can be used for the `eth_getBalance` endpoint
func (*View) GetCode ¶
func (v *View) GetCode(addr gethCommon.Address) ([]byte, error)
GetCode returns the code for the given address can be used for the `eth_getCode` endpoint
func (*View) GetCodeHash ¶
func (v *View) GetCodeHash(addr gethCommon.Address) (gethCommon.Hash, error)
GetCodeHash returns the codehash for the given address
func (*View) GetNonce ¶
func (v *View) GetNonce(addr gethCommon.Address) (uint64, error)
GetNonce returns the nonce for the given address can be used for the `eth_getTransactionCount` endpoint
func (*View) GetSlab ¶
func (v *View) GetSlab(addr gethCommon.Address, key gethCommon.Hash) (gethCommon.Hash, error)
GetSlab returns the slab for the given address and key can be used for the `eth_getStorageAt` endpoint
type ViewProvider ¶
type ViewProvider struct {
// contains filtered or unexported fields
}
ViewProvider constructs views based on the requirements
func NewViewProvider ¶
func NewViewProvider( chainID flow.ChainID, rootAddr flow.Address, sp types.StorageProvider, bp types.BlockSnapshotProvider, maxCallGasLimit uint64, ) *ViewProvider
NewViewProvider constructs a new ViewProvider
func (*ViewProvider) GetBlockView ¶
func (evp *ViewProvider) GetBlockView(height uint64) (*View, error)
GetBlockView returns the block view for the given height