Skip to content

Commit

Permalink
Minor changes to API
Browse files Browse the repository at this point in the history
  • Loading branch information
scx1332 committed Feb 13, 2024
1 parent 572d9f9 commit 7fad5ff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions crates/erc20_payment_lib/src/signer/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ impl SignerAccount {
}
}

pub fn is_active(&self) -> bool {
let jh_guard = self.jh.lock().unwrap();
if let Some(jh_guard) = jh_guard.as_ref() {
!jh_guard.is_finished()
} else {
false
}
}

pub async fn check_if_sign_possible(&self) -> Result<(), PaymentError> {
match timeout(
std::time::Duration::from_secs(5),
Expand Down
4 changes: 2 additions & 2 deletions crates/erc20_rpc_pool/src/rpc_pool/pool/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::time::Duration;

#[derive(Debug)]
pub struct ExternalSourceResolver {
pub last_check: Arc<Mutex<Option<std::time::Instant>>>,
last_check: Arc<Mutex<Option<std::time::Instant>>>,
}

async fn get_awc_response(url: &str) -> Result<Web3ExternalEndpointList, Box<dyn Error>> {
Expand Down Expand Up @@ -58,7 +58,7 @@ impl ExternalSourceResolver {
let pool = pool.clone();
let self_clone = self.clone();
tokio::spawn(async move {
log::error!("Starting external resolver");
log::info!("Starting external resolver for chain id: {}", pool.chain_id);
self_clone.resolve_external_addresses_int(pool).await;
});
}
Expand Down

0 comments on commit 7fad5ff

Please sign in to comment.