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(comms): add or_optional trait extension for RpcStatus #4246

Merged

Conversation

sdbondi
Copy link
Member

@sdbondi sdbondi commented Jun 30, 2022

Description

  • feat(comms): add or_optional trait extension for RpcStatus
  • fix(comms): fixup lifetimes which error in latest rust

Motivation and Context

When RPC returns NotFound it is common that a user wants to handle that error differently. This PR makes that more ergonomic by adding the or_optional function to the RPC result that returns an Option if the NotFound status is returned. An example where NotFound this needs to be handled is in wallet utxo scanning.

The lifetime changes in tor fix a compilation error that is likely from the recent upgrade to nightly rust. It is not clear why this error did not crop up sooner.

How Has This Been Tested?

New unit test

@aviator-app aviator-app bot merged commit 11fddf6 into tari-project:development Jul 1, 2022
@sdbondi sdbondi deleted the comms-rpc-optional-ext branch July 4, 2022 06:52
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.

None yet

2 participants