Skip to content

Commit

Permalink
initial accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
taslimmuhammed committed Oct 27, 2024
1 parent 703c4de commit 99740aa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
11 changes: 8 additions & 3 deletions common/src/escrow_accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,17 @@ type BigInt = String;
)]
pub struct EscrowAccountQuery;

pub fn escrow_accounts(
pub async fn escrow_accounts(
escrow_subgraph: &'static SubgraphClient,
indexer_address: Address,
interval: Duration,
reject_thawing_signers: bool,
) -> Receiver<EscrowAccounts> {
let (tx, rx) = watch::channel(EscrowAccounts::default());
let initial_accounts =
get_escrow_accounts(escrow_subgraph, indexer_address, reject_thawing_signers)
.await
.expect("Failed to create escrow_accounts channel");
let (tx, rx) = watch::channel(initial_accounts);
tokio::spawn(async move {
let mut time_interval = time::interval(interval);
time_interval.set_missed_tick_behavior(time::MissedTickBehavior::Skip);
Expand Down Expand Up @@ -251,7 +255,8 @@ mod tests {
*test_vectors::INDEXER_ADDRESS,
Duration::from_secs(60),
true,
);
)
.await;
accounts.changed().await.unwrap();
assert_eq!(
accounts.borrow().clone(),
Expand Down
3 changes: 2 additions & 1 deletion common/src/indexer_service/http/indexer_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ impl IndexerService {
options.config.indexer.indexer_address,
Duration::from_secs(options.config.escrow_subgraph.syncing_interval),
true, // Reject thawing signers eagerly
);
)
.await;

// Establish Database connection necessary for serving indexer management
// requests with defined schema
Expand Down
3 changes: 2 additions & 1 deletion tap-agent/src/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ pub async fn start_agent() -> (ActorRef<SenderAccountsManagerMessage>, JoinHandl
*indexer_address,
*escrow_sync_interval,
false,
);
)
.await;

let config = Box::leak(Box::new(SenderAccountConfig::from_config(&CONFIG)));

Expand Down

0 comments on commit 99740aa

Please sign in to comment.