mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
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)
This commit is contained in:
parent
fa1dea19fc
commit
fac865b72d
1 changed files with 16 additions and 3 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue