@@ -36,7 +36,10 @@ use crate::{
36
36
use super :: sender_allocation_task:: SenderAllocationTask ;
37
37
38
38
#[ cfg( not( any( test, feature = "test" ) ) ) ]
39
- use tap_core:: receipt:: checks:: CheckList ;
39
+ use tap_core:: receipt:: checks:: { Check , CheckList } ;
40
+
41
+ #[ cfg( not( any( test, feature = "test" ) ) ) ]
42
+ use crate :: tap:: context:: checks:: { AllocationId as AllocationIdCheck , Signature } ;
40
43
41
44
#[ cfg( any( test, feature = "test" ) ) ]
42
45
use super :: sender_allocation_task:: SenderAllocationTask ;
@@ -397,7 +400,7 @@ impl SenderAccountTask {
397
400
#[ cfg( any( test, feature = "test" ) ) ]
398
401
{
399
402
// Create a self-reference handle for the child to communicate back
400
- let ( self_tx, mut self_rx ) = mpsc:: channel :: < SenderAccountMessage > ( 10 ) ;
403
+ let ( self_tx, _self_rx ) = mpsc:: channel :: < SenderAccountMessage > ( 10 ) ;
401
404
let self_handle = TaskHandle :: new (
402
405
self_tx,
403
406
Some ( format ! ( "sender_account_{}" , state. sender) ) ,
@@ -430,49 +433,6 @@ impl SenderAccountTask {
430
433
431
434
// Register the child task
432
435
state. child_registry . register ( task_name, child_handle) . await ;
433
-
434
- // Create a proper message forwarder that handles child->parent communication
435
- // This simulates the child sending messages back to the parent task
436
- tokio:: spawn ( async move {
437
- while let Some ( msg) = self_rx. recv ( ) . await {
438
- tracing:: debug!(
439
- message = ?msg,
440
- "Child allocation task sent message to parent"
441
- ) ;
442
-
443
- // In production, this would route the message back to the parent's
444
- // main message handling loop. For our current proof-of-concept,
445
- // we just log that proper communication is happening.
446
- match msg {
447
- SenderAccountMessage :: UpdateReceiptFees ( allocation_id, _receipt_fees) => {
448
- tracing:: debug!(
449
- allocation_id = ?allocation_id,
450
- "Child reported receipt fee update"
451
- ) ;
452
- }
453
- SenderAccountMessage :: UpdateInvalidReceiptFees (
454
- allocation_id,
455
- invalid_fees,
456
- ) => {
457
- tracing:: debug!(
458
- allocation_id = ?allocation_id,
459
- invalid_value = invalid_fees. value,
460
- "Child reported invalid receipt fees"
461
- ) ;
462
- }
463
- SenderAccountMessage :: UpdateRav ( rav_info) => {
464
- tracing:: debug!(
465
- allocation_id = %rav_info. allocation_id,
466
- rav_value = rav_info. value_aggregate,
467
- "Child reported new RAV"
468
- ) ;
469
- }
470
- _ => {
471
- tracing:: debug!( "Child sent other message type" ) ;
472
- }
473
- }
474
- }
475
- } ) ;
476
436
}
477
437
478
438
#[ cfg( not( any( test, feature = "test" ) ) ) ]
@@ -520,11 +480,29 @@ impl SenderAccountTask {
520
480
. escrow_accounts ( state. escrow_accounts . clone ( ) )
521
481
. build ( ) ;
522
482
483
+ // Create proper receipt validation checks for Legacy (V1) network
484
+ let required_checks: Vec < Arc < dyn Check < crate :: tap:: TapReceipt > + Send + Sync > > = vec ! [
485
+ Arc :: new(
486
+ AllocationIdCheck :: new(
487
+ state. config. indexer_address,
488
+ state. config. escrow_polling_interval,
489
+ state. sender,
490
+ tap_allocation_id,
491
+ state. escrow_subgraph,
492
+ )
493
+ . await ,
494
+ ) ,
495
+ Arc :: new( Signature :: new(
496
+ state. domain_separator. clone( ) ,
497
+ state. escrow_accounts. clone( ) ,
498
+ ) ) ,
499
+ ] ;
500
+
523
501
// Create TAP manager with proper domain separator and checks
524
502
let tap_manager = tap_core:: manager:: Manager :: new (
525
503
state. domain_separator . clone ( ) ,
526
504
tap_context_for_manager,
527
- CheckList :: empty ( ) , // TODO: Add proper checks in future iteration
505
+ CheckList :: new ( required_checks ) ,
528
506
) ;
529
507
530
508
// Create Legacy (V1) aggregator client
@@ -576,11 +554,29 @@ impl SenderAccountTask {
576
554
. escrow_accounts ( state. escrow_accounts . clone ( ) )
577
555
. build ( ) ;
578
556
557
+ // Create proper receipt validation checks for Horizon (V2) network
558
+ let required_checks: Vec < Arc < dyn Check < crate :: tap:: TapReceipt > + Send + Sync > > = vec ! [
559
+ Arc :: new(
560
+ AllocationIdCheck :: new(
561
+ state. config. indexer_address,
562
+ state. config. escrow_polling_interval,
563
+ state. sender,
564
+ tap_allocation_id,
565
+ state. escrow_subgraph,
566
+ )
567
+ . await ,
568
+ ) ,
569
+ Arc :: new( Signature :: new(
570
+ state. domain_separator. clone( ) ,
571
+ state. escrow_accounts. clone( ) ,
572
+ ) ) ,
573
+ ] ;
574
+
579
575
// Create TAP manager with proper domain separator and checks
580
576
let tap_manager = tap_core:: manager:: Manager :: new (
581
577
state. domain_separator . clone ( ) ,
582
578
tap_context_for_manager,
583
- CheckList :: empty ( ) , // TODO: Add proper checks in future iteration
579
+ CheckList :: new ( required_checks ) ,
584
580
) ;
585
581
586
582
// Create Horizon (V2) aggregator client
0 commit comments