forked from jl777/SuperNET
-
Notifications
You must be signed in to change notification settings - Fork 101
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(trading-proto-upgrade): locked amounts, kmd burn and other impl #2046
Merged
Merged
Changes from all commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
f5eb0fc
WIP. Implementing locked amounts for upgraded swaps.
artemii235 2e3f79b
WIP. Experiments for locked amount handling.
8b1676b
WIP. Implementing locked amounts for upgraded swaps.
artemii235 ec6d5e2
WIP. Locked amounts handling.
15aca49
WIP. Locked amounts handling.
1f2de9b
WIP. Locked amounts handling after kickstart.
eaf0ace
WIP. Implementing locked amounts on kickstart.
artemii235 e8b99a3
WIP. Locked amounts handling after kickstart.
0464eec
WIP. Implementing locked amounts handling on kickstart.
artemii235 fd60519
Locked amounts handling partially implemented.
d9ff38e
Implemented active_swaps V2 RPC.
artemii235 c361507
Handling accept_only_from in progress.
artemii235 94dee63
Handling accept_only_from in progress.
fbf9650
Finish accept_only_from handling. Include uuid in swap messages payload.
artemii235 6c9ab43
Implementing immediate refund for maker + refactor.
e1d4908
Implementing immediate refund for maker + refactor.
98493fb
Implementing maker payment immediate refund.
fd53c39
Implementing immediate refund for maker + refactor.
a5fffe7
Implementing maker payment immediate refund.
d684fa7
Implementing immediate refund for maker.
1f109f1
Implementing maker payment immediate refund.
artemii235 7bd7755
Implementing immediate refund for maker.
a8969b3
Finished maker payment immediate refund.
artemii235 be9d8d9
Implementing KMD burn.
artemii235 5c7e43c
Fixes after cherry pick.
8b9fb7a
Implementing dex fee burn.
d745e73
Implementing dex fee burn.
46a91b7
Dex fee burn finished.
222813a
Fixing clippy.
artemii235 a1aeb96
Fixing clippy.
artemii235 ee098d3
Fixing wasm.
artemii235 55ed473
Fixed WASM.
artemii235 d719246
Switching to the latest version of testcontainers.
186064c
Adding Geth dev node usage in docker tests.
artemii235 d8dbb18
Adding Geth dev node usage in docker tests.
artemii235 afcc59b
Adding Geth dev node usage in docker tests.
artemii235 4cb48af
Adding Geth dev node usage in docker tests.
artemii235 88d279b
Adding Geth dev node usage in docker tests.
artemii235 b500c81
Fixing swap watcher tests.
6b7e5ba
Debugging watcher tests.
artemii235 2efddbd
Review fixes.
artemii235 e44fc68
Debugging and fixing watcher tests.
artemii235 6bb2c27
Merge remote-tracking branch 'origin/dev' into swap-proto-upgrade-ite…
7a0756d
Review fixes.
1e76676
Debugging and fixing watcher tests.
artemii235 b924154
Debugging and fixing watcher tests.
3578c17
Debugging and fixing watcher tests.
4a5c7b2
Debugging and fixing watcher tests.
b746028
Debugging and fixing watcher tests.
e04ff1a
All watcher tests are green (at least locally)
artemii235 9071b1a
Do not panick on tx receipt error.
artemii235 8369d90
Impl op_return_data instead of add_op_return_data.
artemii235 79768b4
Use .map_err(MmError::from) instead of Ok(res?).
e02ed59
Fix typos and add missing doc comments.
57352d2
Use ETH_DECIMALS and tweak ETH docker tests.
c6ea8fa
Tweak watchers tests to be more stable.
52aaa16
Remove push_bytes and use push_data instead.
442e759
Remove unneeded coerce_unsized.
artemii235 e1b42aa
Merge remote-tracking branch 'origin/dev' into swap-proto-upgrade-ite…
3d76e08
Fixes after merging with dev.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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.
Can you please specify which tests pass? As I can see when
RewardTarget
isPaymentReceiver
komodo-defi-framework/mm2src/coins/utxo/utxo_common.rs
Line 2859 in 52aaa16
send_contract_reward_on_spend
is alwaysfalse
komodo-defi-framework/mm2src/coins/utxo/utxo_common.rs
Line 2892 in 52aaa16
The
RewardTarget::PaymentReceiver
variant seems to be used for UTXO coins only for the case ofUTXO taker / ETH maker - UTXO taker / ERC20 maker
here #1750 (comment) this is probably why this check was not needed in eth code.P.S. I think watchers code needs a lot of refactors to separate it from default swap case logic.
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.
IIRC, all watcher tests were passing with old testnet environment but started to fail after switching to dockerized Geth.
send_contract_reward_on_spend
can be true inget_maker_watcher_reward
ifother_coin.is_eth()
:komodo-defi-framework/mm2src/coins/eth.rs
Line 2052 in 8635ed9
And when it's true, the contract attempts to send additional ETH, which isn't available on its balance. With this change, the reward ETH is also transferred to a contract during payment, making ETH/ERC20 watcher tests pass.
I agree with this. My goal was to make tests green and learn ETH watchers code/understand it better. It seems that
RewardTarget
andsend_contract_reward_on_spend
can be removed to handle most of the logic on smart contract side. I would like to either work on it myself in the future or guide the developer who will take the task.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.
Yeah, missed this since I was looking for cases with
RewardTarget::PaymentReceive
as looking forNone
case is not logical.Sure. Thanks a lot for offering your help on this :)