Skip to content

Commit 5206e9d

Browse files
authored
fix(core): fix OK-22502 & update onekey/sign_typed_data maximum data length (#467)
1 parent 74de200 commit 5206e9d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

core/src/apps/ethereum/onekey/sign_typed_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141

4242
# Maximum data size we support
43-
MAX_VALUE_BYTE_SIZE = 1024
43+
MAX_VALUE_BYTE_SIZE = 1536 # 1.5 KB
4444

4545

4646
@with_keychain_from_path(*PATTERNS_ADDRESS)

core/src/apps/near/sign_tx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async def sign_tx(
2222
await paths.validate_path(ctx, keychain, msg.address_n)
2323
node = keychain.derive(msg.address_n)
2424
pubkey = node.public_key()[1:]
25-
address = "0x" + hexlify(pubkey).decode()
25+
address = hexlify(pubkey).decode()
2626
ctx.primary_color, ctx.icon_path = lv.color_hex(PRIMARY_COLOR), ICON
2727
# parse message
2828
try:

core/src/apps/near/transaction.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def __init__(self, args: MessageArgs) -> None:
5050
def deserialize(raw_message: bytes) -> "Transaction":
5151
# singer
5252
len = int.from_bytes(raw_message[0:4], "little")
53-
signerId = "0x" + raw_message[4 : len + 4].decode("utf-8")
53+
signerId = raw_message[4 : len + 4].decode("utf-8")
5454
offset = len + 4
5555
# publicKey
5656
publicKey = raw_message[offset : offset + 33]
@@ -60,7 +60,7 @@ def deserialize(raw_message: bytes) -> "Transaction":
6060
offset += 8
6161
# receiverId
6262
len = int.from_bytes(raw_message[offset : offset + 4], "little")
63-
receiverId = "0x" + raw_message[offset + 4 : offset + 4 + len].decode("utf-8")
63+
receiverId = raw_message[offset + 4 : offset + 4 + len].decode("utf-8")
6464
offset += len + 4
6565
# blockHash
6666
blockHash = raw_message[offset : offset + 32]

0 commit comments

Comments
 (0)