diff --git a/src/main.py b/src/main.py index 63219ea..1ce0e8a 100644 --- a/src/main.py +++ b/src/main.py @@ -61,7 +61,7 @@ def statusListEncoding1Bit(): def statusListEncoding1BitCBOR(): status_list = exampleStatusList1Bit() - encoded = status_list.encodeAsCBOR() + encoded = status_list.encodeAsCBORRaw() hex_encoded = encoded.hex() text = "byte_array = [{}, {}] \nencoded:\n{}".format( hex(status_list.list[0]), hex(status_list.list[1]), util.printText(hex_encoded) @@ -85,7 +85,7 @@ def statusListEncoding2Bit(): def statusListEncoding2BitCBOR(): status_list = exampleStatusList2Bit() - encoded = status_list.encodeAsCBOR() + encoded = status_list.encodeAsCBORRaw() hex_encoded = encoded.hex() text = "byte_array = [{}, {}, {}] \nencoded:\n{}".format( hex(status_list.list[0]), diff --git a/src/status_list.py b/src/status_list.py index 51313e9..7c3e48f 100644 --- a/src/status_list.py +++ b/src/status_list.py @@ -43,6 +43,10 @@ def encodeAsCBOR(self) -> Dict: "bits": self.bits, "lst": encoded_list, } + return object + + def encodeAsCBORRaw(self) -> Dict: + object = self.encodeAsCBOR() return dumps(object) def decode(self, input: str):