@@ -35,9 +35,9 @@ use crate::agent::sender_account::SenderAccountMessage;
35
35
use crate :: agent:: sender_accounts_manager:: NewReceiptNotification ;
36
36
use crate :: agent:: unaggregated_receipts:: UnaggregatedReceipts ;
37
37
use crate :: {
38
+ tap:: context:: checks:: AllocationId ,
38
39
tap:: context:: { checks:: Signature , TapAgentContext } ,
39
40
tap:: signers_trimmed,
40
- tap:: { context:: checks:: AllocationId , escrow_adapter:: EscrowAdapter } ,
41
41
} ;
42
42
use thiserror:: Error ;
43
43
@@ -137,7 +137,6 @@ pub struct SenderAllocationArgs {
137
137
pub sender : Address ,
138
138
pub escrow_accounts : Receiver < EscrowAccounts > ,
139
139
pub escrow_subgraph : & ' static SubgraphClient ,
140
- pub escrow_adapter : EscrowAdapter ,
141
140
pub domain_separator : Eip712Domain ,
142
141
pub sender_account_ref : ActorRef < SenderAccountMessage > ,
143
142
pub sender_aggregator : jsonrpsee:: http_client:: HttpClient ,
@@ -340,7 +339,6 @@ impl SenderAllocationState {
340
339
sender,
341
340
escrow_accounts,
342
341
escrow_subgraph,
343
- escrow_adapter,
344
342
domain_separator,
345
343
sender_account_ref,
346
344
sender_aggregator,
@@ -368,7 +366,6 @@ impl SenderAllocationState {
368
366
allocation_id,
369
367
sender,
370
368
escrow_accounts. clone ( ) ,
371
- escrow_adapter,
372
369
) ;
373
370
let latest_rav = context. last_rav ( ) . await . unwrap_or_default ( ) ;
374
371
let tap_manager = TapManager :: new (
@@ -869,13 +866,9 @@ pub mod tests {
869
866
sender_accounts_manager:: NewReceiptNotification ,
870
867
unaggregated_receipts:: UnaggregatedReceipts ,
871
868
} ,
872
- tap:: {
873
- escrow_adapter:: EscrowAdapter ,
874
- test_utils:: {
875
- create_rav, create_received_receipt, store_invalid_receipt, store_rav,
876
- store_receipt, ALLOCATION_ID_0 , INDEXER , SENDER , SIGNER ,
877
- TAP_EIP712_DOMAIN_SEPARATOR ,
878
- } ,
869
+ tap:: test_utils:: {
870
+ create_rav, create_received_receipt, store_invalid_receipt, store_rav, store_receipt,
871
+ ALLOCATION_ID_0 , INDEXER , SENDER , SIGNER , TAP_EIP712_DOMAIN_SEPARATOR ,
879
872
} ,
880
873
} ;
881
874
use futures:: future:: join_all;
@@ -995,8 +988,6 @@ pub mod tests {
995
988
) )
996
989
. 1 ;
997
990
998
- let escrow_adapter = EscrowAdapter :: new ( escrow_accounts_rx. clone ( ) , SENDER . 1 ) ;
999
-
1000
991
let sender_account_ref = match sender_account {
1001
992
Some ( sender) => sender,
1002
993
None => create_mock_sender_account ( ) . await . 1 ,
@@ -1011,7 +1002,6 @@ pub mod tests {
1011
1002
sender : SENDER . 1 ,
1012
1003
escrow_accounts : escrow_accounts_rx,
1013
1004
escrow_subgraph,
1014
- escrow_adapter,
1015
1005
domain_separator : TAP_EIP712_DOMAIN_SEPARATOR . clone ( ) ,
1016
1006
sender_account_ref,
1017
1007
sender_aggregator,
@@ -1712,18 +1702,20 @@ pub mod tests {
1712
1702
. register (
1713
1703
Mock :: given ( method ( "POST" ) )
1714
1704
. and ( body_string_contains ( "transactions" ) )
1715
- . respond_with (
1716
- ResponseTemplate :: new ( 200 )
1717
- . set_body_json ( json ! ( { "data" : { "transactions" : [ ] } } ) ) ,
1718
- ) ,
1705
+ . respond_with ( ResponseTemplate :: new ( 200 ) . set_body_json (
1706
+ json ! ( { "data" : { "transactions" : [
1707
+ {
1708
+ "id" : "redeemed"
1709
+ }
1710
+ ] } } ) ,
1711
+ ) ) ,
1719
1712
)
1720
1713
. await ;
1721
- // Add invalid receipts to the database. ( receipts are older than rav )
1714
+ // Add invalid receipts to the database. ( already redeemed )
1722
1715
let timestamp = SystemTime :: now ( )
1723
1716
. duration_since ( UNIX_EPOCH )
1724
1717
. expect ( "Time went backwards" )
1725
- . as_nanos ( ) as u64
1726
- - 10000 ;
1718
+ . as_nanos ( ) as u64 ;
1727
1719
const RECEIPT_VALUE : u128 = 1622018441284756158 ;
1728
1720
const TOTAL_RECEIPTS : u64 = 10 ;
1729
1721
const TOTAL_SUM : u128 = RECEIPT_VALUE * TOTAL_RECEIPTS as u128 ;
0 commit comments