ArbiterMiddleware

Struct ArbiterMiddleware 

Source
pub struct ArbiterMiddleware {
    pub label: Option<String>,
    /* private fields */
}
Expand description

A middleware structure that integrates with revm.

ArbiterMiddleware serves as a bridge between the application and revm’s execution environment, allowing for transaction sending, call execution, and other core functions. It uses a custom connection and error system tailored to Revm’s specific needs.

This allows for revm and the Environment built around it to be treated in much the same way as a live EVM blockchain can be addressed.

§Examples

Basic usage:

use arbiter_core::{environment::Environment, middleware::ArbiterMiddleware};

// Create a new environment and run it
let mut environment = Environment::builder().build();

// Retrieve the environment to create a new middleware instance
let middleware = ArbiterMiddleware::new(&environment, Some("test_label"));

The client can now be used for transactions with the environment. Use a seed like Some("test_label") for maintaining a consistent address across simulations and client labeling. Seeding is be useful for debugging and post-processing.

Fields§

§label: Option<String>

An optional label for the middleware instance

Implementations§

Source§

impl ArbiterMiddleware

Source

pub fn new( environment: &Environment, seed_and_label: Option<&str>, ) -> Result<Arc<Self>, ArbiterCoreError>

Creates a new instance of ArbiterMiddleware with procedurally generated signer/address if provided a seed/label and otherwise a random signer if not.

§Examples
use arbiter_core::{environment::Environment, middleware::ArbiterMiddleware};

// Create a new environment and run it
let mut environment = Environment::builder().build();

// Retrieve the environment to create a new middleware instance
let client = ArbiterMiddleware::new(&environment, Some("test_label"));

// We can create a middleware instance without a seed by doing the following
let no_seed_middleware = ArbiterMiddleware::new(&environment, None);

Use a seed if you want to have a constant address across simulations as well as a label for a client. This can be useful for debugging.

Source

pub fn new_from_forked_eoa( environment: &Environment, forked_eoa: eAddress, ) -> Result<Arc<Self>, ArbiterCoreError>

Creates a new instance of ArbiterMiddleware from a forked EOA.

Source

pub fn update_block( &self, block_number: impl Into<eU256>, block_timestamp: impl Into<eU256>, ) -> Result<ReceiptData, ArbiterCoreError>

Allows the user to update the block number and timestamp of the Environment to whatever they may choose at any time.

Source

pub async fn get_block_timestamp(&self) -> Result<U256, ArbiterCoreError>

Returns the timestamp of the current block.

Source

pub async fn apply_cheatcode( &self, cheatcode: Cheatcodes, ) -> Result<CheatcodesReturn, ArbiterCoreError>

Sends a cheatcode instruction to the environment.

Source

pub fn address(&self) -> eAddress

Returns the address of the wallet/signer given to a client. Matches on the EOA variant of the ArbiterMiddleware struct.

Source

pub async fn set_gas_price( &self, gas_price: U256, ) -> Result<(), ArbiterCoreError>

Allows a client to set a gas price for transactions. This can only be done if the Environment has [EnvironmentParameters] gas_settings field set to [GasSettings::UserControlled].

Trait Implementations§

Source§

impl Debug for ArbiterMiddleware

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl JsonRpcClient for ArbiterMiddleware

Source§

type Error = ProviderError

A JSON-RPC Error
Source§

fn request<'life0, 'life1, 'async_trait, T, R>( &'life0 self, method: &'life1 str, params: T, ) -> Pin<Box<dyn Future<Output = Result<R, ProviderError>> + Send + 'async_trait>>
where T: 'async_trait + Serialize + Send + Sync + Debug, R: 'async_trait + DeserializeOwned + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sends a request with the provided JSON-RPC and parameters serialized as JSON
Source§

impl Middleware for ArbiterMiddleware

Source§

fn inner(&self) -> &Self::Inner

Returns a reference to the inner middleware of which there is none when using ArbiterMiddleware so we relink to Self

Source§

fn provider(&self) -> &Provider<Self::Provider>

Provides access to the associated Ethereum provider which is given by the Provider<Connection> for ArbiterMiddleware.

Source§

fn default_sender(&self) -> Option<eAddress>

Provides the default sender address for transactions, i.e., the address of the wallet/signer given to a client of the Environment.

Source§

fn send_transaction<'life0, 'async_trait, T>( &'life0 self, tx: T, _block: Option<BlockId>, ) -> Pin<Box<dyn Future<Output = Result<PendingTransaction<'_, Self::Provider>, Self::Error>> + Send + 'async_trait>>
where T: 'async_trait + Into<TypedTransaction> + Send + Sync, Self: 'async_trait, 'life0: 'async_trait,

Sends a transaction to the Environment which acts as a simulated Ethereum network.

The method checks if the transaction is either a call to an existing contract or a deploy of a new one, and constructs the necessary transaction environment used for revm-based transactions. It then sends this transaction for execution and returns the corresponding pending transaction.

Source§

fn call<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, _block: Option<BlockId>, ) -> Pin<Box<dyn Future<Output = Result<eBytes, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Calls a contract method without creating a worldstate-changing transaction on the Environment (again, simulating the Ethereum network).

Similar to send_transaction, this method checks if the call is targeting an existing contract or deploying a new one. After executing the call, it returns the output, but no worldstate change will be documented in the revm DB.

Source§

fn watch<'b, 'life0, 'async_trait>( &'b self, filter: &'life0 Filter, ) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'b, Self::Provider, eLog>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'b: 'async_trait, 'life0: 'async_trait,

Starts watching for logs that match a specific filter.

This method creates a filter watcher that continuously checks for new logs matching the criteria in a separate thread.

Source§

fn get_transaction_count<'life0, 'async_trait, T>( &'life0 self, from: T, _block: Option<BlockId>, ) -> Pin<Box<dyn Future<Output = Result<eU256, Self::Error>> + Send + 'async_trait>>
where T: 'async_trait + Into<NameOrAddress> + Send + Sync, Self: 'async_trait, 'life0: 'async_trait,

Returns the nonce of the address

Source§

fn fill_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 mut TypedTransaction, _block: Option<BlockId>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fill necessary details of a transaction for dispatch

This function is defined on providers to behave as follows:

  1. populate the from field with the client address
  2. Estimate gas usage

It does NOT set the nonce by default.

Source§

fn get_storage_at<'life0, 'async_trait, T>( &'life0 self, account: T, key: H256, block: Option<BlockId>, ) -> Pin<Box<dyn Future<Output = Result<H256, ArbiterCoreError>> + Send + 'async_trait>>
where T: 'async_trait + Into<NameOrAddress> + Send + Sync, Self: 'async_trait, 'life0: 'async_trait,

Fetches the value stored at the storage slot key for an account at address. todo: implement the storage at a specific block feature.

Source§

type Provider = Connection

The JSON-RPC client type at the bottom of the stack
Source§

type Error = ArbiterCoreError

Error type returned by most operations
Source§

type Inner = Provider<Connection>

The next-lower middleware in the middleware stack
Source§

fn get_logs<'life0, 'life1, 'async_trait>( &'life0 self, filter: &'life1 Filter, ) -> Pin<Box<dyn Future<Output = Result<Vec<eLog>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns an array (possibly empty) of logs that match the filter
Source§

fn get_gas_price<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<U256, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Gets the current gas price as estimated by the node
Source§

fn get_block_number<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<U64, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the block number
Source§

fn get_balance<'life0, 'async_trait, T>( &'life0 self, from: T, block: Option<BlockId>, ) -> Pin<Box<dyn Future<Output = Result<U256, Self::Error>> + Send + 'async_trait>>
where T: 'async_trait + Into<NameOrAddress> + Send + Sync, Self: 'async_trait, 'life0: 'async_trait,

Returns the account’s balance
Source§

fn subscribe_logs<'a, 'life0, 'async_trait>( &'a self, filter: &'life0 Filter, ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'a, Self::Provider, eLog>, Self::Error>> + Send + 'async_trait>>
where <Self as Middleware>::Provider: PubsubClient, Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

Subscribe to a stream of event logs matchin the provided Filter. Read more
Source§

fn convert_err(p: ProviderError) -> Self::Error

Convert a provider error into the associated error type by successively converting it to every intermediate middleware error
Source§

fn client_version<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<String, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns the current client version using the web3_clientVersion RPC.
Source§

fn get_header<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T, ) -> Pin<Box<dyn Future<Output = Result<Option<Block<Transaction>>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Self: 'async_trait,

Get the block header by number or hash
Source§

fn send_escalating<'a, 'life0, 'async_trait>( &'a self, tx: &'life0 TypedTransaction, escalations: usize, policy: Box<dyn Fn(U256, usize) -> U256 + Send + Sync>, ) -> Pin<Box<dyn Future<Output = Result<EscalatingPending<'a, Self::Provider>, Self::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, 'life0: 'async_trait, Self: 'async_trait,

Send a transaction with a simple escalation policy. Read more
Source§

fn resolve_name<'life0, 'life1, 'async_trait>( &'life0 self, ens_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<H160, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Returns the address that the ens_name resolves to (or None if not configured). Read more
Source§

fn lookup_address<'life0, 'async_trait>( &'life0 self, address: H160, ) -> Pin<Box<dyn Future<Output = Result<String, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns the ENS name the address resolves to (or None if not configured). Read more
Source§

fn resolve_avatar<'life0, 'life1, 'async_trait>( &'life0 self, ens_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Url, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Returns the avatar HTTP link of the avatar that the ens_name resolves to (or None if not configured) Read more
Source§

fn resolve_nft<'life0, 'async_trait>( &'life0 self, token: ERCNFT, ) -> Pin<Box<dyn Future<Output = Result<Url, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns the URL (not necesserily HTTP) of the image behind a token. Read more
Source§

fn resolve_field<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ens_name: &'life1 str, field: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<String, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Fetch a field for the ens_name (no None if not configured). Read more
Source§

fn get_block<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T, ) -> Pin<Box<dyn Future<Output = Result<Option<Block<H256>>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Self: 'async_trait,

Gets the block at block_hash_or_number (transaction hashes only)
Source§

fn get_block_with_txs<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T, ) -> Pin<Box<dyn Future<Output = Result<Option<Block<Transaction>>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Self: 'async_trait,

Gets the block at block_hash_or_number (full transactions included)
Source§

fn get_uncle_count<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T, ) -> Pin<Box<dyn Future<Output = Result<U256, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Self: 'async_trait,

Gets the block uncle count at block_hash_or_number
Source§

fn get_uncle<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T, idx: U64, ) -> Pin<Box<dyn Future<Output = Result<Option<Block<H256>>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Self: 'async_trait,

Gets the block uncle at block_hash_or_number and idx
Source§

fn estimate_gas<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, block: Option<BlockId>, ) -> Pin<Box<dyn Future<Output = Result<U256, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Sends a transaction to a single Ethereum node and return the estimated amount of gas required (as a U256) to send it This is free, but only an estimate. Providing too little gas will result in a transaction being rejected (while still consuming all provided gas).
Source§

fn syncing<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<SyncingStatus, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Return current client syncing status. If IsFalse sync is over.
Source§

fn get_chainid<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<U256, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns the currently configured chain id, a value used in replay-protected transaction signing as introduced by EIP-155.
Source§

fn get_net_version<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<String, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns the network version.
Source§

fn get_transaction<'life0, 'async_trait, T>( &'life0 self, transaction_hash: T, ) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Send + Sync + Into<H256>, Self: 'async_trait,

Gets the transaction with transaction_hash
Source§

fn get_transaction_by_block_and_index<'life0, 'async_trait, T>( &'life0 self, block_hash_or_number: T, idx: U64, ) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockId> + Send + Sync, Self: 'async_trait,

Gets the transaction with block and index
Source§

fn get_transaction_receipt<'life0, 'async_trait, T>( &'life0 self, transaction_hash: T, ) -> Pin<Box<dyn Future<Output = Result<Option<TransactionReceipt>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Send + Sync + Into<H256>, Self: 'async_trait,

Gets the transaction receipt with transaction_hash
Source§

fn get_block_receipts<'life0, 'async_trait, T>( &'life0 self, block: T, ) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionReceipt>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockNumber> + Send + Sync, Self: 'async_trait,

Returns all receipts for a block. Read more
Source§

fn estimate_eip1559_fees<'life0, 'async_trait>( &'life0 self, estimator: Option<fn(U256, Vec<Vec<U256>>) -> (U256, U256)>, ) -> Pin<Box<dyn Future<Output = Result<(U256, U256), Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Gets a heuristic recommendation of max fee per gas and max priority fee per gas for EIP-1559 compatible transactions.
Source§

fn get_accounts<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<H160>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Gets the accounts on the node
Source§

fn send_raw_transaction<'a, 'async_trait>( &'a self, tx: Bytes, ) -> Pin<Box<dyn Future<Output = Result<PendingTransaction<'a, Self::Provider>, Self::Error>> + Send + 'async_trait>>
where 'a: 'async_trait, Self: 'async_trait,

Send the raw RLP encoded transaction to the entire Ethereum network and returns the transaction’s hash This will consume gas from the account that signed the transaction.
Source§

fn is_signer<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

This returns true if either the middleware stack contains a SignerMiddleware, or the JSON-RPC provider has an unlocked key that can sign using the eth_sign call. If none of the above conditions are met, then the middleware stack is not capable of signing data.
Source§

fn sign<'life0, 'life1, 'async_trait, T>( &'life0 self, data: T, from: &'life1 H160, ) -> Pin<Box<dyn Future<Output = Result<Signature, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait + Into<Bytes> + Send + Sync, Self: 'async_trait,

Signs data using a specific account. This account needs to be unlocked, or the middleware stack must contain a SignerMiddleware
Source§

fn sign_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, from: H160, ) -> Pin<Box<dyn Future<Output = Result<Signature, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Sign a transaction via RPC call
Source§

fn get_logs_paginated<'a>( &'a self, filter: &Filter, page_size: u64, ) -> LogQuery<'a, Self::Provider>

Returns a stream of logs are loaded in pages of given page size
Source§

fn watch_pending_transactions<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'life0, Self::Provider, H256>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Streams pending transactions. Read more
Source§

fn watch_blocks<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<FilterWatcher<'life0, Self::Provider, H256>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Streams new block hashes Read more
Source§

fn get_code<'life0, 'async_trait, T>( &'life0 self, at: T, block: Option<BlockId>, ) -> Pin<Box<dyn Future<Output = Result<Bytes, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Self: 'async_trait,

Returns the deployed code at a given address
Source§

fn get_proof<'life0, 'async_trait, T>( &'life0 self, from: T, locations: Vec<H256>, block: Option<BlockId>, ) -> Pin<Box<dyn Future<Output = Result<EIP1186ProofResponse, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<NameOrAddress> + Send + Sync, Self: 'async_trait,

Returns the EIP-1186 proof response https://github.com/ethereum/EIPs/issues/1186
Source§

fn mining<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns an indication if this node is currently mining.
Source§

fn import_raw_key<'life0, 'async_trait>( &'life0 self, private_key: Bytes, passphrase: String, ) -> Pin<Box<dyn Future<Output = Result<H160, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Sends the given key to the node to be encrypted with the provided passphrase and stored. Read more
Source§

fn unlock_account<'life0, 'async_trait, T>( &'life0 self, account: T, passphrase: String, duration: Option<u64>, ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<H160> + Send + Sync, Self: 'async_trait,

Prompts the node to decrypt the given account from its keystore. Read more
Source§

fn add_peer<'life0, 'async_trait>( &'life0 self, enode_url: String, ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Requests adding the given peer, returning a boolean representing whether or not the peer was accepted for tracking.
Source§

fn add_trusted_peer<'life0, 'async_trait>( &'life0 self, enode_url: String, ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Requests adding the given peer as a trusted peer, which the node will always connect to even when its peer slots are full.
Source§

fn node_info<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<NodeInfo, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns general information about the node as well as information about the running p2p protocols (e.g. eth, snap).
Source§

fn peers<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<PeerInfo>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns the list of peers currently connected to the node.
Source§

fn remove_peer<'life0, 'async_trait>( &'life0 self, enode_url: String, ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Requests to remove the given peer, returning true if the enode was successfully parsed and the peer was removed.
Source§

fn remove_trusted_peer<'life0, 'async_trait>( &'life0 self, enode_url: String, ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Requests to remove the given peer, returning a boolean representing whether or not the enode url passed was validated. A return value of true does not necessarily mean that the peer was disconnected.
Source§

fn start_mining<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Starts the miner.
Source§

fn stop_mining<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Stop terminates the miner, both at the consensus engine level as well as at the block creation level.
Source§

fn txpool_content<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<TxpoolContent, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns the details of all transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only. Ref: Here
Source§

fn txpool_inspect<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<TxpoolInspect, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns a summary of all the transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only. Ref: Here
Source§

fn txpool_status<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<TxpoolStatus, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns the number of transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only. Ref: Here
Source§

fn debug_trace_transaction<'life0, 'async_trait>( &'life0 self, tx_hash: H256, trace_options: GethDebugTracingOptions, ) -> Pin<Box<dyn Future<Output = Result<GethTrace, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

After replaying any previous transactions in the same block, Replays a transaction, returning the traces configured with passed options
Source§

fn debug_trace_call<'life0, 'async_trait, T>( &'life0 self, req: T, block: Option<BlockId>, trace_options: GethDebugTracingCallOptions, ) -> Pin<Box<dyn Future<Output = Result<GethTrace, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, Self: 'async_trait,

Executes the given call and returns a number of possible traces for it
Source§

fn debug_trace_block_by_number<'life0, 'async_trait>( &'life0 self, block: Option<BlockNumber>, trace_options: GethDebugTracingOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<GethTrace>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Replays all transactions in a given block (specified by block number) and returns the traces configured with passed options Ref: Here
Source§

fn debug_trace_block_by_hash<'life0, 'async_trait>( &'life0 self, block: H256, trace_options: GethDebugTracingOptions, ) -> Pin<Box<dyn Future<Output = Result<Vec<GethTrace>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Replays all transactions in a given block (specified by block hash) and returns the traces configured with passed options Ref: Here
Source§

fn trace_call<'life0, 'async_trait, T>( &'life0 self, req: T, trace_type: Vec<TraceType>, block: Option<BlockNumber>, ) -> Pin<Box<dyn Future<Output = Result<BlockTrace, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, Self: 'async_trait,

Executes the given call and returns a number of possible traces for it
Source§

fn trace_call_many<'life0, 'async_trait, T>( &'life0 self, req: Vec<(T, Vec<TraceType>)>, block: Option<BlockNumber>, ) -> Pin<Box<dyn Future<Output = Result<Vec<BlockTrace>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<TypedTransaction> + Send + Sync, Self: 'async_trait,

Executes given calls and returns a number of possible traces for each call
Source§

fn trace_raw_transaction<'life0, 'async_trait>( &'life0 self, data: Bytes, trace_type: Vec<TraceType>, ) -> Pin<Box<dyn Future<Output = Result<BlockTrace, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Traces a call to eth_sendRawTransaction without making the call, returning the traces
Source§

fn trace_replay_transaction<'life0, 'async_trait>( &'life0 self, hash: H256, trace_type: Vec<TraceType>, ) -> Pin<Box<dyn Future<Output = Result<BlockTrace, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Replays a transaction, returning the traces
Source§

fn trace_replay_block_transactions<'life0, 'async_trait>( &'life0 self, block: BlockNumber, trace_type: Vec<TraceType>, ) -> Pin<Box<dyn Future<Output = Result<Vec<BlockTrace>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Replays all transactions in a block returning the requested traces for each transaction
Source§

fn trace_block<'life0, 'async_trait>( &'life0 self, block: BlockNumber, ) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns traces created at given block
Source§

fn trace_filter<'life0, 'async_trait>( &'life0 self, filter: TraceFilter, ) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Return traces matching the given filter
Source§

fn trace_get<'life0, 'async_trait, T>( &'life0 self, hash: H256, index: Vec<T>, ) -> Pin<Box<dyn Future<Output = Result<Trace, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<U64> + Send + Sync, Self: 'async_trait,

Returns trace at the given position
Source§

fn trace_transaction<'life0, 'async_trait>( &'life0 self, hash: H256, ) -> Pin<Box<dyn Future<Output = Result<Vec<Trace>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Returns all traces of a given transaction
Source§

fn parity_block_receipts<'life0, 'async_trait, T>( &'life0 self, block: T, ) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionReceipt>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait + Into<BlockNumber> + Send + Sync, Self: 'async_trait,

Returns all receipts for that block. Must be done on a parity node.
Source§

fn subscribe_blocks<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'life0, Self::Provider, Block<H256>>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self::Provider: PubsubClient, Self: 'async_trait,

Subscribe to a stream of incoming blocks. Read more
Source§

fn subscribe_pending_txs<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'life0, Self::Provider, H256>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self::Provider: PubsubClient, Self: 'async_trait,

Subscribe to a stream of pending transaction hashes. Read more
Source§

fn subscribe_full_pending_txs<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<SubscriptionStream<'life0, Self::Provider, Transaction>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self::Provider: PubsubClient, Self: 'async_trait,

Subscribe to a stream of pending transaction bodies. Read more
Source§

fn fee_history<'life0, 'life1, 'async_trait, T>( &'life0 self, block_count: T, last_block: BlockNumber, reward_percentiles: &'life1 [f64], ) -> Pin<Box<dyn Future<Output = Result<FeeHistory, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait + Into<U256> + Serialize + Send + Sync, Self: 'async_trait,

Query the node for a FeeHistory object. This objct contains information about the EIP-1559 base fee in past blocks, as well as gas utilization within those blocks. Read more
Source§

fn create_access_list<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 TypedTransaction, block: Option<BlockId>, ) -> Pin<Box<dyn Future<Output = Result<AccessListWithGasUsed, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Query the node for an EIP-2930 Access List. Read more
Source§

impl PubsubClient for ArbiterMiddleware

Source§

type NotificationStream = Pin<Box<dyn Stream<Item = Box<RawValue>> + Send>>

The type of stream this transport returns
Source§

fn subscribe<T: Into<U256>>( &self, id: T, ) -> Result<Self::NotificationStream, Self::Error>

Add a subscription to this transport
Source§

fn unsubscribe<T: Into<U256>>(&self, id: T) -> Result<(), Self::Error>

Remove a subscription from this transport
Source§

impl Signer for ArbiterMiddleware

Source§

fn sign_transaction<'life0, 'life1, 'async_trait>( &'life0 self, message: &'life1 TypedTransaction, ) -> Pin<Box<dyn Future<Output = Result<Signature, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Signs the transaction

Source§

fn sign_typed_data<'life0, 'life1, 'async_trait, T>( &'life0 self, payload: &'life1 T, ) -> Pin<Box<dyn Future<Output = Result<Signature, Self::Error>> + Send + 'async_trait>>
where T: 'async_trait + Eip712 + Send + Sync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Encodes and signs the typed data according EIP-712. Payload must implement Eip712 trait.

Source§

fn address(&self) -> eAddress

Returns the signer’s Ethereum Address

Source§

fn chain_id(&self) -> u64

Returns the signer’s chain id

Source§

fn with_chain_id<T: Into<u64>>(self, chain_id: T) -> Self

Sets the signer’s chain id

Source§

type Error = ArbiterCoreError

Source§

fn sign_message<'life0, 'async_trait, S>( &'life0 self, message: S, ) -> Pin<Box<dyn Future<Output = Result<Signature, Self::Error>> + Send + 'async_trait>>
where S: 'async_trait + Send + Sync + AsRef<[u8]>, Self: 'async_trait, 'life0: 'async_trait,

Signs the hash of the provided message after prefixing it

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<C> JsonRpcClientWrapper for C
where C: JsonRpcClient,

Source§

fn request<'life0, 'life1, 'async_trait>( &'life0 self, method: &'life1 str, params: QuorumParams, ) -> Pin<Box<dyn Future<Output = Result<Value, ProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, C: 'async_trait,

Make a request, as crate::JsonRpcClient
Source§

impl<M> MiddlewareBuilder for M
where M: Middleware + 'static,

Source§

fn wrap_into<F, T>(self, f: F) -> T
where F: FnOnce(Self) -> T, T: Middleware,

Wraps self inside a new Middleware. Read more
Source§

fn with_signer<S>(self, s: S) -> SignerMiddleware<Self, S>
where S: Signer,

Wraps self inside a SignerMiddleware.
Source§

fn nonce_manager(self, address: H160) -> NonceManagerMiddleware<Self>

Wraps self inside a NonceManagerMiddleware.
Source§

fn gas_oracle<G>(self, gas_oracle: G) -> GasOracleMiddleware<Self, G>
where G: GasOracle,

Wraps self inside a GasOracleMiddleware.
Source§

impl<T> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> JsonSchemaMaybe for T