Skip to content

Commit

Permalink
Fix output_proof decoding (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
igorsereda committed Oct 8, 2024
2 parents 0469a1a + 038a513 commit e50e06a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion bridge_indexer/types/output_proof/micheline_expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,22 @@ def unpack(self):
return int(bits_array, 2), self._size


class Nat(BaseBinarySchema):
def unpack(self):
r, i = 0, 0
for i, e in enumerate(self._packed):
s = ((e & 0x7f) << (i * 7))
if not s:
break
r = r + s
self._size = i + 1
return r, self._size


class OutputProofOutput(BaseBinarySchema):
_schema = [
('outbox_level', 4, 'int32'),
('message_index', None, 'Zarith'),
('message_index', None, 'Nat'),
('message', None, 'Message'),
]

Expand Down

0 comments on commit e50e06a

Please sign in to comment.