-
Notifications
You must be signed in to change notification settings - Fork 31
Feature/ledger signer #1944
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
base: refactor/wallet-async-signing
Are you sure you want to change the base?
Feature/ledger signer #1944
Conversation
ecf51c0
to
abe8a88
Compare
59bd742
to
9099e90
Compare
abe8a88
to
89285d1
Compare
5f20a4f
to
4c64407
Compare
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.
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 |
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.
Btw, the directory name is "speculus", plz rename.
String::from_utf8_lossy(&output.stderr) | ||
); | ||
} | ||
logging::log::debug!( |
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.
Import logging::log
and use a shorter name? Same below.
//! 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. | ||
//! | ||
//! |
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.
Plz reformat the comment to make line length reasonable
PressAndRelease, | ||
} | ||
|
||
/// Button action object for serialisation and use with the HTTP API |
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.
serialization
// /// 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) | ||
// } |
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.
Remove or uncomment?
hickory-server = "0.24" | ||
zeroize = "1.5" | ||
|
||
reqwest = "0.12" |
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.
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" } |
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.
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) |
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.
Weird indentation and it's inconsistent with the similar line above
/// API level override | ||
pub api_level: Option<String>, | ||
|
||
/// BIP39 seed for initialisation |
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.
initialization
pub enum Model { | ||
/// Nano S | ||
NanoS, | ||
/// Nano S Plus | ||
#[strum(serialize = "nanosplus", to_string = "nanosp")] | ||
NanoSP, | ||
/// Nano X | ||
NanoX, | ||
} |
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.
And what about Flex and Stax?
Tests assume the ledger app repo is cloned next to this one with name ledger-mintlayer