@@ -5363,7 +5363,10 @@ pub mod tests {
5363
5363
bill_id_test ( ) ,
5364
5364
chain. get_latest_block ( ) ,
5365
5365
& BillRequestRecourseBlockData {
5366
- recourser : bill_identified_participant_only_node_id ( payee. node_id ( ) ) . into ( ) ,
5366
+ recourser : BillParticipant :: Ident (
5367
+ bill_identified_participant_only_node_id ( payee. node_id ( ) ) ,
5368
+ )
5369
+ . into ( ) ,
5367
5370
recoursee : BillIdentParticipant :: new ( get_baseline_identity ( ) . identity )
5368
5371
. unwrap ( )
5369
5372
. into ( ) ,
@@ -5372,7 +5375,7 @@ pub mod tests {
5372
5375
recourse_reason : BillRecourseReasonBlockData :: Pay ,
5373
5376
signatory : None ,
5374
5377
signing_timestamp : now,
5375
- signing_address : empty_address ( ) ,
5378
+ signing_address : Some ( empty_address ( ) ) ,
5376
5379
} ,
5377
5380
& BcrKeys :: from_private_key ( & private_key_test ( ) ) . unwrap ( ) ,
5378
5381
None ,
@@ -5431,7 +5434,10 @@ pub mod tests {
5431
5434
bill_id_test ( ) ,
5432
5435
chain. get_latest_block ( ) ,
5433
5436
& BillRequestRecourseBlockData {
5434
- recourser : bill_identified_participant_only_node_id ( payee. node_id ( ) ) . into ( ) ,
5437
+ recourser : BillParticipant :: Ident (
5438
+ bill_identified_participant_only_node_id ( payee. node_id ( ) ) ,
5439
+ )
5440
+ . into ( ) ,
5435
5441
recoursee : BillIdentParticipant :: new ( get_baseline_identity ( ) . identity )
5436
5442
. unwrap ( )
5437
5443
. into ( ) ,
@@ -5440,7 +5446,7 @@ pub mod tests {
5440
5446
recourse_reason : BillRecourseReasonBlockData :: Pay ,
5441
5447
signatory : None ,
5442
5448
signing_timestamp : now,
5443
- signing_address : empty_address ( ) ,
5449
+ signing_address : Some ( empty_address ( ) ) ,
5444
5450
} ,
5445
5451
& BcrKeys :: from_private_key ( & private_key_test ( ) ) . unwrap ( ) ,
5446
5452
None ,
@@ -5502,17 +5508,18 @@ pub mod tests {
5502
5508
bill_id_test ( ) ,
5503
5509
chain. get_latest_block ( ) ,
5504
5510
& BillRequestRecourseBlockData {
5505
- recourser : BillIdentParticipant :: new ( get_baseline_identity ( ) . identity )
5506
- . unwrap ( )
5507
- . into ( ) ,
5511
+ recourser : BillParticipant :: Ident (
5512
+ BillIdentParticipant :: new ( get_baseline_identity ( ) . identity ) . unwrap ( ) ,
5513
+ )
5514
+ . into ( ) ,
5508
5515
recoursee : bill_identified_participant_only_node_id ( recoursee. clone ( ) )
5509
5516
. into ( ) ,
5510
5517
currency : "sat" . to_string ( ) ,
5511
5518
sum : 15000 ,
5512
5519
recourse_reason : BillRecourseReasonBlockData :: Pay ,
5513
5520
signatory : None ,
5514
5521
signing_timestamp : now,
5515
- signing_address : empty_address ( ) ,
5522
+ signing_address : Some ( empty_address ( ) ) ,
5516
5523
} ,
5517
5524
& BcrKeys :: from_private_key ( & private_key_test ( ) ) . unwrap ( ) ,
5518
5525
None ,
@@ -5577,7 +5584,10 @@ pub mod tests {
5577
5584
bill_id_test ( ) ,
5578
5585
chain. get_latest_block ( ) ,
5579
5586
& BillRequestRecourseBlockData {
5580
- recourser : BillIdentParticipant :: from ( company_clone. clone ( ) ) . into ( ) ,
5587
+ recourser : BillParticipant :: Ident ( BillIdentParticipant :: from (
5588
+ company_clone. clone ( ) ,
5589
+ ) )
5590
+ . into ( ) ,
5581
5591
recoursee : bill_identified_participant_only_node_id ( recoursee. clone ( ) )
5582
5592
. into ( ) ,
5583
5593
currency : "sat" . to_string ( ) ,
@@ -5588,7 +5598,7 @@ pub mod tests {
5588
5598
name : get_baseline_identity ( ) . identity . name . clone ( ) ,
5589
5599
} ) ,
5590
5600
signing_timestamp : now,
5591
- signing_address : empty_address ( ) ,
5601
+ signing_address : Some ( empty_address ( ) ) ,
5592
5602
} ,
5593
5603
& BcrKeys :: from_private_key ( & private_key_test ( ) ) . unwrap ( ) ,
5594
5604
Some ( & BcrKeys :: from_private_key ( & private_key_test ( ) ) . unwrap ( ) ) ,
@@ -5714,7 +5724,7 @@ pub mod tests {
5714
5724
}
5715
5725
5716
5726
#[ tokio:: test]
5717
- async fn request_recourse_fails_for_anon ( ) {
5727
+ async fn request_recourse_works_for_anon ( ) {
5718
5728
let mut ctx = get_ctx ( ) ;
5719
5729
let identity = get_baseline_identity ( ) ;
5720
5730
let mut bill = get_baseline_bill ( & bill_id_test ( ) ) ;
@@ -5794,6 +5804,8 @@ pub mod tests {
5794
5804
ctx. notification_service
5795
5805
. expect_send_recourse_action_event ( )
5796
5806
. returning ( |_, _, _| Ok ( ( ) ) ) ;
5807
+ // Populates identity block
5808
+ expect_populates_identity_block ( & mut ctx) ;
5797
5809
let service = get_service ( ctx) ;
5798
5810
5799
5811
let res = service
@@ -5808,11 +5820,9 @@ pub mod tests {
5808
5820
1731593928 ,
5809
5821
)
5810
5822
. await ;
5811
- assert ! ( res. is_err( ) ) ;
5812
- assert ! ( matches!(
5813
- res. as_ref( ) . unwrap_err( ) ,
5814
- Error :: Validation ( ValidationError :: SignerCantBeAnon )
5815
- ) ) ;
5823
+ assert ! ( res. is_ok( ) ) ;
5824
+ assert ! ( res. as_ref( ) . unwrap( ) . blocks( ) . len( ) == 5 ) ;
5825
+ assert ! ( res. unwrap( ) . blocks( ) [ 4 ] . op_code == BillOpCode :: RequestRecourse ) ;
5816
5826
}
5817
5827
5818
5828
#[ tokio:: test]
@@ -5951,16 +5961,17 @@ pub mod tests {
5951
5961
bill_id_test ( ) ,
5952
5962
chain. get_latest_block ( ) ,
5953
5963
& BillRequestRecourseBlockData {
5954
- recourser : BillIdentParticipant :: new ( identity_clone. clone ( ) )
5955
- . unwrap ( )
5956
- . into ( ) ,
5964
+ recourser : BillParticipant :: Ident (
5965
+ BillIdentParticipant :: new ( identity_clone. clone ( ) ) . unwrap ( ) ,
5966
+ )
5967
+ . into ( ) ,
5957
5968
recoursee : recoursee_clone. clone ( ) . into ( ) ,
5958
5969
sum : 15000 ,
5959
5970
currency : "sat" . to_string ( ) ,
5960
5971
recourse_reason : BillRecourseReasonBlockData :: Pay ,
5961
5972
signatory : None ,
5962
5973
signing_timestamp : 1731593927 ,
5963
- signing_address : empty_address ( ) ,
5974
+ signing_address : Some ( empty_address ( ) ) ,
5964
5975
} ,
5965
5976
& BcrKeys :: new ( ) ,
5966
5977
None ,
@@ -6032,16 +6043,17 @@ pub mod tests {
6032
6043
bill_id_test ( ) ,
6033
6044
chain. get_latest_block ( ) ,
6034
6045
& BillRequestRecourseBlockData {
6035
- recourser : BillIdentParticipant :: new ( identity_clone. clone ( ) )
6036
- . unwrap ( )
6037
- . into ( ) ,
6046
+ recourser : BillParticipant :: Ident (
6047
+ BillIdentParticipant :: new ( identity_clone. clone ( ) ) . unwrap ( ) ,
6048
+ )
6049
+ . into ( ) ,
6038
6050
recoursee : recoursee_clone. clone ( ) . into ( ) ,
6039
6051
sum : 15000 ,
6040
6052
currency : "sat" . to_string ( ) ,
6041
6053
recourse_reason : BillRecourseReasonBlockData :: Pay ,
6042
6054
signatory : None ,
6043
6055
signing_timestamp : 1731593927 ,
6044
- signing_address : empty_address ( ) ,
6056
+ signing_address : Some ( empty_address ( ) ) ,
6045
6057
} ,
6046
6058
& BcrKeys :: new ( ) ,
6047
6059
None ,
0 commit comments