pub trait HardhatApiServer:
Sized
+ Send
+ Sync
+ 'static {
Show 17 methods
// Required methods
fn hardhat_drop_transaction(
&self,
tx_hash: B256,
) -> impl Future<Output = RpcResult<bool>> + Send;
fn hardhat_impersonate_account(
&self,
address: Address,
) -> impl Future<Output = RpcResult<()>> + Send;
fn hardhat_get_automine(
&self,
) -> impl Future<Output = RpcResult<bool>> + Send;
fn hardhat_metadata(
&self,
) -> impl Future<Output = RpcResult<Metadata>> + Send;
fn hardhat_mine(
&self,
blocks: Option<U256>,
interval: Option<U256>,
) -> impl Future<Output = RpcResult<()>> + Send;
fn hardhat_reset(
&self,
fork: Option<Forking>,
) -> impl Future<Output = RpcResult<()>> + Send;
fn hardhat_set_balance(
&self,
address: Address,
balance: U256,
) -> impl Future<Output = RpcResult<()>> + Send;
fn hardhat_set_code(
&self,
address: Address,
code: Bytes,
) -> impl Future<Output = RpcResult<()>> + Send;
fn hardhat_set_coinbase(
&self,
address: Address,
) -> impl Future<Output = RpcResult<()>> + Send;
fn hardhat_set_logging_enabled(
&self,
enabled: bool,
) -> impl Future<Output = RpcResult<()>> + Send;
fn hardhat_set_min_gas_price(
&self,
gas_price: U256,
) -> impl Future<Output = RpcResult<()>> + Send;
fn hardhat_set_next_block_base_fee_per_gas(
&self,
base_fee_per_gas: U256,
) -> impl Future<Output = RpcResult<()>> + Send;
fn hardhat_set_prev_randao(
&self,
prev_randao: B256,
) -> impl Future<Output = RpcResult<()>> + Send;
fn hardhat_set_nonce(
&self,
address: Address,
nonce: U256,
) -> impl Future<Output = RpcResult<()>> + Send;
fn hardhat_set_storage_at(
&self,
address: Address,
slot: U256,
value: B256,
) -> impl Future<Output = RpcResult<()>> + Send;
fn hardhat_stop_impersonating_account(
&self,
address: Address,
) -> impl Future<Output = RpcResult<()>> + Send;
// Provided method
fn into_rpc(self) -> RpcModule<Self> { ... }
}Expand description
Server trait implementation for the HardhatApi RPC API.
Required Methods§
Sourcefn hardhat_drop_transaction(
&self,
tx_hash: B256,
) -> impl Future<Output = RpcResult<bool>> + Send
fn hardhat_drop_transaction( &self, tx_hash: B256, ) -> impl Future<Output = RpcResult<bool>> + Send
Removes the given transaction from the mempool, if it exists.
Returns true if successful, otherwise false.
Sourcefn hardhat_impersonate_account(
&self,
address: Address,
) -> impl Future<Output = RpcResult<()>> + Send
fn hardhat_impersonate_account( &self, address: Address, ) -> impl Future<Output = RpcResult<()>> + Send
Allows Hardhat Network to sign transactions as the given address.
Sourcefn hardhat_get_automine(&self) -> impl Future<Output = RpcResult<bool>> + Send
fn hardhat_get_automine(&self) -> impl Future<Output = RpcResult<bool>> + Send
Returns true if automatic mining is enabled, and false otherwise.
Sourcefn hardhat_metadata(&self) -> impl Future<Output = RpcResult<Metadata>> + Send
fn hardhat_metadata(&self) -> impl Future<Output = RpcResult<Metadata>> + Send
Returns an object with metadata about the instance of the Hardhat network.
Sourcefn hardhat_mine(
&self,
blocks: Option<U256>,
interval: Option<U256>,
) -> impl Future<Output = RpcResult<()>> + Send
fn hardhat_mine( &self, blocks: Option<U256>, interval: Option<U256>, ) -> impl Future<Output = RpcResult<()>> + Send
Mines a specified number of blocks at a given interval.
Sourcefn hardhat_reset(
&self,
fork: Option<Forking>,
) -> impl Future<Output = RpcResult<()>> + Send
fn hardhat_reset( &self, fork: Option<Forking>, ) -> impl Future<Output = RpcResult<()>> + Send
Resets back to a fresh forked state, fork from another block number or disable forking.
Sourcefn hardhat_set_balance(
&self,
address: Address,
balance: U256,
) -> impl Future<Output = RpcResult<()>> + Send
fn hardhat_set_balance( &self, address: Address, balance: U256, ) -> impl Future<Output = RpcResult<()>> + Send
Sets the balance for the given address.
Sourcefn hardhat_set_code(
&self,
address: Address,
code: Bytes,
) -> impl Future<Output = RpcResult<()>> + Send
fn hardhat_set_code( &self, address: Address, code: Bytes, ) -> impl Future<Output = RpcResult<()>> + Send
Modifies the bytecode stored at an account’s address.
Sourcefn hardhat_set_coinbase(
&self,
address: Address,
) -> impl Future<Output = RpcResult<()>> + Send
fn hardhat_set_coinbase( &self, address: Address, ) -> impl Future<Output = RpcResult<()>> + Send
Sets the coinbase address to be used in new blocks.
Sourcefn hardhat_set_logging_enabled(
&self,
enabled: bool,
) -> impl Future<Output = RpcResult<()>> + Send
fn hardhat_set_logging_enabled( &self, enabled: bool, ) -> impl Future<Output = RpcResult<()>> + Send
Enables or disables logging.
Sourcefn hardhat_set_min_gas_price(
&self,
gas_price: U256,
) -> impl Future<Output = RpcResult<()>> + Send
fn hardhat_set_min_gas_price( &self, gas_price: U256, ) -> impl Future<Output = RpcResult<()>> + Send
Changes the minimum gas price accepted by the network (in wei).
Sourcefn hardhat_set_next_block_base_fee_per_gas(
&self,
base_fee_per_gas: U256,
) -> impl Future<Output = RpcResult<()>> + Send
fn hardhat_set_next_block_base_fee_per_gas( &self, base_fee_per_gas: U256, ) -> impl Future<Output = RpcResult<()>> + Send
Sets the base fee of the next block.
Sourcefn hardhat_set_prev_randao(
&self,
prev_randao: B256,
) -> impl Future<Output = RpcResult<()>> + Send
fn hardhat_set_prev_randao( &self, prev_randao: B256, ) -> impl Future<Output = RpcResult<()>> + Send
Sets the PREVRANDAO value of the next block.
Sourcefn hardhat_set_nonce(
&self,
address: Address,
nonce: U256,
) -> impl Future<Output = RpcResult<()>> + Send
fn hardhat_set_nonce( &self, address: Address, nonce: U256, ) -> impl Future<Output = RpcResult<()>> + Send
Modifies an account’s nonce by overwriting it.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".