mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-12-23 16:43:24 +03:00
widget: don't panic on bad GET, bump alloy deps
This commit is contained in:
parent
da90cc49c7
commit
19d5ffc9bd
@ -41,9 +41,9 @@ alloy = { version = "0.1.3", features = [
|
|||||||
"signers",
|
"signers",
|
||||||
"signer-local",
|
"signer-local",
|
||||||
] }
|
] }
|
||||||
alloy-primitives = "0.7.5"
|
alloy-primitives = "0.7.6"
|
||||||
alloy-sol-macro = "0.7.5"
|
alloy-sol-macro = "0.7.6"
|
||||||
alloy-sol-types = "0.7.5"
|
alloy-sol-types = "0.7.6"
|
||||||
anyhow = "1.0.71"
|
anyhow = "1.0.71"
|
||||||
async-trait = "0.1.71"
|
async-trait = "0.1.71"
|
||||||
base64 = "0.22.0"
|
base64 = "0.22.0"
|
||||||
|
@ -151,7 +151,10 @@ fn fetch_most_recent_blog_posts(n: usize) -> Vec<KinodeBlogPost> {
|
|||||||
) {
|
) {
|
||||||
Ok(response) => serde_json::from_slice::<Vec<KinodeBlogPost>>(response.body())
|
Ok(response) => serde_json::from_slice::<Vec<KinodeBlogPost>>(response.body())
|
||||||
.expect("Invalid UTF-8 from kinode.org"),
|
.expect("Invalid UTF-8 from kinode.org"),
|
||||||
Err(e) => panic!("Failed to fetch blog posts: {:?}", e),
|
Err(e) => {
|
||||||
|
println!("Failed to fetch blog posts: {e:?}");
|
||||||
|
vec![]
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
blog_posts.into_iter().rev().take(n as usize).collect()
|
blog_posts.into_iter().rev().take(n as usize).collect()
|
||||||
|
@ -258,7 +258,6 @@ pub async fn register(
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn connect_to_provider(maybe_rpc: Option<String>) -> RootProvider<PubSubFrontend> {
|
pub async fn connect_to_provider(maybe_rpc: Option<String>) -> RootProvider<PubSubFrontend> {
|
||||||
// This ETH provider uses public rpc endpoints to verify registration signatures.
|
|
||||||
let url = if let Some(rpc_url) = maybe_rpc {
|
let url = if let Some(rpc_url) = maybe_rpc {
|
||||||
rpc_url
|
rpc_url
|
||||||
} else {
|
} else {
|
||||||
@ -268,19 +267,20 @@ pub async fn connect_to_provider(maybe_rpc: Option<String>) -> RootProvider<PubS
|
|||||||
"Connecting to Optimism RPC at {url}\n\
|
"Connecting to Optimism RPC at {url}\n\
|
||||||
Specify a different RPC URL with the --rpc flag."
|
Specify a different RPC URL with the --rpc flag."
|
||||||
);
|
);
|
||||||
let ws = WsConnect::new(url);
|
|
||||||
// this fails occasionally in certain networking environments. i'm not sure why.
|
let client = match ProviderBuilder::new().on_ws(WsConnect::new(url)).await {
|
||||||
// frustratingly, the exact same call does not fail in the eth module. more investigation needed.
|
Ok(client) => client,
|
||||||
let Ok(client) = ProviderBuilder::new().on_ws(ws).await else {
|
Err(e) => {
|
||||||
panic!(
|
panic!(
|
||||||
"Error: runtime could not connect to ETH RPC.\n\
|
"Error: runtime could not connect to ETH RPC: {e}\n\
|
||||||
This is necessary in order to verify node identity onchain.\n\
|
This is necessary in order to verify node identity onchain.\n\
|
||||||
Please make sure you are using a valid WebSockets URL if using \
|
Please make sure you are using a valid WebSockets URL if using \
|
||||||
the --rpc flag, and you are connected to the internet."
|
the --rpc flag, and you are connected to the internet."
|
||||||
);
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
println!("Connected to Optimism RPC");
|
|
||||||
|
|
||||||
|
println!("Connected to Optimism RPC");
|
||||||
client
|
client
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user