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

Introduce webhook callback in account sync #998

Merged
merged 17 commits into from
Jun 7, 2024
Merged

Introduce webhook callback in account sync #998

merged 17 commits into from
Jun 7, 2024

Conversation

sugargoat
Copy link
Contributor

@sugargoat sugargoat commented Jun 6, 2024

Motivation

Some ramps providers would like to receive a callback when TXOs are found for their accounts during syncing.

In this PR

  • adds an optional configuration to include a webhook URL
  • Adds a WebhookThread being managed by the WalletService alongside account syncing
  • Adds a shared state via AtomicUsize to track how many new txos since last webhook call

Test Plan

  • new e2e test hitting webhook through httpmock during account sync

Sorry, something went wrong.

full-service/src/error.rs Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jun 6, 2024

Codecov Report

Attention: Patch coverage is 90.36697% with 21 lines in your changes missing coverage. Please review.

Project coverage is 55.66%. Comparing base (ab2af32) to head (e9f6715).
Report is 202 commits behind head on main.

Files Patch % Lines
full-service/src/service/webhook.rs 70.21% 6 Missing and 8 partials ⚠️
full-service/src/config.rs 0.00% 6 Missing ⚠️
full-service/src/service/sync.rs 95.45% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #998      +/-   ##
==========================================
- Coverage   60.12%   55.66%   -4.46%     
==========================================
  Files          88      125      +37     
  Lines       12356    16509    +4153     
  Branches     2010     2832     +822     
==========================================
+ Hits         7429     9190    +1761     
- Misses       3238     5222    +1984     
- Partials     1689     2097     +408     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

full-service/src/config.rs Outdated Show resolved Hide resolved
full-service/src/config.rs Outdated Show resolved Hide resolved
Cargo.lock Show resolved Hide resolved
@sugargoat sugargoat marked this pull request as ready for review June 7, 2024 04:41
@sugargoat
Copy link
Contributor Author

This PR is now ready for review, and I would recommend that we leave the restart logic for a fast follow.

sugargoat added 16 commits June 6, 2024 21:42

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
Signed-off-by: sugargoat <sugargoat@mobilecoin.com>

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
Signed-off-by: sugargoat <sugargoat@mobilecoin.com>

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
Signed-off-by: sugargoat <sugargoat@mobilecoin.com>
Clean up

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
Signed-off-by: sugargoat <sugargoat@mobilecoin.com>

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
Signed-off-by: sugargoat <sugargoat@mobilecoin.com>

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
Signed-off-by: sugargoat <sugargoat@mobilecoin.com>

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
Signed-off-by: sugargoat <sugargoat@mobilecoin.com>

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
Signed-off-by: sugargoat <sugargoat@mobilecoin.com>

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
Signed-off-by: sugargoat <sugargoat@mobilecoin.com>

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
Signed-off-by: sugargoat <sugargoat@mobilecoin.com>

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
… fully synced

Signed-off-by: sugargoat <sugargoat@mobilecoin.com>

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
Signed-off-by: sugargoat <sugargoat@mobilecoin.com>

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
Signed-off-by: sugargoat <sugargoat@mobilecoin.com>

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
Signed-off-by: sugargoat <sugargoat@mobilecoin.com>

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
Signed-off-by: sugargoat <sugargoat@mobilecoin.com>

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
Signed-off-by: sugargoat <sugargoat@mobilecoin.com>

Verified

This commit was signed with the committer’s verified signature.
holtzman Henry Holtzman
Copy link
Collaborator

@holtzman holtzman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Some todos left but let's merge!

@holtzman holtzman merged commit ba25891 into main Jun 7, 2024
3 checks passed
@holtzman holtzman deleted the webhook branch June 7, 2024 09:39
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

3 participants