@@ -30,6 +30,7 @@ pub struct Origin(pub PodClass, pub PodId);
3030pub enum Value {
3131 String ( String ) ,
3232 Int ( i64 ) ,
33+ Bool ( bool ) ,
3334 Dictionary ( Dictionary ) ,
3435 Set ( Set ) ,
3536 Array ( Array ) ,
@@ -47,11 +48,18 @@ impl From<i64> for Value {
4748 }
4849}
4950
51+ impl From < bool > for Value {
52+ fn from ( b : bool ) -> Self {
53+ Value :: Bool ( b)
54+ }
55+ }
56+
5057impl From < & Value > for middleware:: Value {
5158 fn from ( v : & Value ) -> Self {
5259 match v {
5360 Value :: String ( s) => middleware:: Value ( hash_str ( s) . 0 ) ,
5461 Value :: Int ( v) => middleware:: Value :: from ( * v) ,
62+ Value :: Bool ( b) => middleware:: Value :: from ( * b as i64 ) ,
5563 Value :: Dictionary ( d) => middleware:: Value ( d. commitment ( ) . 0 ) ,
5664 Value :: Set ( s) => middleware:: Value ( s. commitment ( ) . 0 ) ,
5765 Value :: Array ( a) => middleware:: Value ( a. commitment ( ) . 0 ) ,
@@ -64,6 +72,7 @@ impl fmt::Display for Value {
6472 match self {
6573 Value :: String ( s) => write ! ( f, "\" {}\" " , s) ,
6674 Value :: Int ( v) => write ! ( f, "{}" , v) ,
75+ Value :: Bool ( b) => write ! ( f, "{}" , b) ,
6776 Value :: Dictionary ( d) => write ! ( f, "dict:{}" , d. commitment( ) ) ,
6877 Value :: Set ( s) => write ! ( f, "set:{}" , s. commitment( ) ) ,
6978 Value :: Array ( a) => write ! ( f, "arr:{}" , a. commitment( ) ) ,
@@ -224,6 +233,12 @@ impl From<i64> for OperationArg {
224233 }
225234}
226235
236+ impl From < bool > for OperationArg {
237+ fn from ( b : bool ) -> Self {
238+ Self :: Literal ( Value :: from ( b) )
239+ }
240+ }
241+
227242impl From < ( Origin , & str ) > for OperationArg {
228243 fn from ( ( origin, key) : ( Origin , & str ) ) -> Self {
229244 Self :: Key ( AnchoredKey ( origin, key. to_string ( ) ) )
@@ -578,8 +593,9 @@ pub mod build_utils {
578593#[ cfg( test) ]
579594pub mod tests {
580595 use super :: * ;
596+ use crate :: backends:: mock_main:: MockProver ;
581597 use crate :: backends:: mock_signed:: MockSigner ;
582- use crate :: examples:: { great_boy_pod_full_flow, zu_kyc_pod_builder, zu_kyc_sign_pod_builders} ;
598+ use crate :: examples:: { great_boy_pod_full_flow, tickets_pod_full_flow , zu_kyc_pod_builder, zu_kyc_sign_pod_builders} ;
583599
584600 #[ test]
585601 fn test_front_zu_kyc ( ) -> Result < ( ) > {
@@ -617,4 +633,12 @@ pub mod tests {
617633
618634 Ok ( ( ) )
619635 }
620- }
636+
637+ #[ test]
638+ fn test_front_tickets ( ) -> Result < ( ) > {
639+ let builder = tickets_pod_full_flow ( ) ;
640+ println ! ( "{}" , builder) ;
641+
642+ Ok ( ( ) )
643+ }
644+ }
0 commit comments