reth_rpc_api::clients

Trait HardhatApiClient

Source
pub trait HardhatApiClient: ClientT {
Show 16 methods // Provided methods fn hardhat_drop_transaction<'life0, 'async_trait>( &'life0 self, tx_hash: B256, ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn hardhat_impersonate_account<'life0, 'async_trait>( &'life0 self, address: Address, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn hardhat_get_automine<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn hardhat_metadata<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Metadata, Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn hardhat_mine<'life0, 'async_trait>( &'life0 self, blocks: Option<U256>, interval: Option<U256>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn hardhat_reset<'life0, 'async_trait>( &'life0 self, fork: Option<Forking>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn hardhat_set_balance<'life0, 'async_trait>( &'life0 self, address: Address, balance: U256, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn hardhat_set_code<'life0, 'async_trait>( &'life0 self, address: Address, code: Bytes, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn hardhat_set_coinbase<'life0, 'async_trait>( &'life0 self, address: Address, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn hardhat_set_logging_enabled<'life0, 'async_trait>( &'life0 self, enabled: bool, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn hardhat_set_min_gas_price<'life0, 'async_trait>( &'life0 self, gas_price: U256, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn hardhat_set_next_block_base_fee_per_gas<'life0, 'async_trait>( &'life0 self, base_fee_per_gas: U256, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn hardhat_set_prev_randao<'life0, 'async_trait>( &'life0 self, prev_randao: B256, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn hardhat_set_nonce<'life0, 'async_trait>( &'life0 self, address: Address, nonce: U256, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn hardhat_set_storage_at<'life0, 'async_trait>( &'life0 self, address: Address, slot: U256, value: B256, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn hardhat_stop_impersonating_account<'life0, 'async_trait>( &'life0 self, address: Address, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait { ... }
}
Available on crate feature client only.
Expand description

Client implementation for the HardhatApi RPC API.

Provided Methods§

Source

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

Removes the given transaction from the mempool, if it exists.

Returns true if successful, otherwise false.

Source

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

Allows Hardhat Network to sign transactions as the given address.

Source

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

Returns true if automatic mining is enabled, and false otherwise.

Source

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

Returns an object with metadata about the instance of the Hardhat network.

Source

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

Mines a specified number of blocks at a given interval.

Source

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

Resets back to a fresh forked state, fork from another block number or disable forking.

Source

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

Sets the balance for the given address.

Source

fn hardhat_set_code<'life0, 'async_trait>( &'life0 self, address: Address, code: Bytes, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Modifies the bytecode stored at an account’s address.

Source

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

Sets the coinbase address to be used in new blocks.

Source

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

Enables or disables logging.

Source

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

Changes the minimum gas price accepted by the network (in wei).

Source

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

Sets the base fee of the next block.

Source

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

Sets the PREVRANDAO value of the next block.

Source

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

Modifies an account’s nonce by overwriting it.

Source

fn hardhat_set_storage_at<'life0, 'async_trait>( &'life0 self, address: Address, slot: U256, value: B256, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Writes a single position of an account’s storage.

Source

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

Stops impersonating the given address.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<TypeJsonRpseeInteral> HardhatApiClient for TypeJsonRpseeInteral
where TypeJsonRpseeInteral: ClientT,