Skip to content

Commit

Permalink
fix(core): fix polkadot transfer amount decode issue (#568)
Browse files Browse the repository at this point in the history
  • Loading branch information
somebodyLi authored Jul 19, 2024
1 parent b025839 commit aece765
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/apps/polkadot/codec/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def process_compact_bytes(self):
elif byte_mod == 2:
self.compact_length = 4
else:
self.compact_length = int(5 + (compact_byte[0] - 3) / 4)
self.compact_length = int(5 + (compact_byte[0] - 3) >> 2)

if self.compact_length == 1:
self.compact_bytes = compact_byte
Expand All @@ -37,7 +37,7 @@ def process_compact_bytes(self):
def process(self):
self.process_compact_bytes()
if self.compact_length <= 4:
return int(int.from_bytes(self.compact_bytes, "little") / 4)
return int(int.from_bytes(self.compact_bytes, "little") >> 2)
else:
return int.from_bytes(self.compact_bytes, "little")

Expand Down

0 comments on commit aece765

Please sign in to comment.