forked from jl777/SuperNET
-
Notifications
You must be signed in to change notification settings - Fork 94
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
fix(tpu-v2): fix tpu-v2 wait for payment spend and extract secret #2261
Open
laruh
wants to merge
29
commits into
dev
Choose a base branch
from
fix-tpu-v2-wait-for-payment-spend
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
9d7f476
add wait_for_maker_payment_spend to MakerPaymentSpent, add wait_for_t…
laruh de3a970
support Eth in lp bob/alice and use start_taker/maker_swap_state_machine
laruh ea5475b
use wait_for_confirmations in MakerPaymentSpent and in TakerPaymentSpent
laruh 934a2f0
rename wait_for_taker_payment_spend to find_taker_payment_spend_tx
laruh ca0ee56
EthCoin find_taker_payment_spend_tx_impl function now tries to find m…
laruh 9449cca
provide extract_secret_v2 in TakerSwapOpsV2, implement EthCoin extrac…
laruh 2e65abf
reuse utxo extract_secret_v2 in legacy extract_secret
laruh 43a1baf
eth extract_secret_v2 tests
laruh c700b59
cargo fmt
laruh 8d5ed46
review: remove unnecessary param from extract_secret_v2_impl, add eve…
laruh 707946a
review: simplify "swap_version" field type, make it non-optional
laruh 1e7a197
review: simplify `if let Some(tx_hash) = event.transaction_hash` block
laruh fb383fb
review: make spendTakerPayment transaction log message more informative
laruh 9ec0bab
review: provide LEGACY_SWAP_V const in tests
laruh 6c8b2c1
review: skip retrieving events if tx_hash is already found in find_ta…
laruh 6dcb1c3
Merge remote-tracking branch 'origin/dev' into fix-tpu-v2-wait-for-pa…
laruh f817f5c
review: combine legacy fallback conditions
laruh ddac3c8
remove unnecessary quotation marks
laruh f437dde
review: remove as_ref, map, remove Timer::sleep from the end
laruh 02736e4
return Timer sleep at the end of loop
laruh a08b500
leave todo above coin tuple pattern matching in ordermatch
laruh 24cb4c3
use `events_from_block` function in `wait_for_htlc_tx_spend`
laruh 5f666f3
review: use logs_block_range in find_taker_payment_spend_tx
laruh 47f904c
use logs_block_range in legacy wait_for_htlc_tx_spend function
laruh 2056f9b
remove time sleep from the end of loop
laruh 0b3ab9a
remove legacy_spend_events function and use new one instead
laruh cf76cab
Merge remote-tracking branch 'origin/dev' into fix-tpu-v2-wait-for-pa…
laruh c1a5063
impl detect_secret_hash_algo_v2 function
laruh 43c2d94
Add new addr_to_string function to ParseCoinAssocTypes trait and use …
laruh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these 2 lines just could be deleted btw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest leaving them. If someone in the future adds logic after the
if let Some(tx_hash) = tx_hash
block, they might forget to add thecontinue
again, or they might decide that not having thecontinue
and sleep time is what we actually want. It's better to avoid confusion.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I think it is better to add a comment with a reminder about this instead of leaving redundant code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolving anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, whoever's adding the code should understand the how the current flow executes and how the new code will execute along.
leaving this would be confusing tbh, i would see this and question if it really does something important and think i misunderstand something (i would prolly double check what
continue
does in rust, that's the level of confusion i mean).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should, but the human factor must be taken into account
It does. If the transaction wasn't found by tx_hash, the next loop cycle should be started. Its better to use
continue;
explicitly in such places.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can remove time sleep from the end of loop 2056f9b