test: replace inv type magic numbers by constants

This commit is contained in:
Sebastian Falbesoner
2020-04-25 13:44:44 +02:00
parent c1cd2b5a97
commit eeaaa58d2c
12 changed files with 40 additions and 36 deletions

View File

@@ -15,7 +15,7 @@ from collections import defaultdict
# Avoid wildcard * imports
from test_framework.blocktools import (create_block, create_coinbase)
from test_framework.messages import CInv
from test_framework.messages import CInv, MSG_BLOCK
from test_framework.mininode import (
P2PInterface,
mininode_lock,
@@ -198,7 +198,7 @@ class ExampleTest(BitcoinTestFramework):
getdata_request = msg_getdata()
for block in blocks:
getdata_request.inv.append(CInv(2, block))
getdata_request.inv.append(CInv(MSG_BLOCK, block))
self.nodes[2].p2p.send_message(getdata_request)
# wait_until() will loop until a predicate condition is met. Use it to test properties of the