From fa831e709a4d605a18e5de1627b48d670bb326fb Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Thu, 17 Jun 2021 18:02:09 +0200 Subject: [PATCH 1/6] build_msvc: Add bitcoin-util.exe --- build_msvc/bitcoin-util/bitcoin-util.vcxproj | 37 ++++++++++++++++++++ build_msvc/bitcoin.sln | 2 ++ 2 files changed, 39 insertions(+) create mode 100644 build_msvc/bitcoin-util/bitcoin-util.vcxproj diff --git a/build_msvc/bitcoin-util/bitcoin-util.vcxproj b/build_msvc/bitcoin-util/bitcoin-util.vcxproj new file mode 100644 index 0000000000..3a6aa4a837 --- /dev/null +++ b/build_msvc/bitcoin-util/bitcoin-util.vcxproj @@ -0,0 +1,37 @@ + + + + + {D3022AF6-AD33-4CE3-B358-87CB6A1B29CF} + + + Application + $(SolutionDir)$(Platform)\$(Configuration)\ + + + + + + + {2b384fa8-9ee1-4544-93cb-0d733c25e8ce} + + + {7c87e378-df58-482e-aa2f-1bc129bc19ce} + + + {6190199c-6cf4-4dad-bfbd-93fa72a760c1} + + + {b53a5535-ee9d-4c6f-9a26-f79ee3bc3754} + + + {5724ba7d-a09a-4ba8-800b-c4c1561b3d69} + + + {bb493552-3b8c-4a8c-bf69-a6e7a51d2ea6} + + + + + + diff --git a/build_msvc/bitcoin.sln b/build_msvc/bitcoin.sln index 5e9715451f..7d8591c10b 100644 --- a/build_msvc/bitcoin.sln +++ b/build_msvc/bitcoin.sln @@ -32,6 +32,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bench_bitcoin", "bench_bitc EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bitcoin-tx", "bitcoin-tx\bitcoin-tx.vcxproj", "{D3022AF6-AD33-4CE3-B358-87CB6A1B29CF}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bitcoin-util", "bitcoin-util\bitcoin-util.vcxproj", "{D3022AF6-AD33-4CE3-B358-87CB6A1B29CF}" +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bitcoin-wallet", "bitcoin-wallet\bitcoin-wallet.vcxproj", "{84DE8790-EDE3-4483-81AC-C32F15E861F4}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbitcoin_wallet_tool", "libbitcoin_wallet_tool\libbitcoin_wallet_tool.vcxproj", "{F91AC55E-6F5E-4C58-9AC5-B40DB7DEEF93}" From fa304929e2c3583bc3e6b05eaa6e0df6cdac6ec8 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Thu, 17 Jun 2021 15:06:10 +0200 Subject: [PATCH 2/6] test: Add bitcoin-util tests --- test/util/data/bitcoin-util-test.json | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/test/util/data/bitcoin-util-test.json b/test/util/data/bitcoin-util-test.json index 0a9846b4be..a648c0287a 100644 --- a/test/util/data/bitcoin-util-test.json +++ b/test/util/data/bitcoin-util-test.json @@ -1,4 +1,34 @@ [ + { "exec": "./bitcoin-util", + "args": ["foo"], + "return_code": 1, + "error_txt": "Error parsing command line arguments: Invalid command 'foo'", + "description": "" + }, + { "exec": "./bitcoin-util", + "args": ["help"], + "return_code": 1, + "error_txt": "Error parsing command line arguments: Invalid command 'help'", + "description": "`help` raises an error. Use `-help`" + }, + { "exec": "./bitcoin-util", + "args": ["grind"], + "return_code": 1, + "error_txt": "Must specify block header to grind", + "description": "" + }, + { "exec": "./bitcoin-util", + "args": ["grind", "1", "2"], + "return_code": 1, + "error_txt": "Must specify block header to grind", + "description": "" + }, + { "exec": "./bitcoin-util", + "args": ["grind", "aa"], + "return_code": 1, + "error_txt": "Could not decode block header", + "description": "" + }, { "exec": "./bitcoin-tx", "args": ["-create", "nversion=1"], "output_cmp": "blanktxv1.hex", From fa3c1eee7ff2646e78540d53b4f8eaf095a8c27d Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Thu, 17 Jun 2021 14:09:53 +0200 Subject: [PATCH 3/6] Remove unused includes from bitcoin-util --- src/bitcoin-util.cpp | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/bitcoin-util.cpp b/src/bitcoin-util.cpp index 3f273e75f6..8f50126f41 100644 --- a/src/bitcoin-util.cpp +++ b/src/bitcoin-util.cpp @@ -7,28 +7,19 @@ #endif #include +#include +#include +#include #include -#include -#include #include -#include -#include -#include -#include