aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/messages.py
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-02-12 16:51:59 -0500
committerMarcoFalke <falke.marco@gmail.com>2019-02-12 16:52:06 -0500
commit029d28a7aa5619973eb59fe445b9a4186c0c2a58 (patch)
treefeb47331a944d2a5b2892273626600a1b970f1a8 /test/functional/test_framework/messages.py
parentd73918447faf168670b5dfdd55f6c19ed6dd8632 (diff)
parentb651ef7e1c39a820089695b29d14a07d910a385a (diff)
downloadbitcoin-029d28a7aa5619973eb59fe445b9a4186c0c2a58.tar.xz
Merge #15238: [QA] remove some magic mining constants in functional tests
b651ef7e1c submitheader: more directly test missing prev block header (Gregory Sanders) 1e7f741745 remove some magic mining constants in functional tests (Gregory Sanders) Pull request description: The fewer magic numbers the better. Also more directly tested a `submitheader` case of bad previous blockhash. Tree-SHA512: 52b01a6aa199fa909eea4e9e84409a901933e545724e33149cc4132c82168199fd678809b6d94d95c9ff6ad02238a9552363620d13b8beaa5d4b67ade9ef425c
Diffstat (limited to 'test/functional/test_framework/messages.py')
-rwxr-xr-xtest/functional/test_framework/messages.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py
index 356a45d6d0..4bd58519c5 100755
--- a/test/functional/test_framework/messages.py
+++ b/test/functional/test_framework/messages.py
@@ -28,7 +28,7 @@ import struct
import time
from test_framework.siphash import siphash256
-from test_framework.util import hex_str_to_bytes, bytes_to_hex_str
+from test_framework.util import hex_str_to_bytes, bytes_to_hex_str, assert_equal
MIN_VERSION_SUPPORTED = 60001
MY_VERSION = 70014 # past bip-31 for ping/pong
@@ -591,6 +591,8 @@ class CBlockHeader:
% (self.nVersion, self.hashPrevBlock, self.hashMerkleRoot,
time.ctime(self.nTime), self.nBits, self.nNonce)
+BLOCK_HEADER_SIZE = len(CBlockHeader().serialize())
+assert_equal(BLOCK_HEADER_SIZE, 80)
class CBlock(CBlockHeader):
__slots__ = ("vtx",)