diff --git a/core/src/apps/polkadot/codec/types.py b/core/src/apps/polkadot/codec/types.py index a2653cef80..1c91879d3a 100644 --- a/core/src/apps/polkadot/codec/types.py +++ b/core/src/apps/polkadot/codec/types.py @@ -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 @@ -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")