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: use ledger in txn sign #1311

Closed
wants to merge 85 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
4f8e15b
Exploring how to interact with Ledger from rust code
elizabethengelman Mar 18, 2024
50e5e5f
WIP: get_public_key works, but needs to be cleaned up
elizabethengelman Mar 19, 2024
852114e
Clean up: get_public_key
elizabethengelman Mar 19, 2024
db1c976
Clean up: remove unused tests, etc
elizabethengelman Mar 20, 2024
e24d8a6
WIP: start the speculos emulator via docker
elizabethengelman Mar 22, 2024
0d1c9e7
WIP: start speculos via docker and include some default elf files
elizabethengelman Mar 27, 2024
37b2a24
Allow for stopping the emulator
elizabethengelman Mar 27, 2024
c68c40d
Make get_public_key async
elizabethengelman Mar 28, 2024
1f51f3e
WIP: Allow get_public_key to use Exchange trait to get the transport
elizabethengelman Mar 28, 2024
b74f972
Pass transport into get_public_key_with_display_flag
elizabethengelman Mar 28, 2024
7c1898b
Create a Ledger struct that takes in a generic that implements Exchange
elizabethengelman Mar 28, 2024
d477ce8
Add get_public_key_with_display_flag to Ledger implementation
elizabethengelman Mar 28, 2024
6780f4d
WIP: try to connect ledger struct to emulator transport intead of the…
elizabethengelman Mar 28, 2024
b968fc7
WIP: connected to the emulator
elizabethengelman Mar 28, 2024
614e75b
Add stellarNanoApp.elf
elizabethengelman Apr 1, 2024
404dd46
Cleanup
elizabethengelman Apr 1, 2024
9c36b4c
Add get_app_configuration fn
elizabethengelman Apr 1, 2024
e39d95b
Add sign_transaction_hash fn
elizabethengelman Apr 3, 2024
63bafad
Allow for enabling tx hash signing on the emulator
elizabethengelman Apr 4, 2024
0f96420
WIP - approve the tx on the device
elizabethengelman Apr 4, 2024
d249506
WIP signing a tx
elizabethengelman Apr 8, 2024
691102b
wip sign tx
elizabethengelman Apr 8, 2024
98a0ffa
not sure which is right
elizabethengelman Apr 9, 2024
28f999d
Making progress
elizabethengelman Apr 11, 2024
5f422ef
cleanup
elizabethengelman Apr 11, 2024
b3a1a1c
Up the TransportZemuHttp timeout
elizabethengelman Apr 11, 2024
16ca7a5
Cleanup
elizabethengelman Apr 11, 2024
1ea114f
Update the expected sign_transaction response hex
elizabethengelman Apr 11, 2024
e2b6e0f
Fix tests
elizabethengelman Apr 11, 2024
692e659
Remove unused imports
elizabethengelman Apr 11, 2024
84d2b07
Move app code into lib.rs
elizabethengelman Apr 11, 2024
0d5d159
Make LedgerSigner adhere to Stellar signer trait
elizabethengelman Apr 12, 2024
dcc34ab
Check in Cargo.lock
elizabethengelman Apr 16, 2024
fb9f653
Clippy
elizabethengelman Apr 16, 2024
d8a5dc0
WIP: start to use testcontainers, but it's flakey
elizabethengelman Apr 17, 2024
db06ddc
Getting closer, this isn't as flakey but has some sleeps in there
elizabethengelman Apr 17, 2024
e6cbf77
Use testcontainers for all ledger tests
elizabethengelman Apr 18, 2024
a367a58
Move speculos testcontainer setup to its own file
elizabethengelman Apr 18, 2024
bd51844
Remove docker.rs and emulator.rs to use testcontainers instead
elizabethengelman Apr 18, 2024
0a3fdaf
wip
elizabethengelman Apr 22, 2024
fd402fc
Cleanup
elizabethengelman Apr 22, 2024
396bc1f
Checkin Cargo.lock
elizabethengelman Apr 22, 2024
0b7034e
Merge branch 'main' into feat/ledger-signing
elizabethengelman Apr 22, 2024
8b53aad
Clippy
elizabethengelman Apr 22, 2024
ecfa66a
Merge branch 'main' into feat/ledger-signing
elizabethengelman Apr 22, 2024
868b9d6
Make sure that the ledger's ready text is displayed before continuing…
elizabethengelman Apr 24, 2024
bb6c4ab
Try waiting until the screen has changed before sending another butto…
elizabethengelman Apr 24, 2024
fb773e7
Fix issue with cc 1.0.86 and macos builds and build binaries on all (…
leighmcculloch Apr 23, 2024
11961ae
Cleanup
elizabethengelman Apr 25, 2024
25be1e6
Apply suggestions from code review
elizabethengelman Apr 26, 2024
3fb067f
Address PR feedback
elizabethengelman Apr 29, 2024
bf6a870
Separate emulator-dependent tests
elizabethengelman Apr 29, 2024
a2eaeb6
Merge branch 'main' into feat/ledger-signing
elizabethengelman Apr 29, 2024
1ac9400
Run emulator-dependent tests in a separate workflow
elizabethengelman Apr 29, 2024
8a097af
chore: move feature to mod declaration
willemneal Apr 29, 2024
7829271
Add unit tests to lib that mock out http requests
elizabethengelman Apr 30, 2024
e1631d7
Merge branch 'main' into feat/ledger-signing
elizabethengelman Apr 30, 2024
b44a9b4
Merge branch 'main' into feat/ledger-signing
elizabethengelman May 1, 2024
b5fedfd
Merge branch 'main' into feat/ledger-signing
elizabethengelman May 1, 2024
ba0a75c
Merge branch 'main' into feat/ledger-signing
elizabethengelman May 2, 2024
4d20c27
feat: --no-build command allows returning built transaction
willemneal May 2, 2024
2043923
feat: add txn subcommand
willemneal May 2, 2024
de934cf
Merge branch 'main' into feat/ledger-signing
elizabethengelman May 2, 2024
df0161e
Merge branch 'feat/txn-command' into feat/sign_with_ledger
willemneal May 2, 2024
8aa819c
feat: first pass at using ledger to sign
willemneal May 2, 2024
b9516a4
fix: can't decode the return value from signing hash
willemneal May 2, 2024
a5b6f9b
Cleanup
elizabethengelman May 2, 2024
8829da2
Rename TransportZemuHttp -> EmulatorHttpTransport
elizabethengelman May 2, 2024
dfb5e3e
Update error handling
elizabethengelman May 2, 2024
feec1a0
Update error handling
elizabethengelman May 2, 2024
2ed4a1a
feat: update and user errors
willemneal May 3, 2024
9f57428
fix: clippy and fmt
willemneal May 3, 2024
578db4f
feat: add txn subcommand
willemneal May 2, 2024
f0e0adc
Merge branch 'feat/txn-command' into feat/sign_with_ledger
willemneal May 3, 2024
4e54058
feat: sign blob
willemneal May 3, 2024
40d978e
Fix SignatureHint
elizabethengelman May 3, 2024
8026558
Add get_transport fn back in
elizabethengelman May 3, 2024
8d63c33
feat: initial signing working!
willemneal May 3, 2024
201b034
fix: fmt
willemneal May 3, 2024
28fca60
feat: preview hash for ledger
willemneal May 3, 2024
02f840e
Update one last error
elizabethengelman May 3, 2024
c22eb60
Merge remote-tracking branch 'AhaLabs/feat/ledger-signing' into feat/…
willemneal May 6, 2024
a5eca37
Cleanup imports
elizabethengelman May 7, 2024
17080a5
Merge remote-tracking branch 'AhaLabs/feat/ledger-signing' into feat/…
willemneal May 7, 2024
5eedab5
fix: use sign_blob and share sign_txn_hash default method
willemneal May 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/ledger-emulator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Ledger Emulator Tests

on:
push:
branches: [main, release/**]
pull_request:

defaults:
run:
shell: bash

jobs:
emulator-tests:
runs-on: ubuntu-latest
env:
CI_TESTS: true
steps:
- uses: actions/checkout@v3
- uses: stellar/actions/rust-cache@main
- name: install libudev-dev
run: |
sudo apt install -y libudev-dev
- run: |
cargo test --manifest-path cmd/crates/stellar-ledger/Cargo.toml --features "emulator-tests"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ captive-core/
!test.toml
*.sqlite
test_snapshots
.env
Loading
Loading