Skip to content

Commit

Permalink
Added valid 2 swap tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoccmartins committed Feb 4, 2025
1 parent 5088893 commit 64bff71
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 7 deletions.
4 changes: 1 addition & 3 deletions test/python/apps/aptos.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ class AptosCommandSender:
def __init__(self, backend) -> None:
self.backend = backend

def sign_tx(self, path: str, transaction: bytes) -> List[RAPDU]:
def sign_tx(self, transaction: bytes) -> List[RAPDU]:
apdus = []
# TODO: for some reason, this is stalling the function
#packed_path = pack_derivation_path(path)
packed_path = APTOS_PACKED_DERIVATION_PATH
apdus.append(self.backend.exchange(cla=CLA,
ins=InsType.SIGN_TX,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 7 additions & 4 deletions test/python/test_aptos.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ class AptosTests(ExchangeTestRunner):
fake_payout = "abcdabcd"
fake_payout_memo = "1"
def perform_final_tx(self, destination, send_amount, fees, memo):
if destination != self.valid_destination_1 or destination == self.valid_destination_2:
assert False
transaction = bytes.fromhex("b5e97db07fa0bd0e5598aa3643a9bc6f6693bddc1a9fec9e674a461eaa00b193783135e8b00430253a22ba041d860c373d7a1501ccf7ac2d1ad37a8ed2775aee000000000000000002000000000000000000000000000000000000000000000000000000000000000104636f696e087472616e73666572010700000000000000000000000000000000000000000000000000000000000000010a6170746f735f636f696e094170746f73436f696e000220544e62745a53706b6e61517643376a50434c55347a6e4a4d676d386668754700082a00000000000000204e0000000000006400000000000000565c51630000000022")
AptosCommandSender(self.backend).sign_tx(path="m/44'/637'/0''",transaction=transaction)
if destination == self.valid_destination_1:
transaction = bytes.fromhex("b5e97db07fa0bd0e5598aa3643a9bc6f6693bddc1a9fec9e674a461eaa00b193783135e8b00430253a22ba041d860c373d7a1501ccf7ac2d1ad37a8ed2775aee000000000000000002000000000000000000000000000000000000000000000000000000000000000104636f696e087472616e73666572010700000000000000000000000000000000000000000000000000000000000000010a6170746f735f636f696e094170746f73436f696e000220544e62745a53706b6e61517643376a50434c55347a6e4a4d676d386668754700082a00000000000000204e0000000000006400000000000000565c51630000000022")
AptosCommandSender(self.backend).sign_tx(transaction=transaction)
if destination == self.valid_destination_2:
transaction = bytes.fromhex("b5e97db07fa0bd0e5598aa3643a9bc6f6693bddc1a9fec9e674a461eaa00b193783135e8b00430253a22ba041d860c373d7a1501ccf7ac2d1ad37a8ed2775aee000000000000000002000000000000000000000000000000000000000000000000000000000000000104636f696e087472616e73666572010700000000000000000000000000000000000000000000000000000000000000010a6170746f735f636f696e094170746f73436f696e00022054426F545A6341527A5756676E4E7542395379453353356731527773586F510008ceb4a01a00000000204e0000000000006400000000000000565c51630000000022")
AptosCommandSender(self.backend).sign_tx(transaction=transaction)


# Use a class to reuse the same Speculos instance
class TestsAptos:
Expand Down

0 comments on commit 64bff71

Please sign in to comment.