Fix serialization of nested arrays in JSON.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Hopwood 2022-02-07 20:33:14 +00:00
parent bb67196aa5
commit 823c8a54f4
1 changed files with 4 additions and 4 deletions

View File

@ -28,16 +28,16 @@ def tv_value_json(value, bitcoin_flavoured):
value = value.thing
def bitcoinify(value):
if type(value) == list:
return [bitcoinify(v) for v in value]
if type(value) == bytes:
if bitcoin_flavoured and len(value) == 32:
value = value[::-1]
value = hexlify(value).decode()
return value
if type(value) == list:
return [bitcoinify(v) for v in value]
else:
return bitcoinify(value)
return bitcoinify(value)
def tv_json(filename, parts, vectors, bitcoin_flavoured):
if type(vectors) == type({}):