mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
test: pep-8 p2p_getdata.py
This commit is contained in:
parent
793e0ff22c
commit
fab47375fe
1 changed files with 3 additions and 1 deletions
|
@ -16,8 +16,8 @@ from test_framework.mininode import (
|
|||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import wait_until
|
||||
|
||||
class P2PStoreBlock(P2PInterface):
|
||||
|
||||
class P2PStoreBlock(P2PInterface):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.blocks = defaultdict(int)
|
||||
|
@ -26,6 +26,7 @@ class P2PStoreBlock(P2PInterface):
|
|||
message.block.calc_sha256()
|
||||
self.blocks[message.block.sha256] += 1
|
||||
|
||||
|
||||
class GetdataTest(BitcoinTestFramework):
|
||||
def set_test_params(self):
|
||||
self.num_nodes = 1
|
||||
|
@ -47,5 +48,6 @@ class GetdataTest(BitcoinTestFramework):
|
|||
self.nodes[0].p2ps[0].send_and_ping(good_getdata)
|
||||
wait_until(lambda: self.nodes[0].p2ps[0].blocks[best_block] == 1, timeout=30, lock=mininode_lock)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
GetdataTest().main()
|
||||
|
|
Loading…
Add table
Reference in a new issue