forked from bitcoin-teleport/teleport-transactions
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Taker protocol refactoring #9
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create a FundingTXInfo struct inside the protocol run and use that pass around required data. Partially simplifies `exchange_signatures_and_find_next_maker` and other downstream functions.
Create a dedicated NextSwapInfo to pass around next swap info related data. Few reference passing are fixed. Its much simpler to clone around data at this stage than worry about lifetimes of references. Comment section for next phase of work.
Useful to distinguish between std::error::Error.
Create a dedicated Taker struct, which includes a OngoingSwapState. This state is used to perform all the swap protocol specific operations. These states are specific to a single swap and are ephemeral. Before the finalization of the swap the state is cashed into wallet file. Various other utility structures are added. Taker configuration structure added which defaults to the hard code variables.
This completes the basic refactoring of the Taker protocol. The swap state is separated out and updated sequentially as the swap progresses. Configuration and swap parameters are separated out. Few more documentation addition ad this will be good to go. |
- Move around few more functions from and to util.rs. - More explainer and todo docs. - Fixing cargo clippy for taker_protocol.rs.
rajarshimaitra
changed the title
[draft] Taker protocol refactoring
Taker protocol refactoring
Jul 12, 2023
Thanks @rajarshimaitra ! Will test and review this by eod. |
This was referenced Jul 16, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an ongoing work of simplifying the
taker-protocol.rs
module.The Objective is to clearly define critical and non-ceritical portions of the Taker states.
Approach:
Taker
strcut (concept intaker.rs
). Handle all function calls via mutable and immutable references to this struct.Work done so far:
FundingTxInfo
to pass around data which fits in this message. This partially simplifiesexchange_signatures_and_find_next_maker
and other downstream functions.Next Work:
NextPeerInfo
to containerise next peer info related data.CurrentSwapCoin
info to hold all the active swap coins. Use that to pass around required data in protocol functions.Taker
struct to perform coinswap protocol.