1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-18 12:28:09 +00:00

src/apps/wallet: use hex value in asserts in sign_tx.writers

This commit is contained in:
Pavol Rusnak 2018-06-04 12:15:02 +02:00
parent 6d21723330
commit bc2f371886
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -33,7 +33,7 @@ def write_tx_output(w, o: TxOutputBinType):
def write_op_push(w, n: int):
assert n >= 0 and n <= 4294967295
assert n >= 0 and n <= 0xFFFFFFFF
if n < 0x4C:
w.append(n & 0xFF)
elif n < 0xFF:
@ -56,7 +56,7 @@ def write_op_push(w, n: int):
def write_varint(w, n: int):
assert n >= 0 and n <= 4294967295
assert n >= 0 and n <= 0xFFFFFFFF
if n < 253:
w.append(n & 0xFF)
elif n < 65536:
@ -72,7 +72,7 @@ def write_varint(w, n: int):
def write_uint32(w, n: int):
assert n >= 0 and n <= 4294967295
assert n >= 0 and n <= 0xFFFFFFFF
w.append(n & 0xFF)
w.append((n >> 8) & 0xFF)
w.append((n >> 16) & 0xFF)
@ -80,7 +80,7 @@ def write_uint32(w, n: int):
def write_uint64(w, n: int):
assert n >= 0 and n <= 18446744073709551615
assert n >= 0 and n <= 0xFFFFFFFFFFFFFFFF
w.append(n & 0xFF)
w.append((n >> 8) & 0xFF)
w.append((n >> 16) & 0xFF)