pub trait AnvilNamespaceServer:
Sized
+ Send
+ Sync
+ 'static {
Show 31 methods
// Required methods
fn dump_state<'life0, 'async_trait>(
&'life0 self,
preserve_historical_states: Option<bool>,
) -> Pin<Box<dyn Future<Output = RpcResult<Bytes>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn load_state<'life0, 'async_trait>(
&'life0 self,
bytes: Bytes,
) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn mine_detailed<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RpcResult<Block<DetailedTransaction>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_rpc_url<'life0, 'async_trait>(
&'life0 self,
url: String,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_next_block_base_fee_per_gas<'life0, 'async_trait>(
&'life0 self,
base_fee: U256,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn drop_transaction<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<H256>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn drop_all_transactions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn remove_pool_transactions<'life0, 'async_trait>(
&'life0 self,
address: Address,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_auto_mine<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_auto_mine<'life0, 'async_trait>(
&'life0 self,
enable: bool,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_interval_mining<'life0, 'async_trait>(
&'life0 self,
seconds: u64,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_block_timestamp_interval<'life0, 'async_trait>(
&'life0 self,
seconds: u64,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn remove_block_timestamp_interval<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_min_gas_price<'life0, 'async_trait>(
&'life0 self,
gas: U256,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_logging_enabled<'life0, 'async_trait>(
&'life0 self,
enable: bool,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn snapshot<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RpcResult<U64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn revert<'life0, 'async_trait>(
&'life0 self,
id: U64,
) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_time<'life0, 'async_trait>(
&'life0 self,
timestamp: Numeric,
) -> Pin<Box<dyn Future<Output = RpcResult<i128>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn increase_time<'life0, 'async_trait>(
&'life0 self,
seconds: Numeric,
) -> Pin<Box<dyn Future<Output = RpcResult<u64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_next_block_timestamp<'life0, 'async_trait>(
&'life0 self,
timestamp: Numeric,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn auto_impersonate_account<'life0, 'async_trait>(
&'life0 self,
enabled: bool,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_balance<'life0, 'async_trait>(
&'life0 self,
address: Address,
balance: U256,
) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_nonce<'life0, 'async_trait>(
&'life0 self,
address: Address,
nonce: U256,
) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn anvil_mine<'life0, 'async_trait>(
&'life0 self,
num_blocks: Option<U64>,
interval: Option<U64>,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn reset_network<'life0, 'async_trait>(
&'life0 self,
reset_spec: Option<ResetRequest>,
) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn impersonate_account<'life0, 'async_trait>(
&'life0 self,
address: Address,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn stop_impersonating_account<'life0, 'async_trait>(
&'life0 self,
address: Address,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_code<'life0, 'async_trait>(
&'life0 self,
address: Address,
code: String,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_storage_at<'life0, 'async_trait>(
&'life0 self,
address: Address,
slot: U256,
value: U256,
) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_chain_id<'life0, 'async_trait>(
&'life0 self,
id: u32,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn into_rpc(self) -> RpcModule<Self> { ... }
}
Expand description
Server trait implementation for the AnvilNamespace
RPC API.
Required Methods§
Sourcefn dump_state<'life0, 'async_trait>(
&'life0 self,
preserve_historical_states: Option<bool>,
) -> Pin<Box<dyn Future<Output = RpcResult<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn dump_state<'life0, 'async_trait>(
&'life0 self,
preserve_historical_states: Option<bool>,
) -> Pin<Box<dyn Future<Output = RpcResult<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn load_state<'life0, 'async_trait>(
&'life0 self,
bytes: Bytes,
) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_state<'life0, 'async_trait>(
&'life0 self,
bytes: Bytes,
) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn mine_detailed<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RpcResult<Block<DetailedTransaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn mine_detailed<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RpcResult<Block<DetailedTransaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Mines a single block in the same way as evm_mine
but returns extra fields.
§Returns
Freshly mined block’s representation along with extra fields.
Sourcefn set_rpc_url<'life0, 'async_trait>(
&'life0 self,
url: String,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_rpc_url<'life0, 'async_trait>(
&'life0 self,
url: String,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sets the fork RPC url. Assumes the underlying chain is the same as before.
§Arguments
url
- Fork’s new URL
Sourcefn set_next_block_base_fee_per_gas<'life0, 'async_trait>(
&'life0 self,
base_fee: U256,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_next_block_base_fee_per_gas<'life0, 'async_trait>(
&'life0 self,
base_fee: U256,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sets the base fee of the next block.
§Arguments
base_fee
- Value to be set as base fee for the next block
Sourcefn drop_transaction<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<H256>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn drop_transaction<'life0, 'async_trait>(
&'life0 self,
hash: H256,
) -> Pin<Box<dyn Future<Output = RpcResult<Option<H256>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn drop_all_transactions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn drop_all_transactions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Remove all transactions from the pool.
Sourcefn remove_pool_transactions<'life0, 'async_trait>(
&'life0 self,
address: Address,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn remove_pool_transactions<'life0, 'async_trait>(
&'life0 self,
address: Address,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Remove all transactions from the pool by sender address.
§Arguments
address
- Sender which transactions should be removed from the pool
Sourcefn get_auto_mine<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_auto_mine<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn set_auto_mine<'life0, 'async_trait>(
&'life0 self,
enable: bool,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_auto_mine<'life0, 'async_trait>(
&'life0 self,
enable: bool,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Enables or disables, based on the single boolean argument, the automatic mining of new blocks with each new transaction submitted to the network.
§Arguments
enable
- iftrue
automatic mining will be enabled, disabled otherwise
Sourcefn set_interval_mining<'life0, 'async_trait>(
&'life0 self,
seconds: u64,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_interval_mining<'life0, 'async_trait>(
&'life0 self,
seconds: u64,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sets the mining behavior to interval with the given interval (seconds).
§Arguments
seconds
- Frequency of automatic block production (in seconds)
Sourcefn set_block_timestamp_interval<'life0, 'async_trait>(
&'life0 self,
seconds: u64,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_block_timestamp_interval<'life0, 'async_trait>(
&'life0 self,
seconds: u64,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sets the block timestamp interval. All future blocks’ timestamps will have the provided amount of seconds in-between of them. Does not affect the block production interval.
§Arguments
seconds
- The interval between two consecutive blocks (in seconds)
Sourcefn remove_block_timestamp_interval<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn remove_block_timestamp_interval<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Removes the block timestamp interval if it exists.
§Returns
true
if an existing interval was removed, false
otherwise
Sourcefn set_min_gas_price<'life0, 'async_trait>(
&'life0 self,
gas: U256,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_min_gas_price<'life0, 'async_trait>(
&'life0 self,
gas: U256,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set the minimum gas price for the node. Unsupported for ZKsync as it is only relevant for pre-EIP1559 chains.
§Arguments
gas
- The minimum gas price to be set
Sourcefn set_logging_enabled<'life0, 'async_trait>(
&'life0 self,
enable: bool,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_logging_enabled<'life0, 'async_trait>(
&'life0 self,
enable: bool,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn snapshot<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RpcResult<U64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn snapshot<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RpcResult<U64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Snapshot the state of the blockchain at the current block. Takes no parameters. Returns the id of the snapshot
that was created. A snapshot can only be reverted once. After a successful anvil_revert
, the same snapshot id cannot
be used again. Consider creating a new snapshot after each anvil_revert
if you need to revert to the same
point multiple times.
§Returns
The U64
identifier for this snapshot.
Sourcefn revert<'life0, 'async_trait>(
&'life0 self,
id: U64,
) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn revert<'life0, 'async_trait>(
&'life0 self,
id: U64,
) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Revert the state of the blockchain to a previous snapshot. Takes a single parameter, which is the snapshot id to revert to. This deletes the given snapshot, as well as any snapshots taken after (e.g.: reverting to id 0x1 will delete snapshots with ids 0x1, 0x2, etc.)
§Arguments
id
- The snapshot id to revert
§Returns
true
if a snapshot was reverted, otherwise false
.
Sourcefn set_time<'life0, 'async_trait>(
&'life0 self,
timestamp: Numeric,
) -> Pin<Box<dyn Future<Output = RpcResult<i128>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_time<'life0, 'async_trait>(
&'life0 self,
timestamp: Numeric,
) -> Pin<Box<dyn Future<Output = RpcResult<i128>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set the current timestamp for the node. Warning: This will allow you to move backwards in time, which may cause new blocks to appear to be mined before old blocks. This will result in an invalid state.
§Arguments
time
- The timestamp to set the time to
§Returns
The difference between the current timestamp and the new timestamp.
Sourcefn increase_time<'life0, 'async_trait>(
&'life0 self,
seconds: Numeric,
) -> Pin<Box<dyn Future<Output = RpcResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn increase_time<'life0, 'async_trait>(
&'life0 self,
seconds: Numeric,
) -> Pin<Box<dyn Future<Output = RpcResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn set_next_block_timestamp<'life0, 'async_trait>(
&'life0 self,
timestamp: Numeric,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_next_block_timestamp<'life0, 'async_trait>(
&'life0 self,
timestamp: Numeric,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set timestamp for the next block. The timestamp must be in future.
§Arguments
timestamp
- The timestamp to set the time to
Sourcefn auto_impersonate_account<'life0, 'async_trait>(
&'life0 self,
enabled: bool,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn auto_impersonate_account<'life0, 'async_trait>(
&'life0 self,
enabled: bool,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn set_balance<'life0, 'async_trait>(
&'life0 self,
address: Address,
balance: U256,
) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_balance<'life0, 'async_trait>(
&'life0 self,
address: Address,
balance: U256,
) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn set_nonce<'life0, 'async_trait>(
&'life0 self,
address: Address,
nonce: U256,
) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_nonce<'life0, 'async_trait>(
&'life0 self,
address: Address,
nonce: U256,
) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn anvil_mine<'life0, 'async_trait>(
&'life0 self,
num_blocks: Option<U64>,
interval: Option<U64>,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn anvil_mine<'life0, 'async_trait>(
&'life0 self,
num_blocks: Option<U64>,
interval: Option<U64>,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sometimes you may want to advance the latest block number of the network by a large number of blocks.
One way to do this would be to call the evm_mine RPC method multiple times, but this is too slow if you want to mine thousands of blocks.
The anvil_mine
method can mine any number of blocks at once, in constant time. (It exhibits the same performance no matter how many blocks are mined.)
§Arguments
num_blocks
- The number of blocks to mine, defaults to 1interval
- The interval between the timestamps of each block, in seconds, and it also defaults to 1
§Returns
A BoxFuture
containing a Result
with a bool
representing the success of the operation.
Sourcefn reset_network<'life0, 'async_trait>(
&'life0 self,
reset_spec: Option<ResetRequest>,
) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn reset_network<'life0, 'async_trait>(
&'life0 self,
reset_spec: Option<ResetRequest>,
) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn impersonate_account<'life0, 'async_trait>(
&'life0 self,
address: Address,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn impersonate_account<'life0, 'async_trait>(
&'life0 self,
address: Address,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
anvil-zksync allows transactions impersonating specific account and contract addresses. To impersonate an account use this method, passing the address to impersonate as its parameter. After calling this method, any transactions with this sender will be executed without verification. Multiple addresses can be impersonated at once.
§Arguments
address
- The address to impersonate
§Returns
A BoxFuture
containing a Result
with a bool
representing the success of the operation.
Sourcefn stop_impersonating_account<'life0, 'async_trait>(
&'life0 self,
address: Address,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop_impersonating_account<'life0, 'async_trait>(
&'life0 self,
address: Address,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Use this method to stop impersonating an account after having previously used anvil_impersonateAccount
The method returns true
if the account was being impersonated and false
otherwise.
§Arguments
address
- The address to stop impersonating.
§Returns
A BoxFuture
containing a Result
with a bool
representing the success of the operation.
Sourcefn set_code<'life0, 'async_trait>(
&'life0 self,
address: Address,
code: String,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_code<'life0, 'async_trait>(
&'life0 self,
address: Address,
code: String,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn set_storage_at<'life0, 'async_trait>(
&'life0 self,
address: Address,
slot: U256,
value: U256,
) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_storage_at<'life0, 'async_trait>(
&'life0 self,
address: Address,
slot: U256,
value: U256,
) -> Pin<Box<dyn Future<Output = RpcResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Directly modifies the storage of a contract at a specified slot.
§Arguments
address
- The contract address whose storage is to be modified.slot
- The storage slot to modify.value
- The value to be set at the specified slot.
§Returns
A BoxFuture
containing a Result
with a bool
representing the success of the operation.
Provided Methods§
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.