File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,11 +14,14 @@ struct Output {
1414 witness : Option < String > ,
1515 /// Simplicity program ABI metadata to the program which the user provides.
1616 abi_meta : Option < AbiMeta > ,
17+ /// Commitment Merkle Root (CMR) of the program, hex encoded.
18+ cmr : String ,
1719}
1820
1921impl fmt:: Display for Output {
2022 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
2123 writeln ! ( f, "Program:\n {}" , self . program) ?;
24+ writeln ! ( f, "CMR:\n {}" , self . cmr) ?;
2225 if let Some ( witness) = & self . witness {
2326 writeln ! ( f, "Witness:\n {}" , witness) ?;
2427 }
@@ -156,10 +159,12 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
156159 None
157160 } ;
158161
162+ let cmr_hex = compiled. commit ( ) . cmr ( ) . to_string ( ) ;
159163 let output = Output {
160164 program : Base64Display :: new ( & program_bytes, & STANDARD ) . to_string ( ) ,
161165 witness : witness_bytes. map ( |bytes| Base64Display :: new ( & bytes, & STANDARD ) . to_string ( ) ) ,
162166 abi_meta : abi_opt,
167+ cmr : cmr_hex,
163168 } ;
164169
165170 if output_json {
You can’t perform that action at this time.
0 commit comments