Files
app-ethereum/tests/ragger/test_erc20information.py

27 lines
815 B
Python
Raw Permalink Normal View History

import pytest
from ragger.error import ExceptionRAPDU
from ragger.backend import BackendInterface
2024-04-30 17:34:57 +02:00
from client.client import EthAppClient, StatusWord
def test_provide_erc20_token(backend: BackendInterface):
app_client = EthAppClient(backend)
addr = bytes.fromhex("e41d2489571d322189246dafa5ebde1f4699f498")
response = app_client.provide_token_metadata("ZRX", addr, 18, 1)
assert response.status == StatusWord.OK
def test_provide_erc20_token_error(backend: BackendInterface):
app_client = EthAppClient(backend)
addr = bytes.fromhex("e41d2489571d322189246dafa5ebde1f4699f498")
sign = bytes.fromhex("deadbeef")
2024-06-11 10:59:14 +02:00
with pytest.raises(ExceptionRAPDU) as err:
app_client.provide_token_metadata("ZRX", addr, 18, 1, sign)
2024-06-11 10:59:14 +02:00
assert err.value.status == StatusWord.INVALID_DATA