Skip to content

fix: propagate ledger error wrapping correctly#8

Merged
damiannolan merged 3 commits intorelease/v0.50.x-celestiafrom
damian/ledger-errors
Mar 3, 2025
Merged

fix: propagate ledger error wrapping correctly#8
damiannolan merged 3 commits intorelease/v0.50.x-celestiafrom
damian/ledger-errors

Conversation

@damiannolan
Copy link

Description

When using errors.CombineErrors in crypto/keyring errors were losing information. Surfaced from test/ledger_test.go in celestia-app.

Error:      	
Not equal: 
            	            	expected: "Error: failed to generate ledger key: failed to retrieve device: ledger nano S: LedgerHID device (idx 0) not found. Ledger LOCKED OR Other Program/Web Browser may have control of device.\n"
            	            	actual  : "Error: failed to generate ledger key\n"
            	            	
            	            	Diff:
            	            	--- Expected
            	            	+++ Actual
            	            	@@ -1,2 +1,2 @@

When applying the changes in this PR we can regain the error wrapping that is expected.

Note sure why the cockroachdb/errors import. This must have been a mistake at some point. Removed usage in this file.

Closes: #XXXX


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • run make lint and make test
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@damiannolan damiannolan requested a review from julienrbrt March 3, 2025 13:29
@github-actions

This comment has been minimized.

@damiannolan
Copy link
Author

I will add a changelog pending approval

@damiannolan damiannolan merged commit f63bc08 into release/v0.50.x-celestia Mar 3, 2025
8 of 21 checks passed
@damiannolan damiannolan deleted the damian/ledger-errors branch March 3, 2025 13:57
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