src/apps/wallet/sign_tx: make check for OMNI more strict

pull/25/head
Pavol Rusnak 6 years ago
parent 4693c071b4
commit 10a284f6ee
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -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…
Cancel
Save