File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -386,6 +386,8 @@ DEFINE_JSON_FROM_TAG(header)
386386{
387387 value =
388388 {
389+ // hash is meta property
390+ { " hash" , encode_hash (instance.hash ()) },
389391 { " version" , instance.version () },
390392 { " previous" , encode_hash (instance.previous_block_hash ()) },
391393 { " merkle_root" , encode_hash (instance.merkle_root ()) },
Original file line number Diff line number Diff line change @@ -969,6 +969,8 @@ DEFINE_JSON_FROM_TAG(transaction)
969969{
970970 value =
971971 {
972+ // hash is meta property
973+ { " hash" , encode_hash (instance.hash (false )) },
972974 { " version" , instance.version () },
973975 { " inputs" , value_from (*instance.inputs_ptr ()) },
974976 { " outputs" , value_from (*instance.outputs_ptr ()) },
Original file line number Diff line number Diff line change @@ -724,6 +724,7 @@ BOOST_AUTO_TEST_CASE(block__json__conversions__expected)
724724 " {"
725725 " \" header\" :"
726726 " {"
727+ " \" hash\" :\" d5b1048b2dcb443dd79a15e54de994fa18620d1d99250f2a4123660c68dea664\" ,"
727728 " \" version\" :42,"
728729 " \" previous\" :\" 0000000000000000000000000000000000000000000000000000000000000000\" ,"
729730 " \" merkle_root\" :\" 0000000000000000000000000000000000000000000000000000000000000001\" ,"
@@ -734,6 +735,7 @@ BOOST_AUTO_TEST_CASE(block__json__conversions__expected)
734735 " \" transactions\" :"
735736 " ["
736737 " {"
738+ " \" hash\" :\" 6d74f0162f9c7a3be99cb60cca0c658f3e19fb3462f4c9731d5a0b7495183335\" ,"
737739 " \" version\" :42,"
738740 " \" inputs\" :"
739741 " ["
Original file line number Diff line number Diff line change @@ -353,6 +353,7 @@ BOOST_AUTO_TEST_CASE(header__json__conversions__expected)
353353 const std::string text
354354 {
355355 " {"
356+ " \" hash\" :\" d5b1048b2dcb443dd79a15e54de994fa18620d1d99250f2a4123660c68dea664\" ,"
356357 " \" version\" :42,"
357358 " \" previous\" :\" 0000000000000000000000000000000000000000000000000000000000000000\" ,"
358359 " \" merkle_root\" :\" 0000000000000000000000000000000000000000000000000000000000000001\" ,"
Original file line number Diff line number Diff line change @@ -1504,6 +1504,7 @@ BOOST_AUTO_TEST_CASE(transaction__json__conversions__expected)
15041504 const std::string text
15051505 {
15061506 " {"
1507+ " \" hash\" :\" 6d74f0162f9c7a3be99cb60cca0c658f3e19fb3462f4c9731d5a0b7495183335\" ,"
15071508 " \" version\" :42,"
15081509 " \" inputs\" :"
15091510 " ["
You can’t perform that action at this time.
0 commit comments