Skip to content

Commit

Permalink
corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
taslimmuhammed committed Oct 26, 2024
1 parent cfc032d commit 703c4de
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
10 changes: 8 additions & 2 deletions common/src/indexer_service/http/request_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ pub async fn request_handler<I>(
where
I: IndexerServiceImpl + Sync + Send + 'static,
{
_request_handler(manifest_id, typed_header, state, headers, body).await
_request_handler(manifest_id, typed_header, state, headers, body)
.await
.inspect_err(|_| {
HANDLER_FAILURE
.with_label_values(&[&manifest_id.to_string()])
.inc()
})
}

async fn _request_handler<I>(
Expand Down Expand Up @@ -105,7 +111,7 @@ where
let allocation_id = receipt.message.allocation_id;

// recover the signer address
// get escrow accounts from reciever
// get escrow accounts from channel
// return sender from signer
//
// TODO: We are currently doing this process twice.
Expand Down
9 changes: 4 additions & 5 deletions tap-agent/src/agent/sender_accounts_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub struct SenderAccountsManagerArgs {
pub struct State {
sender_ids: HashSet<Address>,
new_receipts_watcher_handle: Option<tokio::task::JoinHandle<()>>,
_eligible_allocations_senders_pipe: JoinHandle<()>,
_eligible_allocations_senders_handle: JoinHandle<()>,

config: &'static SenderAccountConfig,
domain_separator: Eip712Domain,
Expand Down Expand Up @@ -126,7 +126,7 @@ impl Actor for SenderAccountsManager {
);
let myself_clone = myself.clone();
let mut accounts_clone = escrow_accounts.clone();
let _eligible_allocations_senders_pipe = tokio::spawn(async move {
let _eligible_allocations_senders_handle = tokio::spawn(async move {
while accounts_clone.changed().await.is_ok() {
myself_clone
.cast(SenderAccountsManagerMessage::UpdateSenderAccounts(
Expand All @@ -143,7 +143,7 @@ impl Actor for SenderAccountsManager {
domain_separator,
sender_ids: HashSet::new(),
new_receipts_watcher_handle: None,
_eligible_allocations_senders_pipe,
_eligible_allocations_senders_handle,
pgpool,
indexer_allocations: allocations_rx,
escrow_accounts: escrow_accounts.clone(),
Expand Down Expand Up @@ -639,7 +639,6 @@ mod tests {
let escrow_subgraph = get_subgraph_client();

let (_, escrow_accounts_rx) = watch::channel(EscrowAccounts::default());
//change escrow_accounts_tx.write(EscrowAccounts::default());

let prefix = format!(
"test-{}",
Expand Down Expand Up @@ -689,7 +688,7 @@ mod tests {
domain_separator: TAP_EIP712_DOMAIN_SEPARATOR.clone(),
sender_ids: HashSet::new(),
new_receipts_watcher_handle: None,
_eligible_allocations_senders_pipe: tokio::spawn(async move {}),
_eligible_allocations_senders_handle: tokio::spawn(async move {}),
pgpool,
indexer_allocations: watch::channel(HashSet::new()).1,
escrow_accounts: watch::channel(escrow_accounts).1,
Expand Down

0 comments on commit 703c4de

Please sign in to comment.