diff --git a/builds/msvc/resource.rc b/builds/msvc/resource.rc index 66ebf9c5a..e198fadcd 100644 Binary files a/builds/msvc/resource.rc and b/builds/msvc/resource.rc differ diff --git a/configure.ac b/configure.ac index ae1ab6b2c..278de5bcf 100644 --- a/configure.ac +++ b/configure.ac @@ -13,7 +13,7 @@ AC_PREREQ([2.65]) # Process command-line arguments and perform initialization and verification. -AC_INIT([libbitcoin-explorer], [3.1.0], [eric@voskuil.org]) +AC_INIT([libbitcoin-explorer], [3.2.0], [eric@voskuil.org]) # Do compilation tests. AC_LANG(C++) @@ -165,10 +165,10 @@ AC_SUBST([bitcoin_client_CPPFLAGS], [${bitcoin_client_CFLAGS}]) AC_MSG_NOTICE([bitcoin_client_CPPFLAGS : ${bitcoin_client_CPPFLAGS}]) AC_MSG_NOTICE([bitcoin_client_LIBS : ${bitcoin_client_LIBS}]) -# Require bitcoin-network of at least version 3.1.0 and output ${bitcoin_network_CPPFLAGS/LIBS/PKG}. +# Require bitcoin-network of at least version 3.2.0 and output ${bitcoin_network_CPPFLAGS/LIBS/PKG}. #------------------------------------------------------------------------------ -PKG_CHECK_MODULES([bitcoin_network], [libbitcoin-network >= 3.1.0]) -AC_SUBST([bitcoin_network_PKG], ['libbitcoin-network >= 3.1.0']) +PKG_CHECK_MODULES([bitcoin_network], [libbitcoin-network >= 3.2.0]) +AC_SUBST([bitcoin_network_PKG], ['libbitcoin-network >= 3.2.0']) AC_SUBST([bitcoin_network_CPPFLAGS], [${bitcoin_network_CFLAGS}]) AC_MSG_NOTICE([bitcoin_network_CPPFLAGS : ${bitcoin_network_CPPFLAGS}]) AC_MSG_NOTICE([bitcoin_network_LIBS : ${bitcoin_network_LIBS}]) diff --git a/include/bitcoin/explorer/version.hpp b/include/bitcoin/explorer/version.hpp index 47ab6d82c..43a239291 100644 --- a/include/bitcoin/explorer/version.hpp +++ b/include/bitcoin/explorer/version.hpp @@ -12,9 +12,9 @@ * For interpretation of the versioning scheme see: http://semver.org */ -#define LIBBITCOIN_EXPLORER_VERSION "3.1.0" +#define LIBBITCOIN_EXPLORER_VERSION "3.2.0" #define LIBBITCOIN_EXPLORER_MAJOR_VERSION 3 -#define LIBBITCOIN_EXPLORER_MINOR_VERSION 1 +#define LIBBITCOIN_EXPLORER_MINOR_VERSION 2 #define LIBBITCOIN_EXPLORER_PATCH_VERSION 0 #endif diff --git a/libbitcoin-explorer.pc.in b/libbitcoin-explorer.pc.in index 549e11278..ac4548625 100644 --- a/libbitcoin-explorer.pc.in +++ b/libbitcoin-explorer.pc.in @@ -25,7 +25,7 @@ Version: @PACKAGE_VERSION@ #============================================================================== # Dependencies that publish package configuration. #------------------------------------------------------------------------------ -Requires: libbitcoin-client >= 3.1.0 libbitcoin-network >= 3.1.0 +Requires: libbitcoin-client >= 3.1.0 libbitcoin-network >= 3.2.0 # Include directory and any other required compiler flags. #------------------------------------------------------------------------------ diff --git a/src/dispatch.cpp b/src/dispatch.cpp index 8a1afd7d4..9fc95f667 100644 --- a/src/dispatch.cpp +++ b/src/dispatch.cpp @@ -138,7 +138,7 @@ console_result dispatch_command(int argc, const char* argv[], log::stream console_out(&output, null_deleter()); log::stream console_err(&error, null_deleter()); - log::initialize(debug_log, error_log, console_out, console_err); + log::initialize(debug_log, error_log, console_out, console_err, false); } return command->invoke(out, err); diff --git a/src/prop_tree.cpp b/src/prop_tree.cpp index 78936213b..06bb6afb9 100644 --- a/src/prop_tree.cpp +++ b/src/prop_tree.cpp @@ -166,10 +166,12 @@ ptree prop_tree(const chain::history::list& rows, ptree prop_list(const tx_input_type& tx_input) { ptree tree; + + // This will have default versioning, but the address version is unused. const auto script_address = payment_address::extract(tx_input.script()); if (script_address) - tree.put("address", script_address); + tree.put("address_hash", hash160(script_address.hash())); tree.put("previous_output.hash", hash256(tx_input.previous_output().hash())); tree.put("previous_output.index", tx_input.previous_output().index()); @@ -219,10 +221,12 @@ ptree prop_tree(const std::vector& inputs, bool json) ptree prop_list(const tx_output_type& tx_output) { ptree tree; + + // This will have default versioning, but the address version is unused. const auto address = payment_address::extract(tx_output.script()); if (address) - tree.put("address", address); + tree.put("address_hash", hash160(address.hash())); tree.put("script", tx_output.script().to_string( machine::rule_fork::all_rules)); diff --git a/test/commands/fetch-tx.cpp b/test/commands/fetch-tx.cpp index fafdfe2b1..0cc29219f 100644 --- a/test/commands/fetch-tx.cpp +++ b/test/commands/fetch-tx.cpp @@ -28,9 +28,9 @@ BOOST_AUTO_TEST_SUITE(fetch_tx__invoke) #define FETCH_TX_SATOSHIS_WORDS_XML \ "\n" \ -"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b0000000000000000000000000000000000000000000000000000000000000000429496729542949672950
1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
5000000000
1
\n" +"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b000000000000000000000000000000000000000000000000000000000000000042949672954294967295062e907b15cbf27d5425399ebf6f0fb50ebb88f1850000000001\n" -#define FETCH_TX_SATOSHIS_WORDS_TX_INFO \ +#define FETCH_TX_SATOSHIS_WORDS_TX_INFO \ "transaction\n" \ "{\n" \ " hash 4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b\n" \ @@ -52,7 +52,7 @@ BOOST_AUTO_TEST_SUITE(fetch_tx__invoke) " {\n" \ " output\n" \ " {\n" \ -" address 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\n" \ +" address_hash 62e907b15cbf27d5425399ebf6f0fb50ebb88f18\n" \ " script \"[04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f] checksig\"\n" \ " value 5000000000\n" \ " }\n" \ @@ -62,6 +62,7 @@ BOOST_AUTO_TEST_SUITE(fetch_tx__invoke) #define FETCH_TX_SECOND_TX_HASH \ "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098" + #define FETCH_TX_SECOND_TX_INFO \ "transaction\n" \ "{\n" \ @@ -84,7 +85,7 @@ BOOST_AUTO_TEST_SUITE(fetch_tx__invoke) " {\n" \ " output\n" \ " {\n" \ -" address 12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX\n" \ +" address_hash 119b098e2e980a229e139a9ed01a469e518e6f26\n" \ " script \"[0496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858ee] checksig\"\n" \ " value 5000000000\n" \ " }\n" \ diff --git a/test/commands/script-decode.cpp b/test/commands/script-decode.cpp index 246932997..6dd7fa046 100644 --- a/test/commands/script-decode.cpp +++ b/test/commands/script-decode.cpp @@ -40,5 +40,13 @@ BOOST_AUTO_TEST_CASE(script_decode__invoke__data__okay_output) BX_REQUIRE_OUTPUT("[cf2e5b02] 0xd6 0xf0 [40f5a9defbbf710c388b8451c82145b1419fe9696837b1cdefc569a2a79baa6da2f747] 0xc3 nop3 10 [2a081dfd5e799abc41262103e0d17114] nip \n"); } +BOOST_AUTO_TEST_CASE(script_decode__invoke__issue_477__okay_output) +{ + BX_DECLARE_COMMAND(script_decode); + command.set_base16_argument({ "4730440220688fb2aef767f21127b375d50d0ab8f7a1abaecad08e7c4987f7305c90e5a02502203282909b7863149bf4c92589764df80744afb509b949c06bfbeb28864277d88d0121025334b571c11e22967452f195509260f6a6dd10357fc4ad76b1c0aa5981ac254e" }); + BX_REQUIRE_OKAY(command.invoke(output, error)); + BX_REQUIRE_OUTPUT("[30440220688fb2aef767f21127b375d50d0ab8f7a1abaecad08e7c4987f7305c90e5a02502203282909b7863149bf4c92589764df80744afb509b949c06bfbeb28864277d88d01] [025334b571c11e22967452f195509260f6a6dd10357fc4ad76b1c0aa5981ac254e]\n"); +} + BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END() diff --git a/test/commands/tx-decode.cpp b/test/commands/tx-decode.cpp index 69d597ef9..b18bdeb24 100644 --- a/test/commands/tx-decode.cpp +++ b/test/commands/tx-decode.cpp @@ -46,7 +46,7 @@ BOOST_AUTO_TEST_SUITE(tx_decode__invoke) " {\n" \ " output\n" \ " {\n" \ -" address 1966U1pjj15tLxPXZ19U48c99EJDkdXeqb\n" \ +" address_hash 58b7a60f11a904feef35a639b6048de8dd4d9f1c\n" \ " script \"dup hash160 [58b7a60f11a904feef35a639b6048de8dd4d9f1c] equalverify checksig\"\n" \ " value 45000\n" \ " }\n" \ @@ -86,7 +86,7 @@ BOOST_AUTO_TEST_SUITE(tx_decode__invoke) " }\n" \ " output\n" \ " {\n" \ -" address 1KbjyvFBRc2p6dKpTfDAFdT5DqmVLGX3B4\n" \ +" address_hash cc04492c12d0ddeb4cf88cfccb0d6d78d0fcd39d\n" \ " script \"dup hash160 [cc04492c12d0ddeb4cf88cfccb0d6d78d0fcd39d] equalverify checksig\"\n" \ " value 42\n" \ " }\n" \ @@ -116,7 +116,7 @@ BOOST_AUTO_TEST_SUITE(tx_decode__invoke) " {\n" \ " output\n" \ " {\n" \ -" address 13Ft7SkreJY9D823NPm4t6D1cBqLYTJtAe\n" \ +" address_hash 18c0bd8d1818f1bf99cb1df2269c645318ef7b73\n" \ " script \"dup hash160 [18c0bd8d1818f1bf99cb1df2269c645318ef7b73] equalverify checksig\"\n" \ " value 500\n" \ " }\n" \ @@ -132,7 +132,7 @@ BOOST_AUTO_TEST_SUITE(tx_decode__invoke) " {\n" \ " input\n" \ " {\n" \ -" address 1JziqzXeBPyHPeAHrG4DCDW4ASXeGGF6p6\n" \ +" address_hash c564c740c6900b93afc9f1bdaef0a9d466adf6ee\n" \ " previous_output\n" \ " {\n" \ " hash 7c3e880e7c93a7b01506188c36a239f70b561dfa622d0aa0d8f3b7403c94017d\n" \ @@ -147,7 +147,7 @@ BOOST_AUTO_TEST_SUITE(tx_decode__invoke) " {\n" \ " output\n" \ " {\n" \ -" address 1966U1pjj15tLxPXZ19U48c99EJDkdXeqb\n" \ +" address_hash 58b7a60f11a904feef35a639b6048de8dd4d9f1c\n" \ " script \"dup hash160 [58b7a60f11a904feef35a639b6048de8dd4d9f1c] equalverify checksig\"\n" \ " value 45000\n" \ " }\n" \ @@ -191,5 +191,14 @@ BOOST_AUTO_TEST_CASE(tx_decode__invoke__example_4__expected_output) BX_REQUIRE_OUTPUT(TX_DECODE_EXAMPLE4); } +////BOOST_AUTO_TEST_CASE(tx_decode__invoke__issue_477__expected_output) +////{ +//// BX_DECLARE_COMMAND(tx_decode); +//// command.set_format_option({ "info" }); +//// command.set_transaction_argument({ "0100000001833d56a22cd88ef7a17d51d30b169a86aa4138f60867a6e21fc88a7b546b5d64010000006a4730440220688fb2aef767f21127b375d50d0ab8f7a1abaecad08e7c4987f7305c90e5a02502203282909b7863149bf4c92589764df80744afb509b949c06bfbeb28864277d88d0121025334b571c11e22967452f195509260f6a6dd10357fc4ad76b1c0aa5981ac254effffffff030000000000000000246a22414243444546917ce6520f0740cd2c373bd506415777bd23e8680123456789abcdef10270000000000001976a914ce5b06176d2572d4fb985747f197c389b8ac64e888ac30750000000000001976a9143c6602137d7f9a68a96aff2d3cf37bbdeeb95b7d88ac00000000" }); +//// BX_REQUIRE_OKAY(command.invoke(output, error)); +//// BX_REQUIRE_OUTPUT(TX_DECODE_EXAMPLE4); +////} + BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END() diff --git a/test/commands/validate-tx.cpp b/test/commands/validate-tx.cpp index f94bb3132..31a2ff83d 100644 --- a/test/commands/validate-tx.cpp +++ b/test/commands/validate-tx.cpp @@ -30,7 +30,10 @@ BOOST_AUTO_TEST_SUITE(validate_tx__invoke) #define VALIDATE_TX_NEW_TX_BASE16 \ "0100000001b3807042c92f449bbf79b33ca59d7dfec7f4cc71096704a9c526dddf496ee097010000006a473044022039a36013301597daef41fbe593a02cc513d0b55527ec2df1050e2e8ff49c85c202201035fe810e283bcf394485c6a9dfd117ad9f684cdd83d36453718f5d0491b9dd012103c40cbd64c9c608df2c9730f49b0888c4db1c436e8b2b74aead6c6afbd10428c0ffffffff01905f0100000000001976a91418c0bd8d1818f1bf99cb1df2269c645318ef7b7388ac00000000" -BOOST_AUTO_TEST_CASE(validate_tx__invoke__mainnet_satoshis_words__failure_error) +#define VALIDATE_TX_ISSUE_477 \ +"0100000001833d56a22cd88ef7a17d51d30b169a86aa4138f60867a6e21fc88a7b546b5d64010000006a4730440220688fb2aef767f21127b375d50d0ab8f7a1abaecad08e7c4987f7305c90e5a02502203282909b7863149bf4c92589764df80744afb509b949c06bfbeb28864277d88d0121025334b571c11e22967452f195509260f6a6dd10357fc4ad76b1c0aa5981ac254effffffff030000000000000000246a22414243444546917ce6520f0740cd2c373bd506415777bd23e8680123456789abcdef10270000000000001976a914ce5b06176d2572d4fb985747f197c389b8ac64e888ac30750000000000001976a9143c6602137d7f9a68a96aff2d3cf37bbdeeb95b7d88ac00000000" + +BOOST_AUTO_TEST_CASE(validate_tx__invoke__mainnet_satoshis_words__failure_coinbase_transaction) { BX_DECLARE_CLIENT_COMMAND(validate_tx); command.set_transaction_argument({ BX_SATOSHIS_WORDS_TX_BASE16 }); @@ -38,7 +41,7 @@ BOOST_AUTO_TEST_CASE(validate_tx__invoke__mainnet_satoshis_words__failure_error) BX_REQUIRE_ERROR(BX_ERROR_MESSAGE(coinbase_transaction) + "\n"); } -BOOST_AUTO_TEST_CASE(validate_tx__invoke__bad_signature_tx__failure_error) +BOOST_AUTO_TEST_CASE(validate_tx__invoke__bad_signature_tx__failure_missing_previous_output) { BX_DECLARE_CLIENT_COMMAND(validate_tx); command.set_transaction_argument({ VALIDATE_TX_BAD_SIGNATURE_TX_BASE16 }); @@ -50,7 +53,7 @@ BOOST_AUTO_TEST_CASE(validate_tx__invoke__bad_signature_tx__failure_error) BX_REQUIRE_ERROR(BX_ERROR_MESSAGE(missing_previous_output) + "\n"); } -BOOST_AUTO_TEST_CASE(validate_tx__invoke__new_tx__failure_error) +BOOST_AUTO_TEST_CASE(validate_tx__invoke__new_tx__failure_missing_previous_output) { BX_DECLARE_CLIENT_COMMAND(validate_tx); command.set_transaction_argument({ VALIDATE_TX_NEW_TX_BASE16 }); @@ -62,5 +65,13 @@ BOOST_AUTO_TEST_CASE(validate_tx__invoke__new_tx__failure_error) BX_REQUIRE_ERROR(BX_ERROR_MESSAGE(missing_previous_output) + "\n"); } +BOOST_AUTO_TEST_CASE(validate_tx__invoke__issue_477__failure_op_equal_verify2) +{ + BX_DECLARE_CLIENT_COMMAND(validate_tx); + command.set_transaction_argument({ VALIDATE_TX_ISSUE_477 }); + BX_REQUIRE_FAILURE(command.invoke(output, error)); + BX_REQUIRE_ERROR(BX_ERROR_MESSAGE(op_equal_verify2) + "\n"); +} + BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()