-
Notifications
You must be signed in to change notification settings - Fork 70
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
Feat/speculos test framework #1347
Conversation
instead of adding one to the signer crate
this helped get past the lifetime complexity
3ebc3d5
to
4c4bbfe
Compare
@@ -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)); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
closing this for now. we have the associated issue in the backlog in case we want to pick it up again in the future. |
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]