diff --git a/common/src/escrow_accounts.rs b/common/src/escrow_accounts.rs index d8067f79..5182d5ee 100644 --- a/common/src/escrow_accounts.rs +++ b/common/src/escrow_accounts.rs @@ -15,14 +15,14 @@ use crate::prelude::{Query, SubgraphClient}; #[derive(Clone, Debug, Default, PartialEq, Eq)] pub struct EscrowAccounts { - pub balances: HashMap
, + pub senders_balances: HashMap, pub signers_to_senders: HashMap, pub senders_to_signers: HashMap>, } impl EscrowAccounts { pub fn new( - balances: HashMap, + senders_balances: HashMap, senders_to_signers: HashMap>, ) -> Self { let signers_to_senders = senders_to_signers @@ -36,7 +36,7 @@ impl EscrowAccounts { .collect(); Self { - balances, + senders_balances, signers_to_senders, senders_to_signers, } @@ -133,7 +133,7 @@ pub fn escrow_accounts( let response = response.map_err(|e| e.to_string())?; - let balances = response + let senders_balances = response .escrow_accounts .iter() .map(|account| { @@ -170,7 +170,7 @@ pub fn escrow_accounts( }) .collect(); - Ok(EscrowAccounts::new(balances, senders_to_signers)) + Ok(EscrowAccounts::new(senders_balances, senders_to_signers)) }, move |err: String| { error!( diff --git a/common/src/tap_manager.rs b/common/src/tap_manager.rs index 07cb60b8..8df27c8c 100644 --- a/common/src/tap_manager.rs +++ b/common/src/tap_manager.rs @@ -80,7 +80,7 @@ impl TapManager { })?; if !escrow_accounts - .balances + .senders_balances .get(receipt_sender) .map_or(false, |balance| balance > &U256::zero()) { diff --git a/tap-agent/src/tap/escrow_adapter.rs b/tap-agent/src/tap/escrow_adapter.rs index afd9b828..bbbb1f1f 100644 --- a/tap-agent/src/tap/escrow_adapter.rs +++ b/tap-agent/src/tap/escrow_adapter.rs @@ -66,7 +66,7 @@ impl EscrowAdapterTrait for EscrowAdapter { })?; let balance = escrow_accounts - .balances + .senders_balances .get(sender) .ok_or(AdapterError::AdapterError { error: format!( diff --git a/tap-agent/src/tap/receipt_checks_adapter.rs b/tap-agent/src/tap/receipt_checks_adapter.rs index 10563774..0e2a97d2 100644 --- a/tap-agent/src/tap/receipt_checks_adapter.rs +++ b/tap-agent/src/tap/receipt_checks_adapter.rs @@ -128,7 +128,7 @@ impl ReceiptChecksAdapterTrait for ReceiptChecksAdapter { Ok(escrow_accounts .signers_to_senders .get(&sender_id) - .and_then(|sender| escrow_accounts.balances.get(sender)) + .and_then(|sender| escrow_accounts.senders_balances.get(sender)) .map(|balance| *balance > U256::from(0)) .unwrap_or(false)) } diff --git a/tap-agent/src/tap/sender_allocation_relationships_manager.rs b/tap-agent/src/tap/sender_allocation_relationships_manager.rs index f9ebe44a..19dccab2 100644 --- a/tap-agent/src/tap/sender_allocation_relationships_manager.rs +++ b/tap-agent/src/tap/sender_allocation_relationships_manager.rs @@ -87,7 +87,11 @@ impl SenderAllocationRelationshipsManager { .value() .await .expect("Should get indexer allocations from Eventual"), - escrow_accounts_snapshot.balances.keys().copied().collect(), + escrow_accounts_snapshot + .senders_balances + .keys() + .copied() + .collect(), ) .await .expect("Should be able to update sender_allocation_relationships"); @@ -186,7 +190,7 @@ impl SenderAllocationRelationshipsManager { Self::update_sender_allocation_relationships( &inner, indexer_allocations, - escrow_accounts.balances.keys().copied().collect(), + escrow_accounts.senders_balances.keys().copied().collect(), ) .await .unwrap_or_else(|e| {