aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/messages.py
diff options
context:
space:
mode:
authorstratospher <44024636+stratospher@users.noreply.github.com>2023-11-15 10:38:40 +0530
committerstratospher <44024636+stratospher@users.noreply.github.com>2024-01-23 22:04:55 +0530
commit8d6c848a48530893ca40be5c1285541b3e7a94f3 (patch)
tree9623f102edea8d3791757bc8a1ab1dcf4babe1c5 /test/functional/test_framework/messages.py
parent595ad4b16880ae1f23463ca9985381c8eae945d8 (diff)
downloadbitcoin-8d6c848a48530893ca40be5c1285541b3e7a94f3.tar.xz
[test] Move MAGIC_BYTES to messages.py
This avoids circular dependency happening when importing MAGIC_BYTES. Before, p2p.py <--import for EncryptedP2PState-- v2_p2p.py | ^ | | └---------import for MAGIC_BYTES----------┘ Now, MAGIC_BYTES are kept separately in messages.py Co-authored-by: Martin Zumsande <mzumsande@gmail.com>
Diffstat (limited to 'test/functional/test_framework/messages.py')
-rwxr-xr-xtest/functional/test_framework/messages.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py
index d008cb39aa..cc30424653 100755
--- a/test/functional/test_framework/messages.py
+++ b/test/functional/test_framework/messages.py
@@ -75,6 +75,13 @@ MAX_OP_RETURN_RELAY = 83
DEFAULT_MEMPOOL_EXPIRY_HOURS = 336 # hours
+MAGIC_BYTES = {
+ "mainnet": b"\xf9\xbe\xb4\xd9", # mainnet
+ "testnet3": b"\x0b\x11\x09\x07", # testnet3
+ "regtest": b"\xfa\xbf\xb5\xda", # regtest
+ "signet": b"\x0a\x03\xcf\x40", # signet
+}
+
def sha256(s):
return hashlib.sha256(s).digest()