-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add `anvil_{get,set}Automine`/`anvil_setIntervalMining` * add an e2e test
- Loading branch information
Showing
10 changed files
with
307 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,32 @@ | ||
use alloy::providers::{Provider, ProviderCall}; | ||
use alloy::rpc::client::NoParams; | ||
use alloy::transports::Transport; | ||
use alloy_zksync::network::Zksync; | ||
|
||
pub mod utils; | ||
|
||
pub trait EraTestNodeApiProvider<T>: Provider<T, Zksync> | ||
where | ||
T: Transport + Clone, | ||
{ | ||
fn get_auto_mine(&self) -> ProviderCall<T, NoParams, bool> { | ||
self.client().request_noparams("anvil_getAutomine").into() | ||
} | ||
|
||
fn set_auto_mine(&self, enable: bool) -> ProviderCall<T, (bool,), ()> { | ||
self.client().request("anvil_setAutomine", (enable,)).into() | ||
} | ||
|
||
fn set_interval_mining(&self, seconds: u64) -> ProviderCall<T, (u64,), ()> { | ||
self.client() | ||
.request("anvil_setIntervalMining", (seconds,)) | ||
.into() | ||
} | ||
} | ||
|
||
impl<P, T> EraTestNodeApiProvider<T> for P | ||
where | ||
T: Transport + Clone, | ||
P: Provider<T, Zksync>, | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.