Commit Graph

47 Commits

Author SHA1 Message Date
MacroFake
fa04ff61b6
test: Return new_utxos from create_self_transfer_multi in MiniWallet 2022-06-27 11:07:34 +02:00
MacroFake
fa8421bc5b
test: Remove from_node from create_self_transfer* MiniWallet helpers
The from_node argument is no longer used as of commit
a55606c3bd
2022-06-21 12:02:01 +02:00
Sebastian Falbesoner
494455f8a5 test: use MiniWallet for feature_fee_estimation.py
This test can now be run even with the Bitcoin Core wallet disabled.
2022-04-10 02:11:38 +02:00
Antoine Poinsot
60ae1161a4
qa: replace assert with test framework assertion helpers in fee estimation test 2021-12-09 15:11:42 +01:00
Antoine Poinsot
e50213967b
qa: fee estimation with RBF test cleanups
Followups to #22539

Co-Authored-By: Sebastian Falbesoner <sebastian.falbesoner@gmail.com>
2021-12-09 15:11:35 +01:00
Antoine Poinsot
15f5fd62af
qa: don't mine non standard txs in fee estimation test
We don't need dust outputs anymore.

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2021-12-09 14:59:46 +01:00
Antoine Poinsot
eae52dd6ab
qa: pass scriptsig directly to txins constructor in fee estimation test
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2021-12-09 14:59:46 +01:00
Antoine Poinsot
1fc03155e5
qa: split coins in a single tx in fee estimation test
This simplifies the code, and slightly speeds up the test.

Running `./test/functional/test_runner.py -j15 $(printf 'feature_fee_estimation %.0s' {1..15})`
on master 3 times gives:

- Before:
    ALL                       | ✓ Passed  | 788 s (accumulated)
    ALL                       | ✓ Passed  | 818 s (accumulated)
    ALL                       | ✓ Passed  | 873 s (accumulated)

- After:
    ALL                       | ✓ Passed  | 763 s (accumulated)
    ALL                       | ✓ Passed  | 798 s (accumulated)
    ALL                       | ✓ Passed  | 731 s (accumulated)

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2021-12-09 14:59:44 +01:00
Antoine Poinsot
cc204b8be7
qa: use a single p2sh script in fee estimation test
Using 2 different scripts is unnecessary complication

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2021-12-09 14:59:16 +01:00
Antoine Poinsot
19dd91a9be
qa: remove a redundant condition in fee estimation test
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2021-12-09 13:04:07 +01:00
MarcoFalke
fac23c2114
scripted-diff: Bump copyright headers
The previous diff touched most files in ./test/, so bump the headers to
avoid having to touch them again for a bump later.

-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./test/
-END VERIFY SCRIPT-
2021-11-10 11:10:24 +01:00
MarcoFalke
fa974f1f14
scripted-diff: Remove redundant sync_all and sync_blocks
The sync calls are redundant after a call to generate, because generate
already syncs itself.

-BEGIN VERIFY SCRIPT-
perl -0777 -pi -e 's/(generate[^\n]*\)[^\n]*)(\n|\s)+self.sync_(all|blocks)\([^\)]*\)\n/\1\n/g' $(git grep -l generate ./test)
-END VERIFY SCRIPT-
2021-11-10 11:10:15 +01:00
MarcoFalke
facc352648
test: Implicitly sync after generate*, unless opted out 2021-10-29 13:34:52 +02:00
Antoine Poinsot
4556406562
qa: test fee estimation with replacement transactions
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2021-09-29 17:24:28 +02:00
Antoine Poinsot
053415b297
qa: split run_test into smaller parts
Let's not have run_test get into a giant function as we add more tests

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2021-09-29 17:15:18 +02:00
pranabp-bit
ea31caf6b4 update estimatesmartfee rpc to return max of estimateSmartFee, mempoolMinFee and minRelayTxFee.
This will provide better estimates which would be closer to fee paid in actual
transactions.
The test has also been changed such that when the node is restarted with a
high mempoolMinFee, the estimatesmartfee still returns a feeRate greater
than or equal to the mempoolMinFee, minRelayTxFee.(just like the feeRate of actual transactions)
2021-09-28 18:36:38 +05:30
MarcoFalke
fa0b916971
scripted-diff: Use generate* from TestFramework
-BEGIN VERIFY SCRIPT-
 sed --regexp-extended -i \
     's/((self\.)?(nodes\[[^]]+\]|[a-z_]*(wallet|node)[0-9a-z_]*))\.(generate(|toaddress|block|todescriptor)(\(|, ))/self.\5\1, /g' \
     $(git grep -l generate ./test | grep -v 'test_framework/' | grep -v 'feature_rbf')
-END VERIFY SCRIPT-
2021-09-02 10:34:35 +02:00
fanquake
d5a6adc5e4
test: use f-strings in feature_fee_estimation.py 2021-08-18 12:39:18 +08:00
Sebastian Falbesoner
285a65ccfd test: use script_util helpers for creating P2SH scripts 2021-07-05 20:40:47 +02:00
Sebastian Falbesoner
a79396fe5f test: remove ToHex helper, use .serialize().hex() instead 2021-06-21 14:30:03 +02:00
Antoine Poinsot
e8ea6ad9c1
init: don't create a CBlockPolicyEstimator if we don't relay transactions
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-12-03 12:56:37 +01:00
Prayank
4b16c61461 scripted-diff: test: Replace uses of (dis)?connect_nodes global
-BEGIN VERIFY SCRIPT-

 # max-depth=0 excludes test/functional/test_framework/...
 FILES=$(git grep -l --max-depth 0 "connect_nodes" test/functional)

 # Replace (dis)?connect_nodes(self.nodes[a], b) with self.(dis)?connect_nodes(a, b)
 sed -i 's/\b\(dis\)\?connect_nodes(self\.nodes\[\(.*\)\]/self.\1connect_nodes(\2/g' $FILES

 # Remove imports in the middle of a line
 sed -i 's/\(dis\)\?connect_nodes, //g' $FILES
 sed -i 's/, \(dis\)\?connect_nodes//g' $FILES

 # Remove imports on a line by themselves
 sed -i '/^\s*\(dis\)\?connect_nodes,\?$/d' $FILES
 sed -i '/^from test_framework\.util import connect_nodes$/d' $FILES

-END VERIFY SCRIPT-

Co-authored-by: Elliott Jin <elliott.jin@gmail.com>
2020-10-20 00:42:00 -07:00
Russell Yanofsky
c1585bca8d test: Get rid of default wallet hacks
- Get rid of hardcoded wallet "" names and -wallet="" args
- Get rid of setup_nodes (-wallet, -nowallet, -disablewallet) argument rewriting

Motivation:

- Simplify test framework behavior so it's easier to write new tests without
  having arguments mangled by the framework
- Make tests more readable, replacing unexplained "" string literals with
  default_wallet_name references
- Make it trivial to update default wallet name and wallet data filename for
  sqlite #19077 testing
- Stop relying on -wallet arguments to create wallets, so it is easy to change
  -wallet option in the future to only load existing wallets not create new
  ones (to avoid accidental wallet creation, and encourage use of wallet
  encryption and descriptor features)
2020-09-29 04:35:01 -04:00
Andrew Chow
1bee1e6269 Do not create default wallet
No longer create a default wallet. The default wallet will still be
loaded if it exists and not other wallets were specified (anywhere,
including settings.json, bitcoin.conf, and command line).

Tests are updated to be started with -wallet= if they need the default
wallet.

Added test to wallet_startup.py testing that no default wallet is
created and that it is loaded if it exists and no other wallets were
specified.
2020-09-08 21:02:53 -04:00
Sebastian Falbesoner
dac7a111bd refactor: test: use _ variable for unused loop counters
substitutes "for x in range(N):" by "for _ in range(N):"
indicates to the reader that a block is just repeated N times, and
that the loop counter is not used in the body
2020-08-06 18:39:33 +02:00
MarcoFalke
fa488f131f
scripted-diff: Bump copyright headers
-BEGIN VERIFY SCRIPT-
./contrib/devtools/copyright_header.py update ./
-END VERIFY SCRIPT-
2020-04-16 13:33:09 -04:00
MarcoFalke
309b0c4c19
Merge #13693: [test] Add coverage to estimaterawfee and estimatesmartfee
111880aaf7 [test] Add coverage to estimaterawfee and estimatesmartfee (Ben Woosley)

Pull request description:

  This adds light functional coverage to estimaterawfee - a subset of
  the testing applied to estimatesmartfee, and argument validation
  testing to both estimaterawfee and estimatesmartfee.

  One valid estimatesmartfee signature test is commented out because it
  fails currently.

  Extracted from #12940

Top commit has no ACKs.

Tree-SHA512: 361a883457b28b2dc75081666e49d6dc6b5d76eed40d858abe2dd4f35ece152cf1f99c94480a91f42a896aa2a73cf55f57921316fe66970b2d7ba691a3b17e2d
2020-03-11 15:55:28 -04:00
MarcoFalke
fa45d60646
test: Reduce unneeded whitelist permissions in tests 2020-02-26 00:00:29 +07:00
Ben Woosley
111880aaf7
[test] Add coverage to estimaterawfee and estimatesmartfee
This adds light functional coverage to estimaterawfee - a subset of
the testing applied to estimatesmartfee, and argument validation
testing to both estimaterawfee and estimatesmartfee.

One valid estimatesmartfee signature test is commented out because it
fails currently.
2019-10-09 12:49:30 +01:00
MarcoFalke
fa76285fdd
test: Explain why -whitelist is used in feature_fee_estimation
Also, Remove seemingly unused and undocumented -maxorphantx=1000
2019-08-02 11:16:24 -04:00
MarcoFalke
faff85a69a
test: Format feature_fee_estimation with pep8 2019-08-02 11:08:07 -04:00
MarcoFalke
fa36aa4922
Test: Set -acceptnonstdtxn in feature_fee_estimation 2019-08-01 10:36:52 -04:00
MarcoFalke
fafe5f0d09
test: Remove unused imports 2019-04-09 12:10:35 -04:00
MarcoFalke
fa16a09215
scripted-diff: use self.sync_* methods
-BEGIN VERIFY SCRIPT-
sed -i -e 's/sync_blocks(self.nodes)/self.sync_blocks()/g'     $(git grep -l 'sync_blocks(self.nodes)'   ./test/functional/*.py)
sed -i -e 's/sync_mempools(self.nodes)/self.sync_mempools()/g' $(git grep -l 'sync_mempools(self.nodes)' ./test/functional/*.py)

sed -i -e 's/  sync_blocks(/  self.sync_blocks(/g'     $(git grep -l sync_blocks   ./test/functional/*.py)
sed -i -e 's/  sync_mempools(/  self.sync_mempools(/g' $(git grep -l sync_mempools ./test/functional/*.py)
-END VERIFY SCRIPT-
2019-04-09 12:09:53 -04:00
Karl-Johan Alm
6c0a6f73e3
wallet/rpc: add maxfeerate parameter to sendrawtransaction 2019-03-14 08:48:46 +09:00
John Newbery
3fd7e76f6d [tests] Move deterministic address import to setup_nodes
This requires a small changes to a few tests, but means that
deterministic addresses will always be imported (unless setup_nodes
behaviour is explicitly overridden).
2018-11-01 12:53:49 -04:00
MarcoFalke
fac9539836
qa: Run all tests even if wallet is not compiled 2018-09-10 17:53:21 -04:00
MarcoFalke
faa669cbcd
qa: Premine to deterministic address with -disablewallet 2018-09-10 17:51:46 -04:00
practicalswift
68400d8b96 tests: Use explicit imports 2018-08-13 14:13:39 +02:00
DrahtBot
eb7daf4d60 Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
Conor Scott
b466f6be95 [Tests] Use blockmaxweight where tests previously had blockmaxsize 2018-03-26 19:53:58 +04:00
John Newbery
4757c04cb9 [config] Remove blockmaxsize option
The blockmaxsize option was marked as deprecated in V0.15.1, and code
was added to convert provided blockmaxsize into blockmaxweight. However,
this code was incorrectly implemented, and blockmaxsize was silently
ignored.

No users have complained about blockmaxsize being ignored, so just
remove it in V0.17.
2018-03-22 10:28:56 -04:00
practicalswift
a004eb1dae tests: Remove unused argument max_invalid from check_estimates(...) 2018-03-21 10:38:11 +01:00
Andrew Chow
eefff65a4b scripted-diff: change signrawtransaction to signrawtransactionwithwallet in tests
-BEGIN VERIFY SCRIPT-
sed -i 's/\<signrawtransaction\>/signrawtransactionwithwallet/g' test/functional/*.py
sed -i 's/\<signrawtransaction\>/signrawtransactionwithwallet/g' test/functional/test_framework/*.py
-END VERIFY SCRIPT-
2018-02-17 11:42:01 -05:00
John Newbery
a5623b1615 [tests] Remove tests for deprecated estimatefee RPC 2018-02-02 10:56:49 -05:00
John Newbery
d119f2ec1a [tests] Fix style warnings in feature_fee_estimation.py 2018-02-02 10:08:37 -05:00
Anthony Towns
ca6523d0c8 [tests] Rename feature_* functional tests. 2018-01-25 09:44:29 +10:00