Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/speculos test framework #1347

Closed

Conversation

elizabethengelman
Copy link
Contributor

What

[TODO: Short statement about what is changing.]

Why

[TODO: Why this change is being made. Include any context required to understand the why.]

Known limitations

[TODO or N/A]

@@ -219,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));
Copy link
Contributor Author

@elizabethengelman elizabethengelman May 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When trying to use ledger_testing in approve_tx_hash_signature I am seeing an error that I can't quite seem to solve. I think that the issue is that in testcontainers, once the container goes out of scope it drops the docker reference. And then we can't use it again here. I've played around with using Arcs and RefCells, and may be missing something and would love another set of eyes on this!

For reference, this test passes without the most recent commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The errors:

error[E0597]: `docker` does not live long enough
   --> cmd/crates/stellar-ledger/src/emulator_tests.rs:176:77
    |
175 |     let docker = clients::Cli::default();
    |         ------ binding `docker` declared here
176 |     let ledger_testing = LedgerTesting::new(apps_dir(), LedgerModel::NanoS, &docker);
    |                                                                             ^^^^^^^ borrowed value does not live long enough
...
202 |     let approve = tokio::task::spawn(approve_tx_hash_signature_2(&ledger_testing));
    |                                      -------------------------------------------- argument requires that `docker` is borrowed for `'static`
...
215 | }
    | - `docker` dropped here while still borrowed

error[E0597]: `ledger_testing` does not live long enough
   --> cmd/crates/stellar-ledger/src/emulator_tests.rs:202:66
    |
176 |     let ledger_testing = LedgerTesting::new(apps_dir(), LedgerModel::NanoS, &docker);
    |         -------------- binding `ledger_testing` declared here
...
202 |     let approve = tokio::task::spawn(approve_tx_hash_signature_2(&ledger_testing));
    |                                      ----------------------------^^^^^^^^^^^^^^^-
    |                                      |                           |
    |                                      |                           borrowed value does not live long enough
    |                                      argument requires that `ledger_testing` is borrowed for `'static`
...
215 | }
    | - `ledger_testing` dropped here while still borrowed

@elizabethengelman
Copy link
Contributor Author

closing this for now. we have the associated issue in the backlog in case we want to pick it up again in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant