Skip to content

Commit a8a24b8

Browse files
fix CBORTag
1 parent 05c6822 commit a8a24b8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

electrumx/lib/util_atomicals.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
import pickle
4040
import math
4141
from electrumx.lib.hash import sha256, double_sha256
42-
from cbor2 import dumps, loads, CBORDecodeError
42+
from cbor2 import dumps, loads, CBORDecodeError, CBORTag
4343
from collections.abc import Mapping
4444
from functools import reduce
4545
from merkletools import MerkleTools
@@ -1290,15 +1290,19 @@ def auto_encode_bytes_elements(state):
12901290
'$len': sys.getsizeof(state),
12911291
'$auto': True
12921292
}
1293+
1294+
if isinstance(state, CBORTag):
1295+
return dumps(state)
1296+
12931297
if not isinstance(state, dict) and not isinstance(state, list):
12941298
return state
12951299

12961300
if isinstance(state, list):
12971301
reformatted_list = []
12981302
for item in state:
12991303
reformatted_list.append(auto_encode_bytes_elements(item))
1300-
return reformatted_list
1301-
1304+
return reformatted_list
1305+
13021306
for key, value in state.items():
13031307
state[key] = auto_encode_bytes_elements(value)
13041308
return state

0 commit comments

Comments
 (0)