Skip to content

Commit

Permalink
refactor: rename all instances of 'boilerplate' to 'everscale'
Browse files Browse the repository at this point in the history
  • Loading branch information
keiff3r committed Feb 6, 2025
1 parent 8128122 commit 9d16f28
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Errors(IntEnum):
SW_INVALID_WALLET_TYPE = 0x6B15,
SW_INVALID_TICKER_LENGTH = 0x6B16

# Status Word from boilerplate app
# Status Word from everscale app
# SW_DENY = 0x6985
# SW_WRONG_P1P2 = 0x6A86
# SW_WRONG_DATA_LENGTH = 0x6A87
Expand All @@ -71,7 +71,7 @@ def split_message(message: bytes, max_size: int) -> List[bytes]:
return [message[x:x + max_size] for x in range(0, len(message), max_size)]


class BoilerplateCommandSender:
class EverscaleCommandSender:
def __init__(self, backend: BackendInterface) -> None:
self.backend = backend

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from io import BytesIO
from typing import Union

from .boilerplate_utils import read, read_uint, read_varint, write_varint, UINT64_MAX
from .everscale_utils import read, read_uint, read_varint, write_varint, UINT64_MAX


class TransactionError(Exception):
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions tests/test_appname_cmd.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
from ragger.backend.interface import BackendInterface

from application_client.boilerplate_command_sender import BoilerplateCommandSender
from application_client.boilerplate_response_unpacker import unpack_get_app_name_response
from application_client.everscale_command_sender import EverscaleCommandSender
from application_client.everscale_response_unpacker import unpack_get_app_name_response

from utils import verify_name


# In this test we check that the GET_APP_NAME replies the application name
def test_app_name(backend: BackendInterface) -> None:
# Use the app interface instead of raw interface
client = BoilerplateCommandSender(backend)
client = EverscaleCommandSender(backend)
# Send the GET_APP_NAME instruction to the app
response = client.get_app_name()
# Assert that we have received the correct appname
Expand Down
2 changes: 1 addition & 1 deletion tests/test_error_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from ragger.error import ExceptionRAPDU
from ragger.backend.interface import BackendInterface

from application_client.boilerplate_command_sender import CLA, InsType, P1, P2, Errors
from application_client.everscale_command_sender import CLA, InsType, P1, P2, Errors


# Ensure the app returns an error when a bad CLA is used
Expand Down
10 changes: 5 additions & 5 deletions tests/test_version_cmd.py → tests/test_get_app_config_cmd.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
from ragger.backend.interface import BackendInterface

from application_client.boilerplate_command_sender import BoilerplateCommandSender
from application_client.boilerplate_response_unpacker import unpack_get_version_response
from application_client.everscale_command_sender import EverscaleCommandSender
from application_client.everscale_response_unpacker import unpack_get_version_response

from utils import verify_version

# In this test we check the behavior of the device when asked to provide the app version
def test_version(backend: BackendInterface) -> None:
def test_get_app_config(backend: BackendInterface) -> None:
# Use the app interface instead of raw interface
client = BoilerplateCommandSender(backend)
client = EverscaleCommandSender(backend)
# Send the GET_VERSION instruction
rapdu = client.get_version()
rapdu = client.get_app_config()
# Use an helper to parse the response, assert the values
MAJOR, MINOR, PATCH = unpack_get_version_response(rapdu.data)
verify_version(f"{MAJOR}.{MINOR}.{PATCH}")
6 changes: 3 additions & 3 deletions tests/test_name_version.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from ragger.backend.interface import BackendInterface

from application_client.boilerplate_command_sender import BoilerplateCommandSender
from application_client.boilerplate_response_unpacker import unpack_get_app_and_version_response
from application_client.everscale_command_sender import EverscaleCommandSender
from application_client.everscale_response_unpacker import unpack_get_app_and_version_response

from utils import verify_version, verify_name

# Test a specific APDU asking BOLOS (and not the app) the name and version of the current app
def test_get_app_and_version(backend: BackendInterface) -> None:
# Use the app interface instead of raw interface
client = BoilerplateCommandSender(backend)
client = EverscaleCommandSender(backend)
# Send the special instruction to BOLOS
response = client.get_app_and_version()
# Use an helper to parse the response, assert the values
Expand Down
10 changes: 5 additions & 5 deletions tests/test_pubkey_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from ragger.backend.interface import BackendInterface
from ragger.navigator.navigation_scenario import NavigateWithScenario

from application_client.boilerplate_command_sender import BoilerplateCommandSender, Errors
from application_client.boilerplate_response_unpacker import unpack_get_public_key_response
from application_client.everscale_command_sender import EverscaleCommandSender, Errors
from application_client.everscale_response_unpacker import unpack_get_public_key_response


# In this test we check that the GET_PUBLIC_KEY works in non-confirmation mode
Expand All @@ -19,7 +19,7 @@ def test_get_public_key_no_confirm(backend: BackendInterface) -> None:
"m/44'/1'/2147483647/0/0/0/0/0/0/0"
]
for path in path_list:
client = BoilerplateCommandSender(backend)
client = EverscaleCommandSender(backend)
response = client.get_public_key(path=path).data
_, public_key, _, chain_code = unpack_get_public_key_response(response)

Expand All @@ -30,7 +30,7 @@ def test_get_public_key_no_confirm(backend: BackendInterface) -> None:

# In this test we check that the GET_PUBLIC_KEY works in confirmation mode
def test_get_public_key_confirm_accepted(backend: BackendInterface, scenario_navigator: NavigateWithScenario) -> None:
client = BoilerplateCommandSender(backend)
client = EverscaleCommandSender(backend)
path = "m/44'/1'/0'/0/0"
with client.get_public_key_with_confirmation(path=path):
scenario_navigator.address_review_approve()
Expand All @@ -45,7 +45,7 @@ def test_get_public_key_confirm_accepted(backend: BackendInterface, scenario_nav

# In this test we check that the GET_PUBLIC_KEY in confirmation mode replies an error if the user refuses
def test_get_public_key_confirm_refused(backend: BackendInterface, scenario_navigator: NavigateWithScenario) -> None:
client = BoilerplateCommandSender(backend)
client = EverscaleCommandSender(backend)
path = "m/44'/1'/0'/0/0"

with pytest.raises(ExceptionRAPDU) as e:
Expand Down
14 changes: 7 additions & 7 deletions tests/test_sign_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from ragger.navigator import Navigator, NavInsID
from ragger.navigator.navigation_scenario import NavigateWithScenario

from application_client.boilerplate_transaction import Transaction
from application_client.boilerplate_command_sender import BoilerplateCommandSender, Errors
from application_client.boilerplate_response_unpacker import unpack_get_public_key_response, unpack_sign_tx_response
from application_client.everscale_transaction import Transaction
from application_client.everscale_command_sender import EverscaleCommandSender, Errors
from application_client.everscale_response_unpacker import unpack_get_public_key_response, unpack_sign_tx_response
from utils import check_signature_validity

# In this tests we check the behavior of the device when asked to sign a transaction
Expand All @@ -19,7 +19,7 @@
# We will ensure that the displayed information is correct by using screenshots comparison
def test_sign_tx_short_tx(backend: BackendInterface, scenario_navigator: NavigateWithScenario) -> None:
# Use the app interface instead of raw interface
client = BoilerplateCommandSender(backend)
client = EverscaleCommandSender(backend)
# The path used for this entire test
path: str = "m/44'/1'/0'/0/0"

Expand Down Expand Up @@ -58,7 +58,7 @@ def test_sign_tx_short_tx_blind_sign(firmware: Firmware,
test_name: str,
default_screenshot_path: str) -> None:
# Use the app interface instead of raw interface
client = BoilerplateCommandSender(backend)
client = EverscaleCommandSender(backend)
# The path used for this entire test
path: str = "m/44'/1'/0'/0/0"

Expand Down Expand Up @@ -97,7 +97,7 @@ def test_sign_tx_short_tx_blind_sign(firmware: Firmware,
# In particular the long memo will force the transaction to be sent in multiple chunks
def test_sign_tx_long_tx(backend: BackendInterface, scenario_navigator: NavigateWithScenario) -> None:
# Use the app interface instead of raw interface
client = BoilerplateCommandSender(backend)
client = EverscaleCommandSender(backend)
path: str = "m/44'/1'/0'/0/0"

rapdu = client.get_public_key(path=path)
Expand Down Expand Up @@ -126,7 +126,7 @@ def test_sign_tx_long_tx(backend: BackendInterface, scenario_navigator: Navigate
# The test will ask for a transaction signature that will be refused on screen
def test_sign_tx_refused(backend: BackendInterface, scenario_navigator: NavigateWithScenario) -> None:
# Use the app interface instead of raw interface
client = BoilerplateCommandSender(backend)
client = EverscaleCommandSender(backend)
path: str = "m/44'/1'/0'/0/0"

transaction = Transaction(
Expand Down

0 comments on commit 9d16f28

Please sign in to comment.