Skip to content

Commit fac865b

Browse files
author
MarcoFalke
committed
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)
1 parent fa1dea1 commit fac865b

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

test/functional/feature_taproot.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
create_block,
1010
add_witness_commitment,
1111
MAX_BLOCK_SIGOPS_WEIGHT,
12+
NORMAL_GBT_REQUEST_PARAMS,
1213
WITNESS_SCALE_FACTOR,
1314
)
1415
from test_framework.messages import (
@@ -1443,10 +1444,22 @@ def run_test(self):
14431444
self.nodes[1].generate(101)
14441445
self.test_spenders(self.nodes[1], spenders_taproot_active(), input_counts=[1, 2, 2, 2, 2, 3])
14451446

1446-
# Transfer % of funds to pre-taproot node.
1447+
# Transfer funds to pre-taproot node.
14471448
addr = self.nodes[0].getnewaddress()
1448-
self.nodes[1].sendtoaddress(address=addr, amount=int(self.nodes[1].getbalance() * 70000000) / 100000000)
1449-
self.nodes[1].generate(1)
1449+
rawtx = self.nodes[1].createrawtransaction(
1450+
inputs=[{
1451+
'txid': i['txid'],
1452+
'vout': i['vout']
1453+
} for i in self.nodes[1].listunspent()],
1454+
outputs={addr: self.nodes[1].getbalance()},
1455+
)
1456+
rawtx = self.nodes[1].signrawtransactionwithwallet(rawtx)['hex']
1457+
# Transaction is too large to fit into the mempool, so put it into a block
1458+
block = create_block(tmpl=self.nodes[1].getblocktemplate(NORMAL_GBT_REQUEST_PARAMS), txlist=[rawtx])
1459+
add_witness_commitment(block)
1460+
block.rehash()
1461+
block.solve()
1462+
assert_equal(None, self.nodes[1].submitblock(block.serialize().hex()))
14501463
self.sync_blocks()
14511464

14521465
# Pre-taproot activation tests.

0 commit comments

Comments
 (0)