added test_null_serialization
@@ -130,6 +130,19 @@ def test_op_int_serialization() -> None:
assert len(serialize([op_int])) == 1
assert [op_int] == parse(serialize([op_int]))
+ # assert serialize("") == serialize("OP_0")
+
+
+def test_integer_serialization() -> None:
+
+ for i in range(0, 128):
+ serialized_int = serialize([i]) # e.g., i = 26
+ assert [hex_string(i)] == parse(serialized_int)
+
+ for i in range(128, 256):
+ serialized_int = serialize([i])
+ # assert [hex_string(i)] == parse(serialized_int)
+
def test_single_byte_serialization() -> None:
@@ -140,12 +153,9 @@ def test_single_byte_serialization() -> None:
assert [hex_str] == parse(serialize([hex_str]))
-def test_integer_serialization() -> None:
+def test_null_serialization() -> None:
- for i in range(0, 128):
- serialized_int = serialize([i]) # e.g., i = 26
- assert [hex_string(i)] == parse(serialized_int)
+ empty_script: List[Command] = []
- for i in range(128, 256):
- serialized_int = serialize([i])
- # assert [hex_string(i)] == parse(serialized_int)
+ assert empty_script == parse(b"")
+ assert serialize(empty_script) == b""
