mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 15:04:44 +01:00
test: pep-8 p2p_feefilter.py
This commit is contained in:
parent
4b5c9191e3
commit
fab83b934a
1 changed files with 6 additions and 2 deletions
|
@ -15,6 +15,7 @@ from test_framework.test_framework import BitcoinTestFramework
|
||||||
def hashToHex(hash):
|
def hashToHex(hash):
|
||||||
return format(hash, '064x')
|
return format(hash, '064x')
|
||||||
|
|
||||||
|
|
||||||
# Wait up to 60 secs to see if the testnode has received all the expected invs
|
# Wait up to 60 secs to see if the testnode has received all the expected invs
|
||||||
def allInvsMatch(invsExpected, testnode):
|
def allInvsMatch(invsExpected, testnode):
|
||||||
for x in range(60):
|
for x in range(60):
|
||||||
|
@ -24,6 +25,7 @@ def allInvsMatch(invsExpected, testnode):
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
class TestP2PConn(P2PInterface):
|
class TestP2PConn(P2PInterface):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
@ -38,6 +40,7 @@ class TestP2PConn(P2PInterface):
|
||||||
with mininode_lock:
|
with mininode_lock:
|
||||||
self.txinvs = []
|
self.txinvs = []
|
||||||
|
|
||||||
|
|
||||||
class FeeFilterTest(BitcoinTestFramework):
|
class FeeFilterTest(BitcoinTestFramework):
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
|
@ -100,5 +103,6 @@ class FeeFilterTest(BitcoinTestFramework):
|
||||||
assert allInvsMatch(txids, self.nodes[0].p2p)
|
assert allInvsMatch(txids, self.nodes[0].p2p)
|
||||||
self.nodes[0].p2p.clear_invs()
|
self.nodes[0].p2p.clear_invs()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
FeeFilterTest().main()
|
FeeFilterTest().main()
|
||||||
|
|
Loading…
Add table
Reference in a new issue