File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -501,13 +501,25 @@ DEFINE_JSON_TO_TAG(input)
501501
502502DEFINE_JSON_FROM_TAG (input)
503503{
504- value =
504+ if (instance. witness (). is_valid ())
505505 {
506- { " point" , value_from (instance.point ()) },
507- { " script" , value_from (instance.script ()) },
508- { " witness" , value_from (instance.witness ()) },
509- { " sequence" , instance.sequence () }
510- };
506+ value =
507+ {
508+ { " point" , value_from (instance.point ()) },
509+ { " script" , value_from (instance.script ()) },
510+ { " witness" , value_from (instance.witness ()) },
511+ { " sequence" , instance.sequence () }
512+ };
513+ }
514+ else
515+ {
516+ value =
517+ {
518+ { " point" , value_from (instance.point ()) },
519+ { " script" , value_from (instance.script ()) },
520+ { " sequence" , instance.sequence () }
521+ };
522+ }
511523}
512524
513525DEFINE_JSON_TO_TAG (input::cptr)
Original file line number Diff line number Diff line change @@ -465,10 +465,10 @@ static std::string opcode_to_prefix(opcode code,
465465std::string operation::to_string (uint32_t active_flags) const NOEXCEPT
466466{
467467 if (!is_valid ())
468- return " (?) " ;
468+ return " ? " ;
469469
470470 if (underflow_)
471- return " < " + encode_base16 (get_data ()) + " > " ;
471+ return " ( " + encode_base16 (get_data ()) + " ) " ;
472472
473473 if (data_empty ())
474474 return opcode_to_mnemonic (code_, active_flags);
Original file line number Diff line number Diff line change @@ -781,7 +781,7 @@ BOOST_AUTO_TEST_CASE(operation__to_string__empty_underflow__empty)
781781 operation value (encoded);
782782 BOOST_REQUIRE (value.is_invalid ());
783783 BOOST_REQUIRE (value.is_underflow ());
784- BOOST_REQUIRE_EQUAL (value.to_string (0 ), " <> " );
784+ BOOST_REQUIRE_EQUAL (value.to_string (0 ), " () " );
785785}
786786
787787BOOST_AUTO_TEST_CASE (operation__to_string__non_empty_underflow__empty)
@@ -791,7 +791,7 @@ BOOST_AUTO_TEST_CASE(operation__to_string__non_empty_underflow__empty)
791791 operation value (encoded);
792792 BOOST_REQUIRE (value.is_invalid ());
793793 BOOST_REQUIRE (value.is_underflow ());
794- BOOST_REQUIRE_EQUAL (value.to_string (0 ), " < 02ff> " );
794+ BOOST_REQUIRE_EQUAL (value.to_string (0 ), " ( 02ff) " );
795795}
796796
797797BOOST_AUTO_TEST_CASE (operation__to_string__nop2_no_rules__nop2)
You can’t perform that action at this time.
0 commit comments