Merge pull request #539 from kinode-dao/release-candidate

Release candidate (printout for newHeads)
This commit is contained in:
doria 2024-09-14 10:09:24 +09:00 committed by GitHub
commit 05a7ea595b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,7 @@
use crate::eth::*;
use alloy::pubsub::RawSubscription;
use alloy::rpc::types::eth::pubsub::SubscriptionResult;
use alloy::rpc::types::pubsub;
/// cleans itself up when the subscription is closed or fails.
pub async fn create_new_subscription(
@ -189,6 +190,11 @@ async fn build_subscription(
else {
return Err(EthError::PermissionDenied); // will never hit
};
if *kind == pubsub::SubscriptionKind::NewHeads {
Printout::new(0, format!("newHeads subscription requested by {target}!"))
.send(print_tx)
.await;
}
let mut urls = {
// in code block to drop providers lock asap to avoid deadlock
let Some(aps) = providers.get(&chain_id) else {