Skip to content

Commit

Permalink
Wip: use ledger_tester for approving tx hash signature
Browse files Browse the repository at this point in the history
  • Loading branch information
elizabethengelman committed May 30, 2024
1 parent 57dce12 commit 4c4bbfe
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cmd/crates/stellar-ledger/src/emulator_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ async fn test_sign_tx_hash_when_hash_signing_is_enabled() {
let ledger = Arc::clone(&ledger);
async move { ledger.sign_transaction_hash(path, &test_hash).await }
});
let approve = tokio::task::spawn(approve_tx_hash_signature(ui_host_port));
let approve = tokio::task::spawn(approve_tx_hash_signature_2(&ledger_testing));

let response = sign.await.unwrap();
let _ = approve.await.unwrap();
Expand Down Expand Up @@ -285,7 +285,6 @@ async fn get_emulator_events(ui_host_port: u16) -> Vec<EmulatorEvent> {
.unwrap();
resp.events
}

async fn approve_tx_hash_signature(ui_host_port: u16) {
for _ in 0..10 {
click(ui_host_port, "button/right").await;
Expand All @@ -294,6 +293,14 @@ async fn approve_tx_hash_signature(ui_host_port: u16) {
click(ui_host_port, "button/both").await;
}

async fn approve_tx_hash_signature_2(ledger_tester: &LedgerTesting<'_>) {
for _ in 0..10 {
ledger_tester.click("right").await;
}

ledger_tester.click("both").await;
}

async fn approve_tx_signature(ui_host_port: u16) {
let mut map = HashMap::new();
map.insert("action", "press-and-release");
Expand Down

0 comments on commit 4c4bbfe

Please sign in to comment.