diff options
-rw-r--r-- | doc/developer-notes.md | 2 | ||||
-rw-r--r-- | src/rpc/rawtransaction_util.cpp | 2 | ||||
-rw-r--r-- | src/rpc/rawtransaction_util.h | 4 | ||||
-rw-r--r-- | test/functional/test_framework/util.py | 7 | ||||
-rwxr-xr-x | test/functional/wallet_avoidreuse.py | 8 | ||||
-rwxr-xr-x | test/functional/wallet_groups.py | 7 |
6 files changed, 13 insertions, 17 deletions
diff --git a/doc/developer-notes.md b/doc/developer-notes.md index 561f623cd5..f4a5e2d330 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -193,7 +193,7 @@ Documentation can be generated with `make docs` and cleaned up with `make clean- Before running `make docs`, you will need to install dependencies `doxygen` and `dot`. For example, on macOS via Homebrew: ``` -brew install doxygen --with-graphviz +brew install graphviz doxygen ``` Development tips and tricks diff --git a/src/rpc/rawtransaction_util.cpp b/src/rpc/rawtransaction_util.cpp index f1d176ba4d..fe98fff4bb 100644 --- a/src/rpc/rawtransaction_util.cpp +++ b/src/rpc/rawtransaction_util.cpp @@ -268,7 +268,7 @@ void ParsePrevouts(const UniValue& prevTxsUnival, FillableSigningProvider* keyst } } -UniValue SignTransaction(CMutableTransaction& mtx, const SigningProvider* keystore, std::map<COutPoint, Coin>& coins, const UniValue& hashType) +UniValue SignTransaction(CMutableTransaction& mtx, const SigningProvider* keystore, const std::map<COutPoint, Coin>& coins, const UniValue& hashType) { int nHashType = ParseSighashString(hashType); diff --git a/src/rpc/rawtransaction_util.h b/src/rpc/rawtransaction_util.h index b35e6da4ca..5b92650764 100644 --- a/src/rpc/rawtransaction_util.h +++ b/src/rpc/rawtransaction_util.h @@ -19,11 +19,11 @@ class SigningProvider; * * @param mtx The transaction to-be-signed * @param keystore Temporary keystore containing signing keys - * @param coins Map of unspent outputs - coins in mempool and current chain UTXO set, may be extended by previous txns outputs after call + * @param coins Map of unspent outputs * @param hashType The signature hash type * @returns JSON object with details of signed transaction */ -UniValue SignTransaction(CMutableTransaction& mtx, const SigningProvider* keystore, std::map<COutPoint, Coin>& coins, const UniValue& hashType); +UniValue SignTransaction(CMutableTransaction& mtx, const SigningProvider* keystore, const std::map<COutPoint, Coin>& coins, const UniValue& hashType); /** * Parse a prevtxs UniValue array and get the map of coins from it diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index 3175872b00..1c254b6755 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -25,6 +25,13 @@ logger = logging.getLogger("TestFramework.utils") # Assert functions ################## +def assert_approx(v, vexp, vspan=0.00001): + """Assert that `v` is within `vspan` of `vexp`""" + if v < vexp - vspan: + raise AssertionError("%s < [%s..%s]" % (str(v), str(vexp - vspan), str(vexp + vspan))) + if v > vexp + vspan: + raise AssertionError("%s > [%s..%s]" % (str(v), str(vexp - vspan), str(vexp + vspan))) + def assert_fee_amount(fee, tx_size, fee_per_kB): """Assert the fee was in range""" target_fee = round(tx_size * fee_per_kB / 1000, 8) diff --git a/test/functional/wallet_avoidreuse.py b/test/functional/wallet_avoidreuse.py index e3aa6705e5..3c8064ea2d 100755 --- a/test/functional/wallet_avoidreuse.py +++ b/test/functional/wallet_avoidreuse.py @@ -6,18 +6,12 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( + assert_approx, assert_equal, assert_raises_rpc_error, connect_nodes, ) -# TODO: Copied from wallet_groups.py -- should perhaps move into util.py -def assert_approx(v, vexp, vspan=0.00001): - if v < vexp - vspan: - raise AssertionError("%s < [%s..%s]" % (str(v), str(vexp - vspan), str(vexp + vspan))) - if v > vexp + vspan: - raise AssertionError("%s > [%s..%s]" % (str(v), str(vexp - vspan), str(vexp + vspan))) - def reset_balance(node, discardaddr): '''Throw away all owned coins by the node so it gets a balance of 0.''' balance = node.getbalance(avoid_reuse=False) diff --git a/test/functional/wallet_groups.py b/test/functional/wallet_groups.py index 5452433acf..d1178611bd 100755 --- a/test/functional/wallet_groups.py +++ b/test/functional/wallet_groups.py @@ -7,15 +7,10 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.messages import CTransaction, FromHex, ToHex from test_framework.util import ( + assert_approx, assert_equal, ) -def assert_approx(v, vexp, vspan=0.00001): - if v < vexp - vspan: - raise AssertionError("%s < [%s..%s]" % (str(v), str(vexp - vspan), str(vexp + vspan))) - if v > vexp + vspan: - raise AssertionError("%s > [%s..%s]" % (str(v), str(vexp - vspan), str(vexp + vspan))) - class WalletGroupTest(BitcoinTestFramework): def set_test_params(self): self.setup_clean_chain = True |