Skip to content

Commit aece765

Browse files
authored
fix(core): fix polkadot transfer amount decode issue (#568)
1 parent b025839 commit aece765

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/apps/polkadot/codec/types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def process_compact_bytes(self):
2121
elif byte_mod == 2:
2222
self.compact_length = 4
2323
else:
24-
self.compact_length = int(5 + (compact_byte[0] - 3) / 4)
24+
self.compact_length = int(5 + (compact_byte[0] - 3) >> 2)
2525

2626
if self.compact_length == 1:
2727
self.compact_bytes = compact_byte
@@ -37,7 +37,7 @@ def process_compact_bytes(self):
3737
def process(self):
3838
self.process_compact_bytes()
3939
if self.compact_length <= 4:
40-
return int(int.from_bytes(self.compact_bytes, "little") / 4)
40+
return int(int.from_bytes(self.compact_bytes, "little") >> 2)
4141
else:
4242
return int.from_bytes(self.compact_bytes, "little")
4343

0 commit comments

Comments
 (0)