forked from jl777/SuperNET
-
Notifications
You must be signed in to change notification settings - Fork 114
feat(swap): add utxo/cosmos/ARRR pre-burn address output #2112
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
Merged
Merged
Changes from 120 commits
Commits
Show all changes
141 commits
Select commit
Hold shift + click to select a range
f3625e5
make mockable optional
d3f843d
add support for utxo coin burn account to dex fee
bc5c005
Merge branch 'dev' into burn-dex-fee-for-non-kmd
7894f7d
remove left over dup dex_fee_rate()
2984c67
fix coins crate mocktopus dependency for mm2_main crate tests
128c4b4
fix dex fee changed due to new burn output in couple of lp_swap tests
23f2a08
fix swap v2 test non-kmd burn output
2c810b0
fix fmt
af45b71
remove comment
0e2869e
Merge branch 'dev' into burn-dex-fee-for-non-kmd
0f34d2e
Merge branch 'dev' into burn-dex-fee-for-non-kmd
d53dc37
fix zombie chain scan block num
81263e0
add burn output for privacy coin,
7719b80
Merge branch 'dev' into burn-dex-fee-for-non-kmd
9331e40
use custom log! instead debug! (as env_logger disabled) in qrc20 dock…
b343275
fix to make should_burn_dex_fee explicitly in each coin (to fix qrc20…
587b1ae
restore original test log message
58d84cf
add test for std dex fee for zcoin
1243935
remove unused cache dir var in z_coin init block
bc00ee8
fix clippy
4d59545
fix burn addr in ZOutput
dc9e710
refactor dex fee code;
7a2399c
refactor dex fee code to eliminate extra if-else
4625554
Merge branch 'dev' into burn-dex-fee-for-non-kmd
b84b3a9
fix comments (by review notes)
35b04a2
refactor var names on review notes
8b1033e
refactor fee_amount var names to dex_fee (as those are structs)
1a48a04
add test for qtum dex fee with burn output validation
06e36b5
remove todo for qrc20 with burn test (as we decided not to add evm bu…
1e79216
fix fn should_burn_dex_fee uninmlemented for solana
9fd47a4
fix restore cach_db_path (deleted by mistake)
217a313
fix review notes: delete unused fn, add cfg for test code
f35be00
fix review: add test from todo
26552c3
add NegotiationDataMsg V4 with version field, add swap features activ…
c02253a
add non-kmd burn activation with negotiation msg V4
fd5b4fe
Merge branch 'dev' into burn-dex-fee-for-non-kmd
22b5c42
added NegotiationDataMsgVersion, removed NegotiationDataV4 (bcz V2 is…
9951626
fix activation ver
d72a313
Merge branch 'dev' into burn-dex-fee-for-non-kmd
a63c3e0
fix after merge
983d8ef
remove relaxed dex fee validation (in favour versioned check)
849b190
add mocktopus to mm2_main
8e2fdaf
fix version in recreate swap
b844318
fix node version determination: try versioned then old negotiation me…
ddb4863
add test feature to emulate old non-versioned negotiation msgs (also …
9a34268
fix fmt
f8b543b
fix swap tx spend size
44a2586
move version activation swap_feature mod to coins (to allow using it …
e6fe67f
add delay between broadcasts of new and old messages
b20e679
fix old (non-versioned) taker and maker emulation (for tests)
e930f58
fix swap proto version: use new topic for versioned negotiation (Swap…
80d34f6
fix comment
5cc210e
add DexFee::NoFee option support for utxo if taker is dex pubkey (dex…
69cbfa4
add tests for swap v1 mycoin to mycoin with dex pubkey as Alice (to t…
248536a
fix tests to validate fee and recreate swaps
b0fabcf
fix DexFee::NoFee taker payment spending outputs for swaps V2
f6cc684
fix tests for no dex fee for swaps v1, add tests for no dex fee for s…
7053e2e
fix TODO for delay in broadcast msgs
1def60d
fixes for review notes
74d8ea3
fixes for review notes
bc560b8
Merge branch 'dev' into burn-dex-fee-for-non-kmd
c4b494a
Merge branch 'dev' into burn-dex-fee-for-non-kmd
347093d
Merge branch 'dev' into burn-dex-fee-for-non-kmd
f95b91e
add dex fee burning for tendermint coins
e19b738
fix should_burn_dex_fee to true and burn_pubkey for validate dex fee …
446b3db
add mockable support for TendermintCoin (note: some TendermintCoin co…
8aa7a06
refactor validate_taker_fee_test with mocked txns
53a553f
add test to validate taker fee tx with burn for tendermint
2f47bdc
add test to calc DexFee with burn for nucleus ticker
a61d4a0
Refactor dex fee code:
63ecd0b
Merge branch 'dev' into burn-dex-fee-for-non-kmd
29ad460
fix await in zhtlc tests
2ea8b9f
add TODO zhtlc feature
ab4f2a5
fix fmt
8711131
add comments how to run zcoin native tests
bf65293
add print into tests with hint how to sync wallet db
5f0d3d6
add debug logging for updating zcoin wallet db
b3eccf8
add scan interval in zcoin tests to prevent 'Can't assign requested a…
d5b9bbd
Merge branch 'dev' into burn-dex-fee-for-non-kmd
b92d065
fix review notes
601519d
fix build err
05feb72
add swap feature deactivation by version
ce1a5e0
improve comments for protocol version
dcfdbbd
fix burn_pubkey as taker in DexFee::NoFee;
dfb9673
fix fmt
2559e0e
fix tests with burn key as taker
70a8bd0
add real burn addr pubkey
shamardy 0a36a09
Merge branch 'dev' into burn-dex-fee-for-non-kmd
51b58d7
fix: remove compatibility with old swap nodes (no need this anymore)
1e24dcf
fix test to reject too old nodes
ea4d046
temp disable burn dex fee for zcoin
f321ac0
fix tendermint test burn tx
afb417e
del temp tx hex logging
9a801c2
remove old comment
ab96ba8
remove unused code to broadcast multiple msgs
bbe2b5b
fix after merge (remove solana src)
897aa4d
refactor (laruh): rename version fields
e4e8de0
remove negotiation msg version (to be impl in a different way)
0b37b10
remove unused features
de4394f
refactor test mock def, removed unused mockable
af3762b
cargo fmt
de079ba
add test helper (mariocynicys)
a505386
review (borngraced): dex fee errors improved, make value underflow ch…
019209f
review (mariocynicys): refactor dex fee dust handling
d7e18d4
review (borngraced): use as_ref for tendermint address
30a13fa
review (mariocynicys): add dex_address, burn_address fn for utxo
4b1b867
add flavor multithread to zcoin tests
1dcb774
update zcoin txns for real dex and burn address
114cfe9
Merge branch 'dev' into burn-dex-fee-for-non-kmd
78033be
clear version leftovers in test files
89e23ae
remove unused const
40ef614
remove unused error
2fcda6c
removed unused AddressDerivationPath
0cab109
eliminated dex_fee_from_taker_coin
2ef2bb6
delete oneinch leftover file
07986cb
review (mariocynicys): move TestCoin to for-tests feature, use for-te…
56f13b2
review (mariocynicys): add taker_pubkey_bytes fn to CommonSwapOpsV2 f…
8513c3f
add doc to DEX_FEE_ADDR_PUBKEY
05488f9
add more sepolia nodes for tests
703e887
Merge branch 'dev' into burn-dex-fee-for-non-kmd
2873ac3
review (laruh): fix taker swap v2 check balance (add dexfee), refacto…
0198dba
fix after refactor: revert dex_fee for dust check
8c8c335
review (mariocynicys): refactor TEST_BURN_ADDR_RAW_PUBKEY as lazy_static
d86ee02
Merge branch 'dev' into burn-dex-fee-for-non-kmd
0f9ed06
review: add const to should_burn_dex_fee
7c335aa
disable burning non kmd dex fee (use standard dex fee) until swap com…
acc3b7e
fix should_burn_dex_fee for sia coin
12b7bb1
refactor (laruh) dexfee and burn outputs creation
473930c
refactor dexfee (shamardy mariocynicys): move dexfee for dust check i…
8f9065a
refactor dexfee (shamardy): add new DexFee::new_with_taker_pubkey to …
356eaad
Merge branch 'dev' into burn-dex-fee-for-non-kmd
5a09169
refactor: eliminate else in dexfee calc
6200833
fix actual z burn address
3cddd92
Merge branch 'dev' into burn-dex-fee-for-non-kmd
74202d3
fix after merge
87a1e49
rename dex fee fn for maker
7ace910
Merge branch 'dev' into burn-dex-fee-for-non-kmd
1ed4af7
fix after merge: fix mockable parse error
d953e6c
Merge branch 'dev' into burn-dex-fee-for-non-kmd
shamardy 101b69f
fix mac-dylib-x86-64 dev build issue
shamardy d886fd8
add x86_64-apple-darwin target
shamardy 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
maybe we could add it as a
for-testfeature.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 think the way like it is now is convenient as we may use mocktopus both from tests inside the crate and from other crates, without extra features, and at the same time avoiding building it into releases
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.
from tests inside the crate -> dev-deps section
from tests from outside/integration ->
for-testflag to activate it, this has the downside though as u said will enable all and every extra test features we have, but it's a for-test build anyway so i wouldn't worry much about that and instead prioritize having less complexcfgs around the code base.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 think, in this case mocktopus would be built into release what is not recommended for performance reasons.
The optional flag is a way to avoid this.
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.
im going over my old comments before reviewing so excuse me if things changed and aren't relevant anymore, you can resolve them then.
No it wouldn't make it to
release. It will only get included whenfor-testis enabled.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.
As can see, feature 'for-tests' is used to activate certain test code in certain packages.
We may or may not need mocktopus with this test code.
Also, with this approach, if we decide to use mocktopus in other dependency packages we would need to define an extra 'for-tests' feature there, instead simply using features=["mocktopus"]
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.
if we don't need it, then it's a bloat. but who cares, that's a for-test build of mm2 no body will use it.
no, we can simply use
features=["for-tests"]just like (instead of)feautres=["mocktopus"].my problem is that having so many features gets things complicated. and these features aren't even real features that get baked into release, they are only test used features.
why have a feature
xto bake this functionality into mm2 and another featureyto bake another functionality and so on. and only activate featuresxwhen we are running from this testing crate, and only activateywhen we are doing that.we can instead have a
build-mm2-with-all-test-features/for-testfeature to enable all the functionalities we need for testing from wherever.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.
To use mocktopus in some subpackage with 'for-tests' you would need to define 'for-tests' in each such subpackage (if it was not defined yet there), although dep:mocktopus is natively defined, w/o extra config and ready-to use.
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.
im lost in the convo, but this is what i mean, might be clearer in code: d5d2bbd
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.
Yes, this is what I meant too:
For e.g. there is a new trading_api package where mocktopus is activated from mm2_main:
https://github.com/KomodoPlatform/komodo-defi-framework/blob/ff0eefcdccfa9b48161052ed95d8185220ba2cbd/mm2src/mm2_main/Cargo.toml#L132
Doing it this way it's no need to define an extra [for-tests] feature in trading_api