aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2023-03-08 18:25:34 +0100
committerfanquake <fanquake@gmail.com>2023-03-08 18:32:43 +0100
commit710fd571ff4c3133e41d7f62922cb4cc816250d3 (patch)
tree82a7f57b6a1c09eb155ff02f7fea6bf5d4f69732 /test
parent1ff135ca7ff73080daeeaea8c19ccaa555eab487 (diff)
parentfa0abcdafeb74aa7a312095becd55b1cee48cd99 (diff)
downloadbitcoin-710fd571ff4c3133e41d7f62922cb4cc816250d3.tar.xz
Merge bitcoin/bitcoin#26996: test: Flatten miniwallet array and remove random fee in longpoll
fa0abcdafeb74aa7a312095becd55b1cee48cd99 test: Flatten miniwallet array and remove random fee in longpoll (MarcoFalke) Pull request description: * Using a single MiniWallet is enough. * A random fee isn't needed either. ACKs for top commit: theStack: re-ACK fa0abcdafeb74aa7a312095becd55b1cee48cd99 Tree-SHA512: 77b99885b3f0d325d067838122114be57ec999ebc82912de6a22c33e2ba28a341c5e053c5bbc424b9922c2616562289a57c7156bd3b431d779182c2e472da59c
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/mining_getblocktemplate_longpoll.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/test/functional/mining_getblocktemplate_longpoll.py b/test/functional/mining_getblocktemplate_longpoll.py
index ec492f9e72..53182eb79e 100755
--- a/test/functional/mining_getblocktemplate_longpoll.py
+++ b/test/functional/mining_getblocktemplate_longpoll.py
@@ -4,7 +4,6 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test longpolling with getblocktemplate."""
-from decimal import Decimal
import random
import threading
@@ -47,9 +46,9 @@ class GetBlockTemplateLPTest(BitcoinTestFramework):
thr.join(5) # wait 5 seconds or until thread exits
assert thr.is_alive()
- miniwallets = [MiniWallet(node) for node in self.nodes]
+ self.miniwallet = MiniWallet(self.nodes[0])
self.log.info("Test that longpoll will terminate if another node generates a block")
- self.generate(miniwallets[1], 1) # generate a block on another node
+ self.generate(self.nodes[1], 1) # generate a block on another node
# check that thread will exit now that new transaction entered mempool
thr.join(5) # wait 5 seconds or until thread exits
assert not thr.is_alive()
@@ -57,18 +56,15 @@ class GetBlockTemplateLPTest(BitcoinTestFramework):
self.log.info("Test that longpoll will terminate if we generate a block ourselves")
thr = LongpollThread(self.nodes[0])
thr.start()
- self.generate(miniwallets[0], 1) # generate a block on own node
+ self.generate(self.nodes[0], 1) # generate a block on own node
thr.join(5) # wait 5 seconds or until thread exits
assert not thr.is_alive()
self.log.info("Test that introducing a new transaction into the mempool will terminate the longpoll")
thr = LongpollThread(self.nodes[0])
thr.start()
- # generate a random transaction and submit it
- min_relay_fee = self.nodes[0].getnetworkinfo()["relayfee"]
- fee_rate = min_relay_fee + Decimal('0.00000010') * random.randint(0,20)
- miniwallets[0].send_self_transfer(from_node=random.choice(self.nodes),
- fee_rate=fee_rate)
+ # generate a transaction and submit it
+ self.miniwallet.send_self_transfer(from_node=random.choice(self.nodes))
# after one minute, every 10 seconds the mempool is probed, so in 80 seconds it should have returned
thr.join(60 + 20)
assert not thr.is_alive()