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

Unify recover fn result type #13893

Open
mattsse opened this issue Jan 20, 2025 · 1 comment · May be fixed by #13897
Open

Unify recover fn result type #13893

mattsse opened this issue Jan 20, 2025 · 1 comment · May be fixed by #13897
Assignees
Labels
C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started

Comments

@mattsse
Copy link
Collaborator

mattsse commented Jan 20, 2025

Describe the feature

we only recently introduced RecoveryErr

fn try_recover_unchecked(&self) -> Result<Address, RecoveryError> {

but kept the function that return an option

fn recover_signer_unchecked(&self) -> Option<Address> {

fn recover_signer(&self) -> Option<Address>;

TODO

  • replace Option<Address> with Result<Address, RecoveryErr>

update error handling, such as:

transaction.recover_signer_unchecked().ok_or(EthApiError::InvalidTransactionSignature)?;

which can then use the ? operator if we add a From<RecoveryErr> impl for EthApiError for example

Additional context

No response

@mattsse mattsse added C-enhancement New feature or request S-needs-triage This issue needs to be labelled labels Jan 20, 2025
@mattsse mattsse added D-good-first-issue Nice and easy! A great choice to get started and removed S-needs-triage This issue needs to be labelled labels Jan 20, 2025
@hoank101
Copy link
Contributor

hi sir, i can do it

@hoank101 hoank101 linked a pull request Jan 21, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

2 participants