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

TSDK-790 Claim BTC [Backend - do not merge yet] #11

Merged
merged 14 commits into from
May 16, 2024
Merged

Conversation

mundacho
Copy link
Collaborator

@mundacho mundacho commented May 9, 2024

Purpose

Once the tBTC are redeemed from the Topl side (during peg-in), we need to claim the BTC to the topl wallet. This requires:

  • sending a transaction to the BTC network
  • waiting for the transaction to be completed (using the monitoring)
  • informing the user that the process has been completed

This PR is limited to the backend.

Approach

  • We continue our refactoring to use a state machine to handle the states.
  • We are not including yet the time locks

Testing

  • Adapted integration tests.
  • Unit tests of the state machine were added

Tickets

  • TSDK-790 TSDK-804

Copy link
Contributor

github-actions bot commented May 10, 2024

Test Results

24 tests  +10   24 ✅ +10   1m 29s ⏱️ + 1m 0s
 5 suites ± 0    0 💤 ± 0 
 5 files   ± 0    0 ❌ ± 0 

Results for commit 7453559. ± Comparison against base commit cbc2dc2.

This pull request removes 2 and adds 12 tests. Note that renamed tests count towards both.
co.topl.bridge.controllers.ConfirmRedemptionControllerSpec ‑ ConfirmRedemptionController should create the correct transaction
co.topl.bridge.controllers.ConfirmRedemptionControllerSpec ‑ ConfirmRedemptionController should return an error if the session does not exist
co.topl.bridge.statemachine.pegin.PeginTransitionRelationSpec ‑ PeginTransitionRelation should NOT transition from WaitingForRedemption to BifrostFundsWithdrawn if guard fails
co.topl.bridge.statemachine.pegin.PeginTransitionRelationSpec ‑ PeginTransitionRelation should go from WaitingForBTC to MintingTBTC on deposited funds
co.topl.bridge.statemachine.pegin.PeginTransitionRelationSpec ‑ PeginTransitionRelation should not transition from MintingTBTC on BTC events
co.topl.bridge.statemachine.pegin.PeginTransitionRelationSpec ‑ PeginTransitionRelation should not transition from MintingTBTC to WaitingForRedemption
co.topl.bridge.statemachine.pegin.PeginTransitionRelationSpec ‑ PeginTransitionRelation should not transition from WaitingForBTC on Bifrost events
co.topl.bridge.statemachine.pegin.PeginTransitionRelationSpec ‑ PeginTransitionRelation should not transition from WaitingForBTC when the funds are not for the escrow address
co.topl.bridge.statemachine.pegin.PeginTransitionRelationSpec ‑ PeginTransitionRelation should not transition from WaitingForClaim on Bifrost events
co.topl.bridge.statemachine.pegin.PeginTransitionRelationSpec ‑ PeginTransitionRelation should not transition from WaitingForClaim to EndTrasition when the address is different
co.topl.bridge.statemachine.pegin.PeginTransitionRelationSpec ‑ PeginTransitionRelation should not transition from WaitingForRedemption on BTC events
co.topl.bridge.statemachine.pegin.PeginTransitionRelationSpec ‑ PeginTransitionRelation should transition from MintingTBTC to WaitingForRedemption
…

♻️ This comment has been updated with latest results.

@mundacho mundacho changed the title TSDK-790 Claim BTC TSDK-790 Claim BTC [Backend - do not merge yet] May 13, 2024
@mundacho mundacho marked this pull request as ready for review May 13, 2024 21:56
Copy link
Collaborator

@DiademShoukralla DiademShoukralla left a comment

Choose a reason for hiding this comment

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

LGTM!

* TSD-790 Complete UI

* TSD-790 Add basic tests to UI

* TSD-790 Remove unnecessary file
@mundacho mundacho merged commit aec6901 into main May 16, 2024
6 checks passed
@mundacho mundacho deleted the tsdk-790-claim-btc branch May 16, 2024 14:33
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