-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps): update all dependencies (#258)
- Loading branch information
Showing
12 changed files
with
54 additions
and
70 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
use alloy_node_bindings::Anvil; | ||
use alloy_primitives::U64; | ||
use alloy_rpc_client::{ClientBuilder, RpcCall}; | ||
use std::borrow::Cow; | ||
|
||
// #[tokio::test] | ||
#[tokio::test] | ||
async fn it_makes_a_request() { | ||
let infura = std::env::var("HTTP_PROVIDER_URL").unwrap(); | ||
|
||
let client = ClientBuilder::default().reqwest_http(infura.parse().unwrap()); | ||
|
||
let params: Cow<'static, _> = Cow::Owned(()); | ||
|
||
let req: RpcCall<_, Cow<'static, ()>, U64> = client.prepare("eth_blockNumber", params); | ||
req.await.unwrap(); | ||
let anvil = Anvil::new().spawn(); | ||
let url = anvil.endpoint(); | ||
let client = ClientBuilder::default().reqwest_http(url.parse().unwrap()); | ||
let req: RpcCall<_, (), U64> = client.prepare("eth_blockNumber", ()); | ||
let timeout = tokio::time::timeout(std::time::Duration::from_secs(2), req); | ||
let res = timeout.await.unwrap().unwrap(); | ||
assert_eq!(res.to::<u64>(), 0); | ||
} |
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,21 +1,16 @@ | ||
use alloy_node_bindings::Anvil; | ||
use alloy_primitives::U64; | ||
use alloy_rpc_client::{ClientBuilder, RpcCall}; | ||
use alloy_transport_ws::WsConnect; | ||
use std::borrow::Cow; | ||
|
||
// #[test_log::test(tokio::test)] | ||
#[tokio::test] | ||
async fn it_makes_a_request() { | ||
let infura = std::env::var("WS_PROVIDER_URL").unwrap(); | ||
|
||
let connector = WsConnect { url: infura.parse().unwrap(), auth: None }; | ||
|
||
let anvil = Anvil::new().spawn(); | ||
let url = anvil.ws_endpoint(); | ||
let connector = WsConnect { url: url.parse().unwrap(), auth: None }; | ||
let client = ClientBuilder::default().pubsub(connector).await.unwrap(); | ||
|
||
let params: Cow<'static, _> = Cow::Owned(()); | ||
|
||
let req: RpcCall<_, Cow<'static, ()>, U64> = client.prepare("eth_blockNumber", params); | ||
|
||
let req: RpcCall<_, (), U64> = client.prepare("eth_blockNumber", ()); | ||
let timeout = tokio::time::timeout(std::time::Duration::from_secs(2), req); | ||
|
||
timeout.await.unwrap().unwrap(); | ||
let res = timeout.await.unwrap().unwrap(); | ||
assert_eq!(res.to::<u64>(), 0); | ||
} |
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