Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ledger methods for faucet spending (#6409)
Description --- - Added ledger methods to support faucet spending. - Consolidated h/w ledger support into the `minotari_ledger_wallet_comms` crate. - Added test methods for all h/w ledger functions in the form of an example. - Addedd a seperate crate for common types shared between the Ledger application and the rest of the code base. ~~**Note:** I do not think the ledger feature (`#[cfg(feature = "ledger")]`) is nesseccary anymore. Any opinions?~~ Motivation and Context --- Faucet spending was not enabled on ledger devices. How Has This Been Tested? --- Compiled the ledger project `minotari_ledger_wallet`, uploaded the binaries to a ledger nano s device, then ran `cargo run --release --example ledger_demo`. ``` Transport created in 103.1686ms Transport created in 5.8315ms Transport created in 6.0115ms Transport created in 5.9472ms Transport created in 5.9368ms Transport created in 5.8717ms Transport created in 5.9897ms Transport created in 6.0287ms Transport created in 5.9255ms Transport created in 5.9359ms Application verified in 1.293162s Application verified in 200ns Application verified in 200ns Application verified in 100ns Application verified in 200ns Application verified in 400ns Application verified in 10.2µs Application verified in 200ns Application verified in 100ns Application verified in 100ns test: GetAppName app name: minotari_ledger_wallet test: GetVersion version: 1.0.0-pre.16 test: GetPublicAlpha public_alpha: ea10ad3d125beb2c1ebfa2d295ee8e42fd4a85ad831886f8b0b408f8390a9e3c test: GetPublicKey public_key: 4a01ab9c27a256827c6ee85373412f80cc88040425afe6301c9b1c7773356e2a test: GetScriptSignature script_sig: (3058744ade0c70a5fe914ed64695c82bc4c71477f8df46578fb3780c06c8110a,5e3fb09be68a31f397330037b6fc5b09227f1a89f74c66fe72fa34c507b90e2b,ed1a3a74f17ae19d70252a2d0ca92a0295f1f0c43565653b4f1fea9ffac32c0d,4f73a5c7cb723b12eca2c3ff57b8156ccacf9ed2790ac2b2e6c033147536e30d,7e8abeb6774fa9e63b181b54e47f09198116d02ec2c1f536c977cf8254d69a09) test: GetScriptOffset script_offset: 3a46a979ec9c2d94fbb55e09221fd0deb9e869dc849975e5ee163fb36bbe0709 test: GetViewKey view_key: 158e9d986d15c40ac3f6178f5947fde0cbd4f71f7de01c00c88cfa570e648e09 test: GetDHSharedSecret shared_secret: e85e660bd4d55f4d57784c3592e1ed063c77b8b1aa37431c078e8a7e18c8d23a test: GetRawSchnorrSignature signature: (2971d25b5920bc7a102a9d22c652fb1cf8da85ef08b8464dca6a363612040903,0a7f70764654239c51590d0f32b3b23368e355bb269d99cc151e1c261db56156) test: GetScriptSchnorrSignature signature: (c1fce9daf50cc65e69440f3f4383db1f64b1fd190bdcf7824c9dce0dcd68c208,ace0f952697b2496e60deadee0d40a23c263fa0d73c66a2742767fadad61fe33) test: Ledger app not running ✔ Exit the 'MinoTari Wallet' Ledger app and press Enter to continue.. · Ok test: Ledger disconnected ✔ Disconnect the Ledger device and press Enter to continue.. · Ok test: Ledger reconnected ✔ Reconnect the Ledger device (with password) and press Enter to continue.. · Ok test: Ledger app restart ✔ Start the 'MinoTari Wallet' Ledger app and press Enter to continue.. · Ok view_key: 158e9d986d15c40ac3f6178f5947fde0cbd4f71f7de01c00c88cfa570e648e09 Test completed successfully ``` What process can a PR reviewer use to test or verify this change? --- - Code review. - Compile the ledger project `minotari_ledger_wallet`, upload the binaries to a ledger nano s device, then run `cargo run --release --example ledger_demo`. <!-- Checklist --> <!-- 1. Is the title of your PR in the form that would make nice release notes? The title, excluding the conventional commit tag, will be included exactly as is in the CHANGELOG, so please think about it carefully. --> Breaking Changes --- - [x] None - [ ] Requires data directory on base node to be deleted - [ ] Requires hard fork - [ ] Other - Please specify <!-- Does this include a breaking change? If so, include this line as a footer --> <!-- BREAKING CHANGE: Description what the user should do, e.g. delete a database, resync the chain -->
- Loading branch information