@@ -343,6 +343,8 @@ impl MainPodBuilder {
343343 ) ) ) ;
344344 st_args. push ( StatementArg :: Literal ( v. clone ( ) ) )
345345 }
346+ // Merkle proofs are never arguments to statements.
347+ OperationArg :: MerkleProof ( _) => ( ) ,
346348 } ;
347349 }
348350 Ok ( st_args)
@@ -802,9 +804,12 @@ impl MainPodCompiler {
802804 self . operations . push ( op) ;
803805 }
804806
805- fn compile_op_arg ( & self , op_arg : & OperationArg ) -> Option < middleware:: Statement > {
807+ fn compile_op_arg ( & self , op_arg : & OperationArg ) -> Option < middleware:: OperationArg > {
806808 match op_arg {
807- OperationArg :: Statement ( s) => self . compile_st ( s) . ok ( ) ,
809+ OperationArg :: Statement ( s) => self
810+ . compile_st ( s)
811+ . ok ( )
812+ . map ( |s| middleware:: OperationArg :: Statement ( s) ) ,
808813 OperationArg :: Literal ( _v) => {
809814 // OperationArg::Literal is a syntax sugar for the frontend. This is translated to
810815 // a new ValueOf statement and it's key used instead.
@@ -816,6 +821,9 @@ impl MainPodCompiler {
816821 // statement doesn't have any requirement on the key and value.
817822 None
818823 }
824+ OperationArg :: MerkleProof ( pf) => {
825+ Some ( middleware:: OperationArg :: MerkleProof ( pf. clone ( ) ) )
826+ }
819827 }
820828 }
821829
@@ -829,10 +837,7 @@ impl MainPodCompiler {
829837 // TODO: Take Merkle proof into account.
830838 let mop_args =
831839 op. 1 . iter ( )
832- . flat_map ( |arg| {
833- self . compile_op_arg ( arg)
834- . map ( |s| Ok ( middleware:: OperationArg :: Statement ( s. try_into ( ) ?) ) )
835- } )
840+ . flat_map ( |arg| self . compile_op_arg ( arg) . map ( |op_arg| Ok ( op_arg) ) )
836841 . collect :: < Result < Vec < _ > > > ( ) ?;
837842 middleware:: Operation :: op ( mop_code, & mop_args)
838843 }
0 commit comments