mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
test: Remove confusing cast to same type (int to int)
This commit is contained in:
parent
c95784e3d3
commit
fae243f0cb
1 changed files with 4 additions and 4 deletions
|
|
@ -64,13 +64,13 @@ class InvalidMessagesTest(BitcoinTestFramework):
|
||||||
conn = self.nodes[0].add_p2p_connection(P2PDataStore())
|
conn = self.nodes[0].add_p2p_connection(P2PDataStore())
|
||||||
# Create valid message
|
# Create valid message
|
||||||
msg = conn.build_message(msg_ping(nonce=12345))
|
msg = conn.build_message(msg_ping(nonce=12345))
|
||||||
cut_pos = 12 # Chosen at an arbitrary position within the header
|
cut_pos = 12 # Chosen at an arbitrary position within the header
|
||||||
# Send message in two pieces
|
# Send message in two pieces
|
||||||
before = int(self.nodes[0].getnettotals()['totalbytesrecv'])
|
before = self.nodes[0].getnettotals()['totalbytesrecv']
|
||||||
conn.send_raw_message(msg[:cut_pos])
|
conn.send_raw_message(msg[:cut_pos])
|
||||||
# Wait until node has processed the first half of the message
|
# Wait until node has processed the first half of the message
|
||||||
self.wait_until(lambda: int(self.nodes[0].getnettotals()['totalbytesrecv']) != before)
|
self.wait_until(lambda: self.nodes[0].getnettotals()['totalbytesrecv'] != before)
|
||||||
middle = int(self.nodes[0].getnettotals()['totalbytesrecv'])
|
middle = self.nodes[0].getnettotals()['totalbytesrecv']
|
||||||
# If this assert fails, we've hit an unlikely race
|
# If this assert fails, we've hit an unlikely race
|
||||||
# where the test framework sent a message in between the two halves
|
# where the test framework sent a message in between the two halves
|
||||||
assert_equal(middle, before + cut_pos)
|
assert_equal(middle, before + cut_pos)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue