aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-11-03 11:55:43 +0100
committerMarcoFalke <falke.marco@gmail.com>2020-11-03 12:26:17 +0100
commitfac865b72d5c0e01fce74b84ab21e5ebbf069327 (patch)
treefdf207d47cdd76069da13aad6f7f4c7f2eb5a909 /test
parentfa1dea19fc50db449386c9f969adc5ad327a0f0d (diff)
test: Fix intermittent feature_taproot issue
The transaction is too large to fit into the mempool, so put it into a block. https://travis-ci.org/github/bitcoin/bitcoin/jobs/740987240#L7217 test 2020-11-03T01:31:08.645000Z TestFramework (ERROR): JSONRPC error Traceback (most recent call last): File "./test/functional/test_framework/test_framework.py", line 126, in main self.run_test() File "./test/functional/feature_taproot.py", line 1448, in run_test self.nodes[1].sendtoaddress(address=addr, amount=int(self.nodes[1].getbalance() * 70000000) / 100000000) File "./test/functional/test_framework/coverage.py", line 47, in __call__ return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs) File "./test/functional/test_framework/authproxy.py", line 146, in __call__ raise JSONRPCException(response['error'], status) test_framework.authproxy.JSONRPCException: Transaction too large (-6)
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/feature_taproot.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/test/functional/feature_taproot.py b/test/functional/feature_taproot.py
index f3741b1c17..c12d53b306 100755
--- a/test/functional/feature_taproot.py
+++ b/test/functional/feature_taproot.py
@@ -9,6 +9,7 @@ from test_framework.blocktools import (
create_block,
add_witness_commitment,
MAX_BLOCK_SIGOPS_WEIGHT,
+ NORMAL_GBT_REQUEST_PARAMS,
WITNESS_SCALE_FACTOR,
)
from test_framework.messages import (
@@ -1443,10 +1444,22 @@ class TaprootTest(BitcoinTestFramework):
self.nodes[1].generate(101)
self.test_spenders(self.nodes[1], spenders_taproot_active(), input_counts=[1, 2, 2, 2, 2, 3])
- # Transfer % of funds to pre-taproot node.
+ # Transfer funds to pre-taproot node.
addr = self.nodes[0].getnewaddress()
- self.nodes[1].sendtoaddress(address=addr, amount=int(self.nodes[1].getbalance() * 70000000) / 100000000)
- self.nodes[1].generate(1)
+ rawtx = self.nodes[1].createrawtransaction(
+ inputs=[{
+ 'txid': i['txid'],
+ 'vout': i['vout']
+ } for i in self.nodes[1].listunspent()],
+ outputs={addr: self.nodes[1].getbalance()},
+ )
+ rawtx = self.nodes[1].signrawtransactionwithwallet(rawtx)['hex']
+ # Transaction is too large to fit into the mempool, so put it into a block
+ block = create_block(tmpl=self.nodes[1].getblocktemplate(NORMAL_GBT_REQUEST_PARAMS), txlist=[rawtx])
+ add_witness_commitment(block)
+ block.rehash()
+ block.solve()
+ assert_equal(None, self.nodes[1].submitblock(block.serialize().hex()))
self.sync_blocks()
# Pre-taproot activation tests.