Skip to content

Commit

Permalink
Improve ledger error message
Browse files Browse the repository at this point in the history
  • Loading branch information
mdehoog committed Jan 7, 2025
1 parent 5e324ab commit 98e47a0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/.idea/
eip712sign
eip712sign
.DS_Store
9 changes: 5 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@ func main() {
// data to run without a key / ledger, which is useful for simulation purposes
s, signerErr := createSigner(privateKey, mnemonic, hdPath, index)
if signerErr != nil {
if address {
log.Fatalf("Error creating signer: %v", signerErr)
}
log.Printf("Warning: signer creation failed: %v", signerErr)
}

if address {
if s != nil {
fmt.Printf("Signer: %s\n", s.address().String())
}
fmt.Printf("Signer: %s\n", s.address().String())
os.Exit(0)
}

Expand Down Expand Up @@ -199,7 +200,7 @@ func createSigner(privateKey, mnemonic, hdPath string, index int) (signer, error
}
account, err := wallet.Derive(path, true)
if err != nil {
return nil, fmt.Errorf("error deriving ledger account (have you unlocked?): %w", err)
return nil, fmt.Errorf("error deriving ledger account (please unlock and open the Ethereum app): %w", err)
}
return &walletSigner{
wallet: wallet,
Expand Down

0 comments on commit 98e47a0

Please sign in to comment.