aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorElichai Turkel <elichai.turkel@gmail.com>2020-01-15 14:16:27 +0200
committerElichai Turkel <elichai.turkel@gmail.com>2020-01-15 14:16:27 +0200
commitf117fb00da747147cddfb071c1427a2754c278cd (patch)
tree8c5f6a53a0474395900dc8cfc02712ad3ee9de4e /test
parentac61ec9da6793f00b29ba11f784b9b1c3ae662e9 (diff)
Replace coroutine with async def in p2p_invalid_messages.py
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/p2p_invalid_messages.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/functional/p2p_invalid_messages.py b/test/functional/p2p_invalid_messages.py
index 20864881c1..07eacf410d 100755
--- a/test/functional/p2p_invalid_messages.py
+++ b/test/functional/p2p_invalid_messages.py
@@ -145,13 +145,13 @@ class InvalidMessagesTest(BitcoinTestFramework):
def test_magic_bytes(self):
conn = self.nodes[0].add_p2p_connection(P2PDataStore())
- def swap_magic_bytes():
+ async def swap_magic_bytes():
conn._on_data = lambda: None # Need to ignore all incoming messages from now, since they come with "invalid" magic bytes
conn.magic_bytes = b'\x00\x11\x22\x32'
# Call .result() to block until the atomic swap is complete, otherwise
# we might run into races later on
- asyncio.run_coroutine_threadsafe(asyncio.coroutine(swap_magic_bytes)(), NetworkThread.network_event_loop).result()
+ asyncio.run_coroutine_threadsafe(swap_magic_bytes(), NetworkThread.network_event_loop).result()
with self.nodes[0].assert_debug_log(['PROCESSMESSAGE: INVALID MESSAGESTART ping']):
conn.send_message(messages.msg_ping(nonce=0xff))