Skip to content

Conversation

OBorce
Copy link
Contributor

@OBorce OBorce commented Jul 30, 2025

  • Ledger signer
  • Ledger tests

Tests assume the ledger app repo is cloned next to this one with name ledger-mintlayer

@OBorce OBorce changed the base branch from master to refactor/wallet-async-signing July 30, 2025 13:35
@OBorce OBorce force-pushed the feature/ledger_signer branch 2 times, most recently from ecf51c0 to abe8a88 Compare July 31, 2025 08:24
@OBorce OBorce force-pushed the refactor/wallet-async-signing branch from 59bd742 to 9099e90 Compare August 22, 2025 10:57
@OBorce OBorce force-pushed the feature/ledger_signer branch from abe8a88 to 89285d1 Compare August 22, 2025 10:58
@OBorce OBorce marked this pull request as ready for review August 25, 2025 12:43
@OBorce OBorce force-pushed the feature/ledger_signer branch from 5f20a4f to 4c64407 Compare August 25, 2025 12:56
Copy link
Contributor

@ImplOfAnImpl ImplOfAnImpl left a comment

Choose a reason for hiding this comment

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

I haven't dug into the code much yet, will continue next week.

Tests assume the ledger app repo is cloned next to this one with name ledger-mintlayer

To be honest, I'm not a huge fan of this approach. And also of the fact that the emulator is always started automatically. E.g. in the Trezor case it was sometimes useful to see the emulator logs to understand what went wrong.
Was there any particular reason to do it this way instead of expecting the emuator to be running?

// See the License for the specific language governing permissions and
// limitations under the License.

//! Podman driver for speculos execution, runs a speculos instance within
Copy link
Contributor

Choose a reason for hiding this comment

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

Btw, the directory name is "speculus", plz rename.

String::from_utf8_lossy(&output.stderr)
);
}
logging::log::debug!(
Copy link
Contributor

Choose a reason for hiding this comment

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

Import logging::log and use a shorter name? Same below.

Comment on lines +16 to +19
//! Speculos runtime handle, provides out-of-band interaction with a simulator instance
//! via the [HTTP API](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/LedgerHQ/speculos/master/speculos/api/static/swagger/swagger.json) to allow button pushes and screenshots when executing integration tests.
//!
//!
Copy link
Contributor

Choose a reason for hiding this comment

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

Plz reformat the comment to make line length reasonable

PressAndRelease,
}

/// Button action object for serialisation and use with the HTTP API
Copy link
Contributor

Choose a reason for hiding this comment

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

serialization

Comment on lines +76 to +88
// /// Fetch a screenshot from the simulator
// async fn screenshot(&self) -> anyhow::Result<DynamicImage> {
// // Fetch screenshot from HTTP API
// let r = reqwest::get(format!("http://{}/screenshot", self.addr())).await?;
//
// // Read image bytes
// let b = r.bytes().await?;
//
// // Parse image object
// let i = ImageReader::new(Cursor::new(b)).with_guessed_format()?.decode()?;
//
// Ok(i)
// }
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove or uncomment?

Comment on lines 257 to +260
hickory-server = "0.24"
zeroize = "1.5"

reqwest = "0.12"
Copy link
Contributor

Choose a reason for hiding this comment

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

Put it above, in the alphabetical order?

@@ -300,3 +319,4 @@ default = ["trezor"]
# is fontconfig-parser <- fontdb <- cosmic-text <- various "iced" crates.
# TODO: investigate this further.
fontconfig-parser = { git = "https://github.com/Riey/fontconfig-parser", rev = "f7d13a779e6ee282ce75acbc00a1270c0350e0c2" }
ledger-proto = { git = "https://github.com/ledger-community/rust-ledger.git", rev = "4be10b810bb6500b7d8bc0b67e64fef24257e0e8" }
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need this in [patch]? If so, it's better to explain why and also leave a comment near [workspace.dependencies.ledger-proto] mentioning that we also reference the same hash in this additional place.

@@ -265,7 +283,7 @@ features = ["bitcoin", "mintlayer"]
panic = "abort" # prevent panic catching (mostly for the tokio runtime)

[profile.release]
panic = "abort" # prevent panic catching (mostly for the tokio runtime)
panic = "abort" # prevent panic catching (mostly for the tokio runtime)
Copy link
Contributor

Choose a reason for hiding this comment

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

Weird indentation and it's inconsistent with the similar line above

/// API level override
pub api_level: Option<String>,

/// BIP39 seed for initialisation
Copy link
Contributor

Choose a reason for hiding this comment

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

initialization

Comment on lines +30 to +38
pub enum Model {
/// Nano S
NanoS,
/// Nano S Plus
#[strum(serialize = "nanosplus", to_string = "nanosp")]
NanoSP,
/// Nano X
NanoX,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

And what about Flex and Stax?

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

Successfully merging this pull request may close these issues.

2 participants