@@ -3,12 +3,16 @@ use std::collections::HashMap;
33
44use crate :: backends:: plonky2:: mock_signed:: MockSigner ;
55use crate :: frontend:: { MainPodBuilder , SignedPod , SignedPodBuilder , Value } ;
6+ use crate :: middleware:: containers:: Set ;
7+ use crate :: middleware:: hash_str;
68use crate :: middleware:: { containers:: Dictionary , Params , PodType , KEY_SIGNER , KEY_TYPE } ;
79use crate :: op;
810
911// ZuKYC
1012
11- pub fn zu_kyc_sign_pod_builders ( params : & Params ) -> ( SignedPodBuilder , SignedPodBuilder ) {
13+ pub fn zu_kyc_sign_pod_builders (
14+ params : & Params ,
15+ ) -> ( SignedPodBuilder , SignedPodBuilder , SignedPodBuilder ) {
1216 let mut gov_id = SignedPodBuilder :: new ( params) ;
1317 gov_id. insert ( "idNumber" , "4242424242" ) ;
1418 gov_id. insert ( "dateOfBirth" , 1169909384 ) ;
@@ -18,22 +22,34 @@ pub fn zu_kyc_sign_pod_builders(params: &Params) -> (SignedPodBuilder, SignedPod
1822 pay_stub. insert ( "socialSecurityNumber" , "G2121210" ) ;
1923 pay_stub. insert ( "startDate" , 1706367566 ) ;
2024
21- ( gov_id, pay_stub)
25+ let mut sanction_list = SignedPodBuilder :: new ( params) ;
26+ let sanctions_values = [ "A343434340" ] . map ( |s| crate :: middleware:: Value :: from ( hash_str ( s) ) ) ;
27+ sanction_list. insert (
28+ "sanctionList" ,
29+ Value :: Set ( Set :: new ( & sanctions_values. to_vec ( ) ) . unwrap ( ) ) ,
30+ ) ;
31+
32+ ( gov_id, pay_stub, sanction_list)
2233}
2334
2435pub fn zu_kyc_pod_builder (
2536 params : & Params ,
2637 gov_id : & SignedPod ,
2738 pay_stub : & SignedPod ,
39+ sanction_list : & SignedPod ,
2840) -> Result < MainPodBuilder > {
29- let sanction_list = Value :: Dictionary ( Dictionary :: new ( & HashMap :: new ( ) ) ?) ; // empty dictionary
3041 let now_minus_18y: i64 = 1169909388 ;
3142 let now_minus_1y: i64 = 1706367566 ;
3243
3344 let mut kyc = MainPodBuilder :: new ( params) ;
3445 kyc. add_signed_pod ( & gov_id) ;
3546 kyc. add_signed_pod ( & pay_stub) ;
36- kyc. pub_op ( op ! ( not_contains, & sanction_list, ( gov_id, "idNumber" ) ) ) ;
47+ kyc. add_signed_pod ( & sanction_list) ;
48+ kyc. pub_op ( op ! (
49+ not_contains,
50+ ( sanction_list, "sanctionList" ) ,
51+ ( gov_id, "idNumber" )
52+ ) ) ;
3753 kyc. pub_op ( op ! ( lt, ( gov_id, "dateOfBirth" ) , now_minus_18y) ) ;
3854 kyc. pub_op ( op ! (
3955 eq,
0 commit comments