mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-25 17:09:44 +00:00
src/apps/wallet/sign_tx: make check for OMNI more strict
This commit is contained in:
parent
4693c071b4
commit
10a284f6ee
@ -6,7 +6,7 @@ currencies = {1: "OMNI", 2: "tOMNI", 3: "MAID", 31: "USDT"}
|
||||
|
||||
|
||||
def is_valid(data: bytes) -> bool:
|
||||
return data[:4] == b"omni"
|
||||
return len(data) >= 8 and data[:4] == b"omni"
|
||||
|
||||
|
||||
def parse(data: bytes) -> bool:
|
||||
|
@ -6,7 +6,9 @@ class TestSignTxOmni(unittest.TestCase):
|
||||
|
||||
def test_is_valid(self):
|
||||
VECTORS = {
|
||||
"6f6d6e69000000000000001f000000002b752ee0": True,
|
||||
"6f6d6e69": False,
|
||||
"6f6d6e69000000": False,
|
||||
"6f6d6e6900000000": True,
|
||||
"6f6d6e69000000000000001f0000000020c85580": True,
|
||||
"0f6d6e69000000000000001f0000000020c85580": False,
|
||||
"6f6d6e69000000000000001f0000000020c8558000": True,
|
||||
|
Loading…
Reference in New Issue
Block a user