mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
Merge bitcoin/bitcoin#23474: test: scripted-diff cleanups after generate* changes
fac23c2114
scripted-diff: Bump copyright headers (MarcoFalke)fa974f1f14
scripted-diff: Remove redundant sync_all and sync_blocks (MarcoFalke)fad13991ae
test: Properly set sync_fun in NodeNetworkLimitedTest (MarcoFalke)faeff57709
test: Use 4 spaces for indentation (MarcoFalke) Pull request description: Some cleanups after commit94db963de5
ACKs for top commit: fanquake: ACKfac23c2114
Tree-SHA512: 5acfd5bb9679b41969d0fc6fc85801ccadcd6530ea692bac6352668e06fc7a9b0e1db3fd6fba435e84afe983d2eb07bd0a47c8364462bb7110004bd3d102b698
This commit is contained in:
commit
ffdab41f94
178 changed files with 179 additions and 340 deletions
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2017-2019 The Bitcoin Core developers
|
# Copyright (c) 2017-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Combine logs from multiple bitcoin nodes as well as the test_framework log.
|
"""Combine logs from multiple bitcoin nodes as well as the test_framework log.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2015-2020 The Bitcoin Core developers
|
# Copyright (c) 2015-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2017-2020 The Bitcoin Core developers
|
# Copyright (c) 2017-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""An example functional test
|
"""An example functional test
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2019-2020 The Bitcoin Core developers
|
# Copyright (c) 2019-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test bitcoind aborts if can't disconnect a block.
|
"""Test bitcoind aborts if can't disconnect a block.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2020 The Bitcoin Core developers
|
# Copyright (c) 2020-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test block-relay-only anchors functionality"""
|
"""Test block-relay-only anchors functionality"""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2020 The Bitcoin Core developers
|
# Copyright (c) 2020-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test asmap config argument for ASN-based IP bucketing.
|
"""Test asmap config argument for ASN-based IP bucketing.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2014-2020 The Bitcoin Core developers
|
# Copyright (c) 2014-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test logic for skipping signature validation on old blocks.
|
"""Test logic for skipping signature validation on old blocks.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2018-2020 The Bitcoin Core developers
|
# Copyright (c) 2018-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Backwards compatibility functional test
|
"""Backwards compatibility functional test
|
||||||
|
@ -66,8 +66,6 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
|
||||||
def run_test(self):
|
def run_test(self):
|
||||||
self.generatetoaddress(self.nodes[0], COINBASE_MATURITY + 1, self.nodes[0].getnewaddress())
|
self.generatetoaddress(self.nodes[0], COINBASE_MATURITY + 1, self.nodes[0].getnewaddress())
|
||||||
|
|
||||||
self.sync_blocks()
|
|
||||||
|
|
||||||
# Sanity check the test framework:
|
# Sanity check the test framework:
|
||||||
res = self.nodes[self.num_nodes - 1].getblockchaininfo()
|
res = self.nodes[self.num_nodes - 1].getblockchaininfo()
|
||||||
assert_equal(res['blocks'], COINBASE_MATURITY + 1)
|
assert_equal(res['blocks'], COINBASE_MATURITY + 1)
|
||||||
|
@ -93,7 +91,6 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
|
||||||
self.nodes[0].sendtoaddress(address, 10)
|
self.nodes[0].sendtoaddress(address, 10)
|
||||||
self.sync_mempools()
|
self.sync_mempools()
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(self.nodes[0], 1)
|
||||||
self.sync_blocks()
|
|
||||||
# Create a conflicting transaction using RBF
|
# Create a conflicting transaction using RBF
|
||||||
return_address = self.nodes[0].getnewaddress()
|
return_address = self.nodes[0].getnewaddress()
|
||||||
tx1_id = self.nodes[1].sendtoaddress(return_address, 1)
|
tx1_id = self.nodes[1].sendtoaddress(return_address, 1)
|
||||||
|
@ -101,7 +98,6 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
|
||||||
# Confirm the transaction
|
# Confirm the transaction
|
||||||
self.sync_mempools()
|
self.sync_mempools()
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(self.nodes[0], 1)
|
||||||
self.sync_blocks()
|
|
||||||
# Create another conflicting transaction using RBF
|
# Create another conflicting transaction using RBF
|
||||||
tx3_id = self.nodes[1].sendtoaddress(return_address, 1)
|
tx3_id = self.nodes[1].sendtoaddress(return_address, 1)
|
||||||
tx4_id = self.nodes[1].bumpfee(tx3_id)["txid"]
|
tx4_id = self.nodes[1].bumpfee(tx3_id)["txid"]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2014-2021 The Bitcoin Core developers
|
# Copyright (c) 2014-2020 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2014-2020 The Bitcoin Core developers
|
# Copyright (c) 2014-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test BIP68 implementation."""
|
"""Test BIP68 implementation."""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2015-2020 The Bitcoin Core developers
|
# Copyright (c) 2015-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test block processing."""
|
"""Test block processing."""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2020 The Bitcoin Core developers
|
# Copyright (c) 2020-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test blockfilterindex in conjunction with prune."""
|
"""Test blockfilterindex in conjunction with prune."""
|
||||||
|
@ -26,9 +26,7 @@ class FeatureBlockfilterindexPruneTest(BitcoinTestFramework):
|
||||||
assert_greater_than(len(self.nodes[0].getblockfilter(self.nodes[0].getbestblockhash())['filter']), 0)
|
assert_greater_than(len(self.nodes[0].getblockfilter(self.nodes[0].getbestblockhash())['filter']), 0)
|
||||||
# Mine two batches of blocks to avoid hitting NODE_NETWORK_LIMITED_MIN_BLOCKS disconnection
|
# Mine two batches of blocks to avoid hitting NODE_NETWORK_LIMITED_MIN_BLOCKS disconnection
|
||||||
self.generate(self.nodes[0], 250)
|
self.generate(self.nodes[0], 250)
|
||||||
self.sync_all()
|
|
||||||
self.generate(self.nodes[0], 250)
|
self.generate(self.nodes[0], 250)
|
||||||
self.sync_all()
|
|
||||||
self.sync_index(height=700)
|
self.sync_index(height=700)
|
||||||
|
|
||||||
self.log.info("prune some blocks")
|
self.log.info("prune some blocks")
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2018-2019 The Bitcoin Core developers
|
# Copyright (c) 2018-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test the blocksdir option.
|
"""Test the blocksdir option.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2015-2020 The Bitcoin Core developers
|
# Copyright (c) 2015-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test BIP65 (CHECKLOCKTIMEVERIFY).
|
"""Test BIP65 (CHECKLOCKTIMEVERIFY).
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2020 The Bitcoin Core developers
|
# Copyright (c) 2020-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test coinstatsindex across nodes.
|
"""Test coinstatsindex across nodes.
|
||||||
|
@ -72,8 +72,6 @@ class CoinStatsIndexTest(BitcoinTestFramework):
|
||||||
node.sendtoaddress(address=address, amount=10, subtractfeefromamount=True)
|
node.sendtoaddress(address=address, amount=10, subtractfeefromamount=True)
|
||||||
self.generate(node, 1)
|
self.generate(node, 1)
|
||||||
|
|
||||||
self.sync_blocks(timeout=120)
|
|
||||||
|
|
||||||
self.log.info("Test that gettxoutsetinfo() output is consistent with or without coinstatsindex option")
|
self.log.info("Test that gettxoutsetinfo() output is consistent with or without coinstatsindex option")
|
||||||
res0 = node.gettxoutsetinfo('none')
|
res0 = node.gettxoutsetinfo('none')
|
||||||
|
|
||||||
|
@ -170,7 +168,6 @@ class CoinStatsIndexTest(BitcoinTestFramework):
|
||||||
|
|
||||||
# Include both txs in a block
|
# Include both txs in a block
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(self.nodes[0], 1)
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
for hash_option in index_hash_options:
|
for hash_option in index_hash_options:
|
||||||
# Check all amounts were registered correctly
|
# Check all amounts were registered correctly
|
||||||
|
@ -271,7 +268,6 @@ class CoinStatsIndexTest(BitcoinTestFramework):
|
||||||
# Add another block, so we don't depend on reconsiderblock remembering which
|
# Add another block, so we don't depend on reconsiderblock remembering which
|
||||||
# blocks were touched by invalidateblock
|
# blocks were touched by invalidateblock
|
||||||
self.generate(index_node, 1)
|
self.generate(index_node, 1)
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
# Ensure that removing and re-adding blocks yields consistent results
|
# Ensure that removing and re-adding blocks yields consistent results
|
||||||
block = index_node.getblockhash(99)
|
block = index_node.getblockhash(99)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2017-2020 The Bitcoin Core developers
|
# Copyright (c) 2017-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test various command line arguments and configuration file parameters."""
|
"""Test various command line arguments and configuration file parameters."""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2015-2020 The Bitcoin Core developers
|
# Copyright (c) 2015-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test CSV soft fork activation.
|
"""Test CSV soft fork activation.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2017-2020 The Bitcoin Core developers
|
# Copyright (c) 2017-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test recovery from a crash during chainstate writing.
|
"""Test recovery from a crash during chainstate writing.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2015-2020 The Bitcoin Core developers
|
# Copyright (c) 2015-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test BIP66 (DER SIG).
|
"""Test BIP66 (DER SIG).
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2014-2020 The Bitcoin Core developers
|
# Copyright (c) 2014-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test fee estimation code."""
|
"""Test fee estimation code."""
|
||||||
|
@ -218,7 +218,6 @@ class EstimateFeeTest(BitcoinTestFramework):
|
||||||
self.fees_per_kb.append(float(fee) / tx_kbytes)
|
self.fees_per_kb.append(float(fee) / tx_kbytes)
|
||||||
self.sync_mempools(wait=.1)
|
self.sync_mempools(wait=.1)
|
||||||
mined = mining_node.getblock(self.generate(mining_node, 1)[0], True)["tx"]
|
mined = mining_node.getblock(self.generate(mining_node, 1)[0], True)["tx"]
|
||||||
self.sync_blocks(wait=.1)
|
|
||||||
# update which txouts are confirmed
|
# update which txouts are confirmed
|
||||||
newmem = []
|
newmem = []
|
||||||
for utx in self.memutxo:
|
for utx in self.memutxo:
|
||||||
|
@ -278,8 +277,6 @@ class EstimateFeeTest(BitcoinTestFramework):
|
||||||
# Finish by mining a normal-sized block:
|
# Finish by mining a normal-sized block:
|
||||||
while len(self.nodes[1].getrawmempool()) > 0:
|
while len(self.nodes[1].getrawmempool()) > 0:
|
||||||
self.generate(self.nodes[1], 1)
|
self.generate(self.nodes[1], 1)
|
||||||
|
|
||||||
self.sync_blocks(self.nodes[0:3], wait=.1)
|
|
||||||
self.log.info("Final estimates after emptying mempools")
|
self.log.info("Final estimates after emptying mempools")
|
||||||
check_estimates(self.nodes[1], self.fees_per_kb)
|
check_estimates(self.nodes[1], self.fees_per_kb)
|
||||||
|
|
||||||
|
@ -322,7 +319,6 @@ class EstimateFeeTest(BitcoinTestFramework):
|
||||||
for txid in txids_to_replace:
|
for txid in txids_to_replace:
|
||||||
miner.prioritisetransaction(txid=txid, fee_delta=-COIN)
|
miner.prioritisetransaction(txid=txid, fee_delta=-COIN)
|
||||||
self.generate(miner, 1)
|
self.generate(miner, 1)
|
||||||
self.sync_blocks(wait=.1, nodes=[node, miner])
|
|
||||||
# RBF the low-fee transactions
|
# RBF the low-fee transactions
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
|
@ -334,7 +330,6 @@ class EstimateFeeTest(BitcoinTestFramework):
|
||||||
# Mine the last replacement txs
|
# Mine the last replacement txs
|
||||||
self.sync_mempools(wait=.1, nodes=[node, miner])
|
self.sync_mempools(wait=.1, nodes=[node, miner])
|
||||||
self.generate(miner, 1)
|
self.generate(miner, 1)
|
||||||
self.sync_blocks(wait=.1, nodes=[node, miner])
|
|
||||||
|
|
||||||
# Only 10% of the transactions were really confirmed with a low feerate,
|
# Only 10% of the transactions were really confirmed with a low feerate,
|
||||||
# the rest needed to be RBF'd. We must return the 90% conf rate feerate.
|
# the rest needed to be RBF'd. We must return the 90% conf rate feerate.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2018-2020 The Bitcoin Core developers
|
# Copyright (c) 2018-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Check that it's not possible to start a second bitcoind instance using the same datadir or wallet."""
|
"""Check that it's not possible to start a second bitcoind instance using the same datadir or wallet."""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2018-2020 The Bitcoin Core developers
|
# Copyright (c) 2018-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Verify that starting bitcoin with -h works as expected."""
|
"""Verify that starting bitcoin with -h works as expected."""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2018-2019 The Bitcoin Core developers
|
# Copyright (c) 2018-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Tests the includeconf argument
|
"""Tests the includeconf argument
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2017-2020 The Bitcoin Core developers
|
# Copyright (c) 2017-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test loadblock option
|
"""Test loadblock option
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2017-2020 The Bitcoin Core developers
|
# Copyright (c) 2017-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test debug logging."""
|
"""Test debug logging."""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2015-2020 The Bitcoin Core developers
|
# Copyright (c) 2015-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test behavior of -maxuploadtarget.
|
"""Test behavior of -maxuploadtarget.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2017-2020 The Bitcoin Core developers
|
# Copyright (c) 2017-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test logic for setting nMinimumChainWork on command line.
|
"""Test logic for setting nMinimumChainWork on command line.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2014-2020 The Bitcoin Core developers
|
# Copyright (c) 2014-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test the -alertnotify, -blocknotify and -walletnotify options."""
|
"""Test the -alertnotify, -blocknotify and -walletnotify options."""
|
||||||
|
@ -112,7 +112,6 @@ class NotificationsTest(BitcoinTestFramework):
|
||||||
self.log.info("test -walletnotify with conflicting transactions")
|
self.log.info("test -walletnotify with conflicting transactions")
|
||||||
self.nodes[0].rescanblockchain()
|
self.nodes[0].rescanblockchain()
|
||||||
self.generatetoaddress(self.nodes[0], 100, ADDRESS_BCRT1_UNSPENDABLE)
|
self.generatetoaddress(self.nodes[0], 100, ADDRESS_BCRT1_UNSPENDABLE)
|
||||||
self.sync_blocks()
|
|
||||||
|
|
||||||
# Generate transaction on node 0, sync mempools, and check for
|
# Generate transaction on node 0, sync mempools, and check for
|
||||||
# notification on node 1.
|
# notification on node 1.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2016-2020 The Bitcoin Core developers
|
# Copyright (c) 2016-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test NULLDUMMY softfork.
|
"""Test NULLDUMMY softfork.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2017-2020 The Bitcoin Core developers
|
# Copyright (c) 2017-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test a pre-segwit node upgrading to segwit consensus"""
|
"""Test a pre-segwit node upgrading to segwit consensus"""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2015-2020 The Bitcoin Core developers
|
# Copyright (c) 2015-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test bitcoind with different proxy configuration.
|
"""Test bitcoind with different proxy configuration.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2014-2020 The Bitcoin Core developers
|
# Copyright (c) 2014-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test the pruning code.
|
"""Test the pruning code.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2014-2020 The Bitcoin Core developers
|
# Copyright (c) 2014-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test the RBF code."""
|
"""Test the RBF code."""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2014-2020 The Bitcoin Core developers
|
# Copyright (c) 2014-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test running bitcoind with -reindex and -reindex-chainstate options.
|
"""Test running bitcoind with -reindex and -reindex-chainstate options.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2016-2020 The Bitcoin Core developers
|
# Copyright (c) 2016-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test the SegWit changeover logic."""
|
"""Test the SegWit changeover logic."""
|
||||||
|
@ -191,7 +191,6 @@ class SegWitTest(BitcoinTestFramework):
|
||||||
p2sh_ids[n][v].append(send_to_witness(v, self.nodes[0], find_spendable_utxo(self.nodes[0], 50), self.pubkey[n], True, Decimal("49.999")))
|
p2sh_ids[n][v].append(send_to_witness(v, self.nodes[0], find_spendable_utxo(self.nodes[0], 50), self.pubkey[n], True, Decimal("49.999")))
|
||||||
|
|
||||||
self.generate(self.nodes[0], 1) # block 163
|
self.generate(self.nodes[0], 1) # block 163
|
||||||
self.sync_blocks()
|
|
||||||
|
|
||||||
# Make sure all nodes recognize the transactions as theirs
|
# Make sure all nodes recognize the transactions as theirs
|
||||||
assert_equal(self.nodes[0].getbalance(), balance_presetup - 60 * 50 + 20 * Decimal("49.999") + 50)
|
assert_equal(self.nodes[0].getbalance(), balance_presetup - 60 * 50 + 20 * Decimal("49.999") + 50)
|
||||||
|
@ -199,7 +198,6 @@ class SegWitTest(BitcoinTestFramework):
|
||||||
assert_equal(self.nodes[2].getbalance(), 20 * Decimal("49.999"))
|
assert_equal(self.nodes[2].getbalance(), 20 * Decimal("49.999"))
|
||||||
|
|
||||||
self.generate(self.nodes[0], 260) # block 423
|
self.generate(self.nodes[0], 260) # block 423
|
||||||
self.sync_blocks()
|
|
||||||
|
|
||||||
self.log.info("Verify witness txs are skipped for mining before the fork")
|
self.log.info("Verify witness txs are skipped for mining before the fork")
|
||||||
self.skip_mine(self.nodes[2], wit_ids[NODE_2][P2WPKH][0], True) # block 424
|
self.skip_mine(self.nodes[2], wit_ids[NODE_2][P2WPKH][0], True) # block 424
|
||||||
|
@ -216,7 +214,6 @@ class SegWitTest(BitcoinTestFramework):
|
||||||
self.log.info("Verify previous witness txs skipped for mining can now be mined")
|
self.log.info("Verify previous witness txs skipped for mining can now be mined")
|
||||||
assert_equal(len(self.nodes[2].getrawmempool()), 4)
|
assert_equal(len(self.nodes[2].getrawmempool()), 4)
|
||||||
blockhash = self.generate(self.nodes[2], 1)[0] # block 432 (first block with new rules; 432 = 144 * 3)
|
blockhash = self.generate(self.nodes[2], 1)[0] # block 432 (first block with new rules; 432 = 144 * 3)
|
||||||
self.sync_blocks()
|
|
||||||
assert_equal(len(self.nodes[2].getrawmempool()), 0)
|
assert_equal(len(self.nodes[2].getrawmempool()), 0)
|
||||||
segwit_tx_list = self.nodes[2].getblock(blockhash)["tx"]
|
segwit_tx_list = self.nodes[2].getblock(blockhash)["tx"]
|
||||||
assert_equal(len(segwit_tx_list), 5)
|
assert_equal(len(segwit_tx_list), 5)
|
||||||
|
@ -630,7 +627,6 @@ class SegWitTest(BitcoinTestFramework):
|
||||||
signresults = self.nodes[0].signrawtransactionwithwallet(tx.serialize_without_witness().hex())['hex']
|
signresults = self.nodes[0].signrawtransactionwithwallet(tx.serialize_without_witness().hex())['hex']
|
||||||
txid = self.nodes[0].sendrawtransaction(hexstring=signresults, maxfeerate=0)
|
txid = self.nodes[0].sendrawtransaction(hexstring=signresults, maxfeerate=0)
|
||||||
txs_mined[txid] = self.generate(self.nodes[0], 1)[0]
|
txs_mined[txid] = self.generate(self.nodes[0], 1)[0]
|
||||||
self.sync_blocks()
|
|
||||||
watchcount = 0
|
watchcount = 0
|
||||||
spendcount = 0
|
spendcount = 0
|
||||||
for i in self.nodes[0].listunspent():
|
for i in self.nodes[0].listunspent():
|
||||||
|
@ -680,7 +676,6 @@ class SegWitTest(BitcoinTestFramework):
|
||||||
signresults = self.nodes[0].signrawtransactionwithwallet(tx.serialize_without_witness().hex())['hex']
|
signresults = self.nodes[0].signrawtransactionwithwallet(tx.serialize_without_witness().hex())['hex']
|
||||||
self.nodes[0].sendrawtransaction(hexstring=signresults, maxfeerate=0)
|
self.nodes[0].sendrawtransaction(hexstring=signresults, maxfeerate=0)
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(self.nodes[0], 1)
|
||||||
self.sync_blocks()
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2017-2020 The Bitcoin Core developers
|
# Copyright (c) 2017-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test various command line arguments and configuration file parameters."""
|
"""Test various command line arguments and configuration file parameters."""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2019-2020 The Bitcoin Core developers
|
# Copyright (c) 2019-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test basic signet functionality"""
|
"""Test basic signet functionality"""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2019-2020 The Bitcoin Core developers
|
# Copyright (c) 2019-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
# Test Taproot softfork (BIPs 340-342)
|
# Test Taproot softfork (BIPs 340-342)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2016-2020 The Bitcoin Core developers
|
# Copyright (c) 2016-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test version bits warning system.
|
"""Test version bits warning system.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2017-2020 The Bitcoin Core developers
|
# Copyright (c) 2017-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test bitcoin-cli"""
|
"""Test bitcoin-cli"""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2014-2019 The Bitcoin Core developers
|
# Copyright (c) 2014-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test the RPC HTTP basics."""
|
"""Test the RPC HTTP basics."""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2014-2019 The Bitcoin Core developers
|
# Copyright (c) 2014-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test the REST API."""
|
"""Test the REST API."""
|
||||||
|
@ -81,9 +81,7 @@ class RESTTest (BitcoinTestFramework):
|
||||||
not_related_address = "2MxqoHEdNQTyYeX1mHcbrrpzgojbosTpCvJ"
|
not_related_address = "2MxqoHEdNQTyYeX1mHcbrrpzgojbosTpCvJ"
|
||||||
|
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(self.nodes[0], 1)
|
||||||
self.sync_all()
|
|
||||||
self.generatetoaddress(self.nodes[1], 100, not_related_address)
|
self.generatetoaddress(self.nodes[1], 100, not_related_address)
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
assert_equal(self.nodes[0].getbalance(), 50)
|
assert_equal(self.nodes[0].getbalance(), 50)
|
||||||
|
|
||||||
|
@ -108,7 +106,6 @@ class RESTTest (BitcoinTestFramework):
|
||||||
self.log.info("Query an unspent TXO using the /getutxos URI")
|
self.log.info("Query an unspent TXO using the /getutxos URI")
|
||||||
|
|
||||||
self.generatetoaddress(self.nodes[1], 1, not_related_address)
|
self.generatetoaddress(self.nodes[1], 1, not_related_address)
|
||||||
self.sync_all()
|
|
||||||
bb_hash = self.nodes[0].getbestblockhash()
|
bb_hash = self.nodes[0].getbestblockhash()
|
||||||
|
|
||||||
assert_equal(self.nodes[1].getbalance(), Decimal("0.1"))
|
assert_equal(self.nodes[1].getbalance(), Decimal("0.1"))
|
||||||
|
@ -183,7 +180,6 @@ class RESTTest (BitcoinTestFramework):
|
||||||
assert_equal(len(json_obj['utxos']), 0)
|
assert_equal(len(json_obj['utxos']), 0)
|
||||||
|
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(self.nodes[0], 1)
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
json_obj = self.test_rest_request(f"/getutxos/{spending[0]}-{spending[1]}")
|
json_obj = self.test_rest_request(f"/getutxos/{spending[0]}-{spending[1]}")
|
||||||
assert_equal(len(json_obj['utxos']), 1)
|
assert_equal(len(json_obj['utxos']), 1)
|
||||||
|
@ -204,7 +200,6 @@ class RESTTest (BitcoinTestFramework):
|
||||||
self.test_rest_request(f"/getutxos/checkmempool/{long_uri}", http_method='POST', status=200)
|
self.test_rest_request(f"/getutxos/checkmempool/{long_uri}", http_method='POST', status=200)
|
||||||
|
|
||||||
self.generate(self.nodes[0], 1) # generate block to not affect upcoming tests
|
self.generate(self.nodes[0], 1) # generate block to not affect upcoming tests
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
self.log.info("Test the /block, /blockhashbyheight and /headers URIs")
|
self.log.info("Test the /block, /blockhashbyheight and /headers URIs")
|
||||||
bb_hash = self.nodes[0].getbestblockhash()
|
bb_hash = self.nodes[0].getbestblockhash()
|
||||||
|
@ -275,7 +270,6 @@ class RESTTest (BitcoinTestFramework):
|
||||||
|
|
||||||
# See if we can get 5 headers in one response
|
# See if we can get 5 headers in one response
|
||||||
self.generate(self.nodes[1], 5)
|
self.generate(self.nodes[1], 5)
|
||||||
self.sync_all()
|
|
||||||
json_obj = self.test_rest_request(f"/headers/5/{bb_hash}")
|
json_obj = self.test_rest_request(f"/headers/5/{bb_hash}")
|
||||||
assert_equal(len(json_obj), 5) # now we should have 5 header objects
|
assert_equal(len(json_obj), 5) # now we should have 5 header objects
|
||||||
|
|
||||||
|
@ -310,7 +304,6 @@ class RESTTest (BitcoinTestFramework):
|
||||||
|
|
||||||
# Now mine the transactions
|
# Now mine the transactions
|
||||||
newblockhash = self.generate(self.nodes[1], 1)
|
newblockhash = self.generate(self.nodes[1], 1)
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
# Check if the 3 tx show up in the new block
|
# Check if the 3 tx show up in the new block
|
||||||
json_obj = self.test_rest_request(f"/block/{newblockhash[0]}")
|
json_obj = self.test_rest_request(f"/block/{newblockhash[0]}")
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2018-2020 The Bitcoin Core developers
|
# Copyright (c) 2018-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Tests some generic aspects of the RPC interface."""
|
"""Tests some generic aspects of the RPC interface."""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2015-2020 The Bitcoin Core developers
|
# Copyright (c) 2015-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test the ZMQ notification interface."""
|
"""Test the ZMQ notification interface."""
|
||||||
|
@ -190,8 +190,6 @@ class ZMQTest (BitcoinTestFramework):
|
||||||
self.log.info(f"Generate {num_blocks} blocks (and {num_blocks} coinbase txes)")
|
self.log.info(f"Generate {num_blocks} blocks (and {num_blocks} coinbase txes)")
|
||||||
genhashes = self.generatetoaddress(self.nodes[0], num_blocks, ADDRESS_BCRT1_UNSPENDABLE)
|
genhashes = self.generatetoaddress(self.nodes[0], num_blocks, ADDRESS_BCRT1_UNSPENDABLE)
|
||||||
|
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
for x in range(num_blocks):
|
for x in range(num_blocks):
|
||||||
# Should receive the coinbase txid.
|
# Should receive the coinbase txid.
|
||||||
txid = hashtx.receive()
|
txid = hashtx.receive()
|
||||||
|
@ -353,7 +351,6 @@ class ZMQTest (BitcoinTestFramework):
|
||||||
# removed from the mempool by the block mining it.
|
# removed from the mempool by the block mining it.
|
||||||
mempool_size = len(self.nodes[0].getrawmempool())
|
mempool_size = len(self.nodes[0].getrawmempool())
|
||||||
c_block = self.generatetoaddress(self.nodes[0], 1, ADDRESS_BCRT1_UNSPENDABLE)[0]
|
c_block = self.generatetoaddress(self.nodes[0], 1, ADDRESS_BCRT1_UNSPENDABLE)[0]
|
||||||
self.sync_all()
|
|
||||||
# Make sure the number of mined transactions matches the number of txs out of mempool
|
# Make sure the number of mined transactions matches the number of txs out of mempool
|
||||||
mempool_size_delta = mempool_size - len(self.nodes[0].getrawmempool())
|
mempool_size_delta = mempool_size - len(self.nodes[0].getrawmempool())
|
||||||
assert_equal(len(self.nodes[0].getblock(c_block)["tx"])-1, mempool_size_delta)
|
assert_equal(len(self.nodes[0].getblock(c_block)["tx"])-1, mempool_size_delta)
|
||||||
|
@ -393,7 +390,6 @@ class ZMQTest (BitcoinTestFramework):
|
||||||
# Other things may happen but aren't wallet-deterministic so we don't test for them currently
|
# Other things may happen but aren't wallet-deterministic so we don't test for them currently
|
||||||
self.nodes[0].reconsiderblock(best_hash)
|
self.nodes[0].reconsiderblock(best_hash)
|
||||||
self.generatetoaddress(self.nodes[1], 1, ADDRESS_BCRT1_UNSPENDABLE)
|
self.generatetoaddress(self.nodes[1], 1, ADDRESS_BCRT1_UNSPENDABLE)
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
self.log.info("Evict mempool transaction by block conflict")
|
self.log.info("Evict mempool transaction by block conflict")
|
||||||
orig_txid = self.nodes[0].sendtoaddress(address=self.nodes[0].getnewaddress(), amount=1.0, replaceable=True)
|
orig_txid = self.nodes[0].sendtoaddress(address=self.nodes[0].getnewaddress(), amount=1.0, replaceable=True)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2017-2020 The Bitcoin Core developers
|
# Copyright (c) 2017-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test mempool acceptance of raw transactions."""
|
"""Test mempool acceptance of raw transactions."""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2017-2020 The Bitcoin Core developers
|
# Copyright (c) 2017-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test that mempool.dat is both backward and forward compatible between versions
|
"""Test that mempool.dat is both backward and forward compatible between versions
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2020 The Bitcoin Core developers
|
# Copyright (c) 2020-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Tests that a mempool transaction expires after a given timeout and that its
|
"""Tests that a mempool transaction expires after a given timeout and that its
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2014-2019 The Bitcoin Core developers
|
# Copyright (c) 2014-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test mempool limiting together/eviction with the wallet."""
|
"""Test mempool limiting together/eviction with the wallet."""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2014-2020 The Bitcoin Core developers
|
# Copyright (c) 2014-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test descendant package tracking carve-out allowing one final transaction in
|
"""Test descendant package tracking carve-out allowing one final transaction in
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2014-2020 The Bitcoin Core developers
|
# Copyright (c) 2014-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test descendant package tracking code."""
|
"""Test descendant package tracking code."""
|
||||||
|
@ -192,7 +192,6 @@ class MempoolPackagesTest(BitcoinTestFramework):
|
||||||
# Check that prioritising a tx before it's added to the mempool works
|
# Check that prioritising a tx before it's added to the mempool works
|
||||||
# First clear the mempool by mining a block.
|
# First clear the mempool by mining a block.
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(self.nodes[0], 1)
|
||||||
self.sync_blocks()
|
|
||||||
assert_equal(len(self.nodes[0].getrawmempool()), 0)
|
assert_equal(len(self.nodes[0].getrawmempool()), 0)
|
||||||
# Prioritise a transaction that has been mined, then add it back to the
|
# Prioritise a transaction that has been mined, then add it back to the
|
||||||
# mempool by using invalidateblock.
|
# mempool by using invalidateblock.
|
||||||
|
@ -283,7 +282,6 @@ class MempoolPackagesTest(BitcoinTestFramework):
|
||||||
# Test reorg handling
|
# Test reorg handling
|
||||||
# First, the basics:
|
# First, the basics:
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(self.nodes[0], 1)
|
||||||
self.sync_blocks()
|
|
||||||
self.nodes[1].invalidateblock(self.nodes[0].getbestblockhash())
|
self.nodes[1].invalidateblock(self.nodes[0].getbestblockhash())
|
||||||
self.nodes[1].reconsiderblock(self.nodes[0].getbestblockhash())
|
self.nodes[1].reconsiderblock(self.nodes[0].getbestblockhash())
|
||||||
|
|
||||||
|
@ -330,7 +328,6 @@ class MempoolPackagesTest(BitcoinTestFramework):
|
||||||
|
|
||||||
# Mine these in a block
|
# Mine these in a block
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(self.nodes[0], 1)
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
# Now generate tx8, with a big fee
|
# Now generate tx8, with a big fee
|
||||||
inputs = [ {'txid' : tx1_id, 'vout': 0}, {'txid' : txid, 'vout': 0} ]
|
inputs = [ {'txid' : tx1_id, 'vout': 0}, {'txid' : txid, 'vout': 0} ]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2014-2020 The Bitcoin Core developers
|
# Copyright (c) 2014-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test mempool persistence.
|
"""Test mempool persistence.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2014-2020 The Bitcoin Core developers
|
# Copyright (c) 2014-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test mempool re-org scenarios.
|
"""Test mempool re-org scenarios.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2014-2020 The Bitcoin Core developers
|
# Copyright (c) 2014-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test resurrection of mined transactions when the blockchain is re-organized."""
|
"""Test resurrection of mined transactions when the blockchain is re-organized."""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2014-2020 The Bitcoin Core developers
|
# Copyright (c) 2014-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test spending coinbase transactions.
|
"""Test spending coinbase transactions.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2017-2020 The Bitcoin Core developers
|
# Copyright (c) 2017-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test that the mempool ensures transaction delivery by periodically sending
|
"""Test that the mempool ensures transaction delivery by periodically sending
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2020 The Bitcoin Core developers
|
# Copyright (c) 2020-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test mempool descendants/ancestors information update.
|
"""Test mempool descendants/ancestors information update.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2014-2020 The Bitcoin Core developers
|
# Copyright (c) 2014-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test mining RPCs
|
"""Test mining RPCs
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2014-2020 The Bitcoin Core developers
|
# Copyright (c) 2014-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test longpolling with getblocktemplate."""
|
"""Test longpolling with getblocktemplate."""
|
||||||
|
@ -64,7 +64,6 @@ class GetBlockTemplateLPTest(BitcoinTestFramework):
|
||||||
|
|
||||||
# Add enough mature utxos to the wallets, so that all txs spend confirmed coins
|
# Add enough mature utxos to the wallets, so that all txs spend confirmed coins
|
||||||
self.generate(self.nodes[0], COINBASE_MATURITY)
|
self.generate(self.nodes[0], COINBASE_MATURITY)
|
||||||
self.sync_blocks()
|
|
||||||
|
|
||||||
self.log.info("Test that introducing a new transaction into the mempool will terminate the longpoll")
|
self.log.info("Test that introducing a new transaction into the mempool will terminate the longpoll")
|
||||||
thr = LongpollThread(self.nodes[0])
|
thr = LongpollThread(self.nodes[0])
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2015-2019 The Bitcoin Core developers
|
# Copyright (c) 2015-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test the prioritisetransaction mining RPC."""
|
"""Test the prioritisetransaction mining RPC."""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2018 The Bitcoin Core developers
|
# Copyright (c) 2018-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ def perform_pre_checks():
|
||||||
sys.exit(int(mock_result[0]))
|
sys.exit(int(mock_result[0]))
|
||||||
|
|
||||||
def enumerate(args):
|
def enumerate(args):
|
||||||
sys.stdout.write(json.dumps([{"fingerprint": "00000001", "type": "trezor", "model": "trezor_t"}, {"fingerprint": "00000002"}]))
|
sys.stdout.write(json.dumps([{"fingerprint": "00000001", "type": "trezor", "model": "trezor_t"}, {"fingerprint": "00000002"}]))
|
||||||
|
|
||||||
def getdescriptors(args):
|
def getdescriptors(args):
|
||||||
xpub = "tpubD6NzVbkrYhZ4WaWSyoBvQwbpLkojyoTZPRsgXELWz3Popb3qkjcJyJUGLnL4qHHoQvao8ESaAstxYSnhyswJ76uZPStJRJCTKvosUCJZL5B"
|
xpub = "tpubD6NzVbkrYhZ4WaWSyoBvQwbpLkojyoTZPRsgXELWz3Popb3qkjcJyJUGLnL4qHHoQvao8ESaAstxYSnhyswJ76uZPStJRJCTKvosUCJZL5B"
|
||||||
|
@ -93,7 +93,7 @@ parser_signtx.set_defaults(func=signtx)
|
||||||
if not sys.stdin.isatty():
|
if not sys.stdin.isatty():
|
||||||
buffer = sys.stdin.read()
|
buffer = sys.stdin.read()
|
||||||
if buffer and buffer.rstrip() != "":
|
if buffer and buffer.rstrip() != "":
|
||||||
sys.argv.extend(buffer.rstrip().split(" "))
|
sys.argv.extend(buffer.rstrip().split(" "))
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2020 The Bitcoin Core developers
|
# Copyright (c) 2020-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2020 The Bitcoin Core developers
|
# Copyright (c) 2020-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2019-2020 The Bitcoin Core developers
|
# Copyright (c) 2019-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Tests NODE_COMPACT_FILTERS (BIP 157/158).
|
"""Tests NODE_COMPACT_FILTERS (BIP 157/158).
|
||||||
|
@ -57,7 +57,6 @@ class CompactFiltersTest(BitcoinTestFramework):
|
||||||
|
|
||||||
# Nodes 0 & 1 share the same first 999 blocks in the chain.
|
# Nodes 0 & 1 share the same first 999 blocks in the chain.
|
||||||
self.generate(self.nodes[0], 999)
|
self.generate(self.nodes[0], 999)
|
||||||
self.sync_blocks(timeout=600)
|
|
||||||
|
|
||||||
# Stale blocks by disconnecting nodes 0 & 1, mining, then reconnecting
|
# Stale blocks by disconnecting nodes 0 & 1, mining, then reconnecting
|
||||||
self.disconnect_nodes(0, 1)
|
self.disconnect_nodes(0, 1)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2019-2020 The Bitcoin Core developers
|
# Copyright (c) 2019-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test p2p blocksonly mode & block-relay-only connections."""
|
"""Test p2p blocksonly mode & block-relay-only connections."""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2016-2020 The Bitcoin Core developers
|
# Copyright (c) 2016-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test compact blocks (BIP 152).
|
"""Test compact blocks (BIP 152).
|
||||||
|
|
|
@ -31,7 +31,6 @@ class CompactBlocksConnectionTest(BitcoinTestFramework):
|
||||||
"""Relay a new block through peer peer, and return HB status between 1 and [2,3,4,5]."""
|
"""Relay a new block through peer peer, and return HB status between 1 and [2,3,4,5]."""
|
||||||
self.connect_nodes(peer, 0)
|
self.connect_nodes(peer, 0)
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(self.nodes[0], 1)
|
||||||
self.sync_blocks()
|
|
||||||
self.disconnect_nodes(peer, 0)
|
self.disconnect_nodes(peer, 0)
|
||||||
status_to = [self.peer_info(1, i)['bip152_hb_to'] for i in range(2, 6)]
|
status_to = [self.peer_info(1, i)['bip152_hb_to'] for i in range(2, 6)]
|
||||||
status_from = [self.peer_info(i, 1)['bip152_hb_from'] for i in range(2, 6)]
|
status_from = [self.peer_info(i, 1)['bip152_hb_from'] for i in range(2, 6)]
|
||||||
|
@ -45,7 +44,6 @@ class CompactBlocksConnectionTest(BitcoinTestFramework):
|
||||||
for i in range(1, 6):
|
for i in range(1, 6):
|
||||||
self.connect_nodes(i, 0)
|
self.connect_nodes(i, 0)
|
||||||
self.generate(self.nodes[0], 2)
|
self.generate(self.nodes[0], 2)
|
||||||
self.sync_blocks()
|
|
||||||
for i in range(1, 6):
|
for i in range(1, 6):
|
||||||
self.disconnect_nodes(i, 0)
|
self.disconnect_nodes(i, 0)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2019-2020 The Bitcoin Core developers
|
# Copyright (c) 2019-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test that we reject low difficulty headers to prevent our block tree from filling up with useless bloat"""
|
"""Test that we reject low difficulty headers to prevent our block tree from filling up with useless bloat"""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2019-2020 The Bitcoin Core developers
|
# Copyright (c) 2019-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2016-2020 The Bitcoin Core developers
|
# Copyright (c) 2016-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test processing of feefilter messages."""
|
"""Test processing of feefilter messages."""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2020 The Bitcoin Core developers
|
# Copyright (c) 2020-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2017-2020 The Bitcoin Core developers
|
# Copyright (c) 2017-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test various fingerprinting protections.
|
"""Test various fingerprinting protections.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2020 The Bitcoin Core developers
|
# Copyright (c) 2020-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test fee filters during and after IBD."""
|
"""Test fee filters during and after IBD."""
|
||||||
|
@ -30,7 +30,6 @@ class P2PIBDTxRelayTest(BitcoinTestFramework):
|
||||||
|
|
||||||
# Come out of IBD by generating a block
|
# Come out of IBD by generating a block
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(self.nodes[0], 1)
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
self.log.info("Check that nodes reset minfilter after coming out of IBD")
|
self.log.info("Check that nodes reset minfilter after coming out of IBD")
|
||||||
for node in self.nodes:
|
for node in self.nodes:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2015-2020 The Bitcoin Core developers
|
# Copyright (c) 2015-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test node responses to invalid blocks.
|
"""Test node responses to invalid blocks.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2015-2020 The Bitcoin Core developers
|
# Copyright (c) 2015-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test node responses to invalid locators.
|
"""Test node responses to invalid locators.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2015-2020 The Bitcoin Core developers
|
# Copyright (c) 2015-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test node responses to invalid network messages."""
|
"""Test node responses to invalid network messages."""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2015-2020 The Bitcoin Core developers
|
# Copyright (c) 2015-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test node responses to invalid transactions.
|
"""Test node responses to invalid transactions.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2017-2020 The Bitcoin Core developers
|
# Copyright (c) 2017-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test message sending before handshake completion.
|
"""Test message sending before handshake completion.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2017-2020 The Bitcoin Core developers
|
# Copyright (c) 2017-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test that we don't leak txs to inbound peers that we haven't yet announced to"""
|
"""Test that we don't leak txs to inbound peers that we haven't yet announced to"""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2020 The Bitcoin Core developers
|
# Copyright (c) 2020-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test per-peer message capture capability.
|
"""Test per-peer message capture capability.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2017-2020 The Bitcoin Core developers
|
# Copyright (c) 2017-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Tests NODE_NETWORK_LIMITED.
|
"""Tests NODE_NETWORK_LIMITED.
|
||||||
|
@ -59,8 +59,7 @@ class NodeNetworkLimitedTest(BitcoinTestFramework):
|
||||||
|
|
||||||
self.log.info("Mine enough blocks to reach the NODE_NETWORK_LIMITED range.")
|
self.log.info("Mine enough blocks to reach the NODE_NETWORK_LIMITED range.")
|
||||||
self.connect_nodes(0, 1)
|
self.connect_nodes(0, 1)
|
||||||
blocks = self.generate(self.nodes[1], 292, sync_fun=self.no_op)
|
blocks = self.generate(self.nodes[1], 292, sync_fun=lambda: self.sync_blocks([self.nodes[0], self.nodes[1]]))
|
||||||
self.sync_blocks([self.nodes[0], self.nodes[1]])
|
|
||||||
|
|
||||||
self.log.info("Make sure we can max retrieve block at tip-288.")
|
self.log.info("Make sure we can max retrieve block at tip-288.")
|
||||||
node.send_getdata_for_block(blocks[1]) # last block in valid range
|
node.send_getdata_for_block(blocks[1]) # last block in valid range
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2015-2020 The Bitcoin Core developers
|
# Copyright (c) 2015-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test p2p permission message.
|
"""Test p2p permission message.
|
||||||
|
@ -94,7 +94,6 @@ class P2PPermissionsTests(BitcoinTestFramework):
|
||||||
|
|
||||||
def check_tx_relay(self):
|
def check_tx_relay(self):
|
||||||
block_op_true = self.nodes[0].getblock(self.generatetoaddress(self.nodes[0], 100, ADDRESS_BCRT1_P2WSH_OP_TRUE)[0])
|
block_op_true = self.nodes[0].getblock(self.generatetoaddress(self.nodes[0], 100, ADDRESS_BCRT1_P2WSH_OP_TRUE)[0])
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
self.log.debug("Create a connection from a forcerelay peer that rebroadcasts raw txs")
|
self.log.debug("Create a connection from a forcerelay peer that rebroadcasts raw txs")
|
||||||
# A test framework p2p connection is needed to send the raw transaction directly. If a full node was used, it could only
|
# A test framework p2p connection is needed to send the raw transaction directly. If a full node was used, it could only
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2020 The Bitcoin Core developers
|
# Copyright (c) 2020-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test ping message
|
"""Test ping message
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2016-2020 The Bitcoin Core developers
|
# Copyright (c) 2016-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test segwit transactions and blocks on P2P network."""
|
"""Test segwit transactions and blocks on P2P network."""
|
||||||
|
@ -580,7 +580,6 @@ class SegWitTest(BitcoinTestFramework):
|
||||||
# Mine it on test_node to create the confirmed output.
|
# Mine it on test_node to create the confirmed output.
|
||||||
test_transaction_acceptance(self.nodes[0], self.test_node, p2sh_tx, with_witness=True, accepted=True)
|
test_transaction_acceptance(self.nodes[0], self.test_node, p2sh_tx, with_witness=True, accepted=True)
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(self.nodes[0], 1)
|
||||||
self.sync_blocks()
|
|
||||||
|
|
||||||
# Now test standardness of v0 P2WSH outputs.
|
# Now test standardness of v0 P2WSH outputs.
|
||||||
# Start by creating a transaction with two outputs.
|
# Start by creating a transaction with two outputs.
|
||||||
|
@ -653,7 +652,6 @@ class SegWitTest(BitcoinTestFramework):
|
||||||
test_transaction_acceptance(self.nodes[0], self.test_node, tx3, with_witness=True, accepted=True)
|
test_transaction_acceptance(self.nodes[0], self.test_node, tx3, with_witness=True, accepted=True)
|
||||||
|
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(self.nodes[0], 1)
|
||||||
self.sync_blocks()
|
|
||||||
self.utxo.pop(0)
|
self.utxo.pop(0)
|
||||||
self.utxo.append(UTXO(tx3.sha256, 0, tx3.vout[0].nValue))
|
self.utxo.append(UTXO(tx3.sha256, 0, tx3.vout[0].nValue))
|
||||||
assert_equal(len(self.nodes[1].getrawmempool()), 0)
|
assert_equal(len(self.nodes[1].getrawmempool()), 0)
|
||||||
|
@ -1354,7 +1352,6 @@ class SegWitTest(BitcoinTestFramework):
|
||||||
temp_utxo.append(UTXO(tx.sha256, 0, tx.vout[0].nValue))
|
temp_utxo.append(UTXO(tx.sha256, 0, tx.vout[0].nValue))
|
||||||
|
|
||||||
self.generate(self.nodes[0], 1) # Mine all the transactions
|
self.generate(self.nodes[0], 1) # Mine all the transactions
|
||||||
self.sync_blocks()
|
|
||||||
assert len(self.nodes[0].getrawmempool()) == 0
|
assert len(self.nodes[0].getrawmempool()) == 0
|
||||||
|
|
||||||
# Finally, verify that version 0 -> version 2 transactions
|
# Finally, verify that version 0 -> version 2 transactions
|
||||||
|
@ -1425,7 +1422,6 @@ class SegWitTest(BitcoinTestFramework):
|
||||||
|
|
||||||
# Now test a premature spend.
|
# Now test a premature spend.
|
||||||
self.generate(self.nodes[0], 98)
|
self.generate(self.nodes[0], 98)
|
||||||
self.sync_blocks()
|
|
||||||
block2 = self.build_next_block()
|
block2 = self.build_next_block()
|
||||||
self.update_witness_block_with_transactions(block2, [spend_tx])
|
self.update_witness_block_with_transactions(block2, [spend_tx])
|
||||||
test_witness_block(self.nodes[0], self.test_node, block2, accepted=False, reason='bad-txns-premature-spend-of-coinbase')
|
test_witness_block(self.nodes[0], self.test_node, block2, accepted=False, reason='bad-txns-premature-spend-of-coinbase')
|
||||||
|
@ -1744,7 +1740,6 @@ class SegWitTest(BitcoinTestFramework):
|
||||||
tx.rehash()
|
tx.rehash()
|
||||||
test_transaction_acceptance(self.nodes[0], self.test_node, tx, False, True)
|
test_transaction_acceptance(self.nodes[0], self.test_node, tx, False, True)
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(self.nodes[0], 1)
|
||||||
self.sync_blocks()
|
|
||||||
|
|
||||||
# We'll add an unnecessary witness to this transaction that would cause
|
# We'll add an unnecessary witness to this transaction that would cause
|
||||||
# it to be non-standard, to test that violating policy with a witness
|
# it to be non-standard, to test that violating policy with a witness
|
||||||
|
@ -1773,7 +1768,6 @@ class SegWitTest(BitcoinTestFramework):
|
||||||
test_transaction_acceptance(self.nodes[0], self.test_node, tx3, False, True)
|
test_transaction_acceptance(self.nodes[0], self.test_node, tx3, False, True)
|
||||||
|
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(self.nodes[0], 1)
|
||||||
self.sync_blocks()
|
|
||||||
|
|
||||||
# Update our utxo list; we spent the first entry.
|
# Update our utxo list; we spent the first entry.
|
||||||
self.utxo.pop(0)
|
self.utxo.pop(0)
|
||||||
|
@ -1808,7 +1802,6 @@ class SegWitTest(BitcoinTestFramework):
|
||||||
test_transaction_acceptance(self.nodes[0], self.test_node, tx, with_witness=False, accepted=True)
|
test_transaction_acceptance(self.nodes[0], self.test_node, tx, with_witness=False, accepted=True)
|
||||||
|
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(self.nodes[0], 1)
|
||||||
self.sync_blocks()
|
|
||||||
|
|
||||||
# Creating transactions for tests
|
# Creating transactions for tests
|
||||||
p2wsh_txs = []
|
p2wsh_txs = []
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2014-2020 The Bitcoin Core developers
|
# Copyright (c) 2014-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test behavior of headers messages to announce blocks.
|
"""Test behavior of headers messages to announce blocks.
|
||||||
|
@ -217,7 +217,6 @@ class SendHeadersTest(BitcoinTestFramework):
|
||||||
|
|
||||||
# make sure all invalidated blocks are node0's
|
# make sure all invalidated blocks are node0's
|
||||||
self.generatetoaddress(self.nodes[0], length, self.nodes[0].get_deterministic_priv_key().address)
|
self.generatetoaddress(self.nodes[0], length, self.nodes[0].get_deterministic_priv_key().address)
|
||||||
self.sync_blocks(self.nodes, wait=0.1)
|
|
||||||
for x in self.nodes[0].p2ps:
|
for x in self.nodes[0].p2ps:
|
||||||
x.wait_for_block_announcement(int(self.nodes[0].getbestblockhash(), 16))
|
x.wait_for_block_announcement(int(self.nodes[0].getbestblockhash(), 16))
|
||||||
x.clear_block_announcements()
|
x.clear_block_announcements()
|
||||||
|
@ -226,7 +225,6 @@ class SendHeadersTest(BitcoinTestFramework):
|
||||||
hash_to_invalidate = self.nodes[1].getblockhash(tip_height - (length - 1))
|
hash_to_invalidate = self.nodes[1].getblockhash(tip_height - (length - 1))
|
||||||
self.nodes[1].invalidateblock(hash_to_invalidate)
|
self.nodes[1].invalidateblock(hash_to_invalidate)
|
||||||
all_hashes = self.generatetoaddress(self.nodes[1], length + 1, self.nodes[1].get_deterministic_priv_key().address) # Must be longer than the orig chain
|
all_hashes = self.generatetoaddress(self.nodes[1], length + 1, self.nodes[1].get_deterministic_priv_key().address) # Must be longer than the orig chain
|
||||||
self.sync_blocks(self.nodes, wait=0.1)
|
|
||||||
return [int(x, 16) for x in all_hashes]
|
return [int(x, 16) for x in all_hashes]
|
||||||
|
|
||||||
def run_test(self):
|
def run_test(self):
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2019-2020 The Bitcoin Core developers
|
# Copyright (c) 2019-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2015-2020 The Bitcoin Core developers
|
# Copyright (c) 2015-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test processing of unrequested blocks.
|
"""Test processing of unrequested blocks.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2014-2020 The Bitcoin Core developers
|
# Copyright (c) 2014-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test RPCs related to blockchainstate.
|
"""Test RPCs related to blockchainstate.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2015-2020 The Bitcoin Core developers
|
# Copyright (c) 2015-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test multisig RPCs"""
|
"""Test multisig RPCs"""
|
||||||
|
@ -46,7 +46,6 @@ class RpcCreateMultiSigTest(BitcoinTestFramework):
|
||||||
|
|
||||||
self.log.info('Generating blocks ...')
|
self.log.info('Generating blocks ...')
|
||||||
self.generate(node0, 149)
|
self.generate(node0, 149)
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
self.moved = 0
|
self.moved = 0
|
||||||
for self.nkeys in [3, 5]:
|
for self.nkeys in [3, 5]:
|
||||||
|
@ -117,7 +116,6 @@ class RpcCreateMultiSigTest(BitcoinTestFramework):
|
||||||
def checkbalances(self):
|
def checkbalances(self):
|
||||||
node0, node1, node2 = self.nodes
|
node0, node1, node2 = self.nodes
|
||||||
self.generate(node0, COINBASE_MATURITY)
|
self.generate(node0, COINBASE_MATURITY)
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
bal0 = node0.getbalance()
|
bal0 = node0.getbalance()
|
||||||
bal1 = node1.getbalance()
|
bal1 = node1.getbalance()
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2015-2019 The Bitcoin Core developers
|
# Copyright (c) 2015-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test decoding scripts via decodescript RPC command."""
|
"""Test decoding scripts via decodescript RPC command."""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2017-2020 The Bitcoin Core developers
|
# Copyright (c) 2017-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test deprecation of RPC calls."""
|
"""Test deprecation of RPC calls."""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2019-2020 The Bitcoin Core developers
|
# Copyright (c) 2019-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test the generation of UTXO snapshots using `dumptxoutset`.
|
"""Test the generation of UTXO snapshots using `dumptxoutset`.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2014-2020 The Bitcoin Core developers
|
# Copyright (c) 2014-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test the fundrawtransaction RPC."""
|
"""Test the fundrawtransaction RPC."""
|
||||||
|
@ -99,9 +99,7 @@ class RawTransactionsTest(BitcoinTestFramework):
|
||||||
self.fee_tolerance = 2 * self.min_relay_tx_fee / 1000
|
self.fee_tolerance = 2 * self.min_relay_tx_fee / 1000
|
||||||
|
|
||||||
self.generate(self.nodes[2], 1)
|
self.generate(self.nodes[2], 1)
|
||||||
self.sync_all()
|
|
||||||
self.generate(self.nodes[0], 121)
|
self.generate(self.nodes[0], 121)
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
self.test_change_position()
|
self.test_change_position()
|
||||||
self.test_simple()
|
self.test_simple()
|
||||||
|
@ -164,7 +162,6 @@ class RawTransactionsTest(BitcoinTestFramework):
|
||||||
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 5.0)
|
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 5.0)
|
||||||
|
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(self.nodes[0], 1)
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
wwatch.unloadwallet()
|
wwatch.unloadwallet()
|
||||||
|
|
||||||
|
@ -550,7 +547,6 @@ class RawTransactionsTest(BitcoinTestFramework):
|
||||||
# Send 1.2 BTC to msig addr.
|
# Send 1.2 BTC to msig addr.
|
||||||
self.nodes[0].sendtoaddress(mSigObj, 1.2)
|
self.nodes[0].sendtoaddress(mSigObj, 1.2)
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(self.nodes[0], 1)
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
oldBalance = self.nodes[1].getbalance()
|
oldBalance = self.nodes[1].getbalance()
|
||||||
inputs = []
|
inputs = []
|
||||||
|
@ -561,7 +557,6 @@ class RawTransactionsTest(BitcoinTestFramework):
|
||||||
final_psbt = w2.finalizepsbt(signed_psbt['psbt'])
|
final_psbt = w2.finalizepsbt(signed_psbt['psbt'])
|
||||||
self.nodes[2].sendrawtransaction(final_psbt['hex'])
|
self.nodes[2].sendrawtransaction(final_psbt['hex'])
|
||||||
self.generate(self.nodes[2], 1)
|
self.generate(self.nodes[2], 1)
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
# Make sure funds are received at node1.
|
# Make sure funds are received at node1.
|
||||||
assert_equal(oldBalance+Decimal('1.10000000'), self.nodes[1].getbalance())
|
assert_equal(oldBalance+Decimal('1.10000000'), self.nodes[1].getbalance())
|
||||||
|
@ -625,7 +620,6 @@ class RawTransactionsTest(BitcoinTestFramework):
|
||||||
signedTx = self.nodes[1].signrawtransactionwithwallet(fundedTx['hex'])
|
signedTx = self.nodes[1].signrawtransactionwithwallet(fundedTx['hex'])
|
||||||
self.nodes[1].sendrawtransaction(signedTx['hex'])
|
self.nodes[1].sendrawtransaction(signedTx['hex'])
|
||||||
self.generate(self.nodes[1], 1)
|
self.generate(self.nodes[1], 1)
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
# Make sure funds are received at node1.
|
# Make sure funds are received at node1.
|
||||||
assert_equal(oldBalance+Decimal('51.10000000'), self.nodes[0].getbalance())
|
assert_equal(oldBalance+Decimal('51.10000000'), self.nodes[0].getbalance())
|
||||||
|
@ -637,12 +631,10 @@ class RawTransactionsTest(BitcoinTestFramework):
|
||||||
# Empty node1, send some small coins from node0 to node1.
|
# Empty node1, send some small coins from node0 to node1.
|
||||||
self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), self.nodes[1].getbalance(), "", "", True)
|
self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), self.nodes[1].getbalance(), "", "", True)
|
||||||
self.generate(self.nodes[1], 1)
|
self.generate(self.nodes[1], 1)
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
for _ in range(20):
|
for _ in range(20):
|
||||||
self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 0.01)
|
self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 0.01)
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(self.nodes[0], 1)
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
# Fund a tx with ~20 small inputs.
|
# Fund a tx with ~20 small inputs.
|
||||||
inputs = []
|
inputs = []
|
||||||
|
@ -665,12 +657,10 @@ class RawTransactionsTest(BitcoinTestFramework):
|
||||||
# Again, empty node1, send some small coins from node0 to node1.
|
# Again, empty node1, send some small coins from node0 to node1.
|
||||||
self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), self.nodes[1].getbalance(), "", "", True)
|
self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), self.nodes[1].getbalance(), "", "", True)
|
||||||
self.generate(self.nodes[1], 1)
|
self.generate(self.nodes[1], 1)
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
for _ in range(20):
|
for _ in range(20):
|
||||||
self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 0.01)
|
self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 0.01)
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(self.nodes[0], 1)
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
# Fund a tx with ~20 small inputs.
|
# Fund a tx with ~20 small inputs.
|
||||||
oldBalance = self.nodes[0].getbalance()
|
oldBalance = self.nodes[0].getbalance()
|
||||||
|
@ -682,7 +672,6 @@ class RawTransactionsTest(BitcoinTestFramework):
|
||||||
fundedAndSignedTx = self.nodes[1].signrawtransactionwithwallet(fundedTx['hex'])
|
fundedAndSignedTx = self.nodes[1].signrawtransactionwithwallet(fundedTx['hex'])
|
||||||
self.nodes[1].sendrawtransaction(fundedAndSignedTx['hex'])
|
self.nodes[1].sendrawtransaction(fundedAndSignedTx['hex'])
|
||||||
self.generate(self.nodes[1], 1)
|
self.generate(self.nodes[1], 1)
|
||||||
self.sync_all()
|
|
||||||
assert_equal(oldBalance+Decimal('50.19000000'), self.nodes[0].getbalance()) #0.19+block reward
|
assert_equal(oldBalance+Decimal('50.19000000'), self.nodes[0].getbalance()) #0.19+block reward
|
||||||
|
|
||||||
def test_op_return(self):
|
def test_op_return(self):
|
||||||
|
@ -760,7 +749,6 @@ class RawTransactionsTest(BitcoinTestFramework):
|
||||||
assert signedtx["complete"]
|
assert signedtx["complete"]
|
||||||
self.nodes[0].sendrawtransaction(signedtx["hex"])
|
self.nodes[0].sendrawtransaction(signedtx["hex"])
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(self.nodes[0], 1)
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
wwatch.unloadwallet()
|
wwatch.unloadwallet()
|
||||||
|
|
||||||
|
@ -1012,7 +1000,6 @@ class RawTransactionsTest(BitcoinTestFramework):
|
||||||
self.nodes[0].sendtoaddress(addr, 10)
|
self.nodes[0].sendtoaddress(addr, 10)
|
||||||
self.nodes[0].sendtoaddress(wallet.getnewaddress(), 10)
|
self.nodes[0].sendtoaddress(wallet.getnewaddress(), 10)
|
||||||
self.generate(self.nodes[0], 6)
|
self.generate(self.nodes[0], 6)
|
||||||
self.sync_all()
|
|
||||||
ext_utxo = self.nodes[0].listunspent(addresses=[addr])[0]
|
ext_utxo = self.nodes[0].listunspent(addresses=[addr])[0]
|
||||||
|
|
||||||
# An external input without solving data should result in an error
|
# An external input without solving data should result in an error
|
||||||
|
@ -1143,7 +1130,6 @@ class RawTransactionsTest(BitcoinTestFramework):
|
||||||
addr = w.getnewaddress(address_type="bech32")
|
addr = w.getnewaddress(address_type="bech32")
|
||||||
self.nodes[0].sendtoaddress(addr, 1)
|
self.nodes[0].sendtoaddress(addr, 1)
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(self.nodes[0], 1)
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
# A P2WPKH input costs 68 vbytes; With a single P2WPKH output, the rest of the tx is 42 vbytes for a total of 110 vbytes.
|
# A P2WPKH input costs 68 vbytes; With a single P2WPKH output, the rest of the tx is 42 vbytes for a total of 110 vbytes.
|
||||||
# At a feerate of 1.85 sat/vb, the input will need a fee of 125.8 sats and the rest 77.7 sats
|
# At a feerate of 1.85 sat/vb, the input will need a fee of 125.8 sats and the rest 77.7 sats
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2020 The Bitcoin Core developers
|
# Copyright (c) 2020-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
'''Test generateblock rpc.
|
'''Test generateblock rpc.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2018-2020 The Bitcoin Core developers
|
# Copyright (c) 2018-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test the getblockfilter RPC."""
|
"""Test the getblockfilter RPC."""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2017-2019 The Bitcoin Core developers
|
# Copyright (c) 2017-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
|
@ -48,7 +48,6 @@ class GetblockstatsTest(BitcoinTestFramework):
|
||||||
address = self.nodes[0].get_deterministic_priv_key().address
|
address = self.nodes[0].get_deterministic_priv_key().address
|
||||||
self.nodes[0].sendtoaddress(address=address, amount=10, subtractfeefromamount=True)
|
self.nodes[0].sendtoaddress(address=address, amount=10, subtractfeefromamount=True)
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(self.nodes[0], 1)
|
||||||
self.sync_all()
|
|
||||||
|
|
||||||
self.nodes[0].sendtoaddress(address=address, amount=10, subtractfeefromamount=True)
|
self.nodes[0].sendtoaddress(address=address, amount=10, subtractfeefromamount=True)
|
||||||
self.nodes[0].sendtoaddress(address=address, amount=10, subtractfeefromamount=False)
|
self.nodes[0].sendtoaddress(address=address, amount=10, subtractfeefromamount=False)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2014-2019 The Bitcoin Core developers
|
# Copyright (c) 2014-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test the getchaintips RPC.
|
"""Test the getchaintips RPC.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2018-2020 The Bitcoin Core developers
|
# Copyright (c) 2018-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test RPC help output."""
|
"""Test RPC help output."""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2020 The Bitcoin Core developers
|
# Copyright (c) 2020-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test error messages for 'getaddressinfo' and 'validateaddress' RPC commands."""
|
"""Test error messages for 'getaddressinfo' and 'validateaddress' RPC commands."""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2014-2020 The Bitcoin Core developers
|
# Copyright (c) 2014-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test the invalidateblock RPC."""
|
"""Test the invalidateblock RPC."""
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Copyright (c) 2019-2020 The Bitcoin Core developers
|
# Copyright (c) 2019-2021 The Bitcoin Core developers
|
||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
"""Test RPC misc output."""
|
"""Test RPC misc output."""
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue