Skip to content

Commit ec1d4b2

Browse files
committed
Examples use front-end compound types
1 parent 43e3b59 commit ec1d4b2

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

src/examples.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub fn zu_kyc_pod_builder(
5555
kyc.add_signed_pod(pay_stub);
5656
kyc.add_signed_pod(sanction_list);
5757
kyc.pub_op(op!(
58-
not_contains,
58+
set_not_contains,
5959
(sanction_list, "sanctionList"),
6060
(gov_id, "idNumber"),
6161
sanction_set.prove_nonexistence(id_number_value)?
@@ -271,7 +271,7 @@ pub fn great_boy_pod_builder(
271271
.prove(pod_kvs.get(&KEY_SIGNER.into()).unwrap())?
272272
.1;
273273
great_boy.pub_op(op!(
274-
contains,
274+
dict_contains,
275275
good_boy_issuers,
276276
(good_boy_pods[good_boy_idx * 2 + issuer_idx], KEY_SIGNER),
277277
0,
@@ -405,7 +405,7 @@ pub fn tickets_pod_builder(
405405
builder.pub_op(op!(eq, (signed_pod, "isConsumed"), expect_consumed))?;
406406
builder.pub_op(op!(eq, (signed_pod, "isRevoked"), false))?;
407407
builder.pub_op(op!(
408-
not_contains,
408+
dict_not_contains,
409409
blacklisted_email_dict_value,
410410
(signed_pod, "attendeeEmail"),
411411
attendee_nin_blacklist_pf

src/frontend/mod.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,22 @@ pub mod build_utils {
10801080
(custom, $op:expr, $($arg:expr),+) => { $crate::frontend::Operation(
10811081
$crate::frontend::OperationType::Custom($op),
10821082
$crate::op_args!($($arg),*)) };
1083+
(dict_contains, $($arg:expr),+) => { crate::frontend::Operation(
1084+
crate::frontend::OperationType::Native(crate::frontend::NativeOperation::DictContainsFromEntries),
1085+
crate::op_args!($($arg),*)) };
1086+
(dict_not_contains, $($arg:expr),+) => { crate::frontend::Operation(
1087+
crate::frontend::OperationType::Native(crate::frontend::NativeOperation::DictNotContainsFromEntries),
1088+
crate::op_args!($($arg),*)) };
1089+
(set_contains, $($arg:expr),+) => { crate::frontend::Operation(
1090+
crate::frontend::OperationType::Native(crate::frontend::NativeOperation::SetContainsFromEntries),
1091+
crate::op_args!($($arg),*)) };
1092+
(set_not_contains, $($arg:expr),+) => { crate::frontend::Operation(
1093+
crate::frontend::OperationType::Native(crate::frontend::NativeOperation::SetNotContainsFromEntries),
1094+
crate::op_args!($($arg),*)) };
1095+
(array_contains, $($arg:expr),+) => { crate::frontend::Operation(
1096+
crate::frontend::OperationType::Native(crate::frontend::NativeOperation::ArrayContainsFromEntries),
1097+
crate::op_args!($($arg),*)) };
1098+
10831099
}
10841100
}
10851101

0 commit comments

Comments
 (0)