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

feat: support assets with xyk dot pools as fee asset #852

Merged
merged 108 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from 106 commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
7a3aa9b
add initial implementation for support of insufficient asset in DCA
dmoka Jun 27, 2024
ade2364
adjust integration tests
dmoka Jun 27, 2024
3df4ea8
remove todo as we have DOT as defalt xyk pool for insufficietn asset …
dmoka Jun 27, 2024
512ec26
adjust comment
dmoka Jun 27, 2024
feb0291
adjust doc
dmoka Jun 27, 2024
ca8019b
simplify code
dmoka Jun 27, 2024
da8894f
fix support of insufficient asset with calculating unallocated amount…
dmoka Jul 2, 2024
f67d292
clean up in tests
dmoka Jul 2, 2024
6c36f1d
cleaning up
dmoka Jul 3, 2024
e5a309a
adjust dca benchmarking with adding extra bench functions for insuffi…
dmoka Jul 3, 2024
76bc16c
regenerate benchmark on ref machine
dmoka Jul 3, 2024
4182960
fix tests
dmoka Jul 4, 2024
612ad01
increase weight based on if the fee asset is insufficient or not
dmoka Jul 4, 2024
80180f6
adjust schedule benchmark for insufficient asset
dmoka Jul 5, 2024
2645109
rebenchmark palle on reference machine
dmoka Jul 5, 2024
94f8319
formatting
dmoka Jul 5, 2024
5ec9de1
Merge remote-tracking branch 'origin/master' into feat/support-insuff…
dmoka Jul 8, 2024
7434df2
make clippy happy
dmoka Jul 8, 2024
a1da41a
formatting
dmoka Jul 8, 2024
66a0d2e
bump versions
dmoka Jul 8, 2024
a776fa9
refactoring
dmoka Jul 8, 2024
678551c
remove done todo
dmoka Jul 8, 2024
f1a6873
add support for general insufficient fee asset
dmoka Jul 12, 2024
7299ec4
support insuffucient asset as fee when ED is payed for receiving insu…
dmoka Jul 16, 2024
103c841
add comment
dmoka Jul 16, 2024
1ef01f4
handle errors gracefully
dmoka Jul 16, 2024
820cd3f
done todo
dmoka Jul 16, 2024
37105ea
fix error handling
dmoka Jul 16, 2024
ee27d24
Merge remote-tracking branch 'origin/master' into feat/support-insuff…
dmoka Jul 24, 2024
24f64c2
fix tests as they failed due to the the dca schedule block delay
dmoka Jul 24, 2024
528f6a2
Merge remote-tracking branch 'origin/master' into feat/support-insuff…
dmoka Jul 24, 2024
f4c5c29
update lock
dmoka Jul 24, 2024
0358124
formatting
dmoka Jul 24, 2024
a0c8319
update comment
dmoka Jul 24, 2024
768d3a5
refactor to remove xyk and asset registry coupling for the pallets
dmoka Jul 25, 2024
bb9be93
remove unnecessary intos
dmoka Jul 29, 2024
dfcf21d
remove unnecessary intos
dmoka Jul 29, 2024
5ec0c33
replace fee traits to better place
dmoka Jul 29, 2024
dd7fa9b
remove done todos
dmoka Jul 29, 2024
311a76a
fix compilation error
dmoka Jul 29, 2024
b8bbd33
clean up
dmoka Jul 29, 2024
928fdf8
add correct max limit for buying dot in multi pallet
dmoka Jul 29, 2024
5ac18d2
use insufficient asset support in SufficiencyCheck to remove duplication
dmoka Jul 29, 2024
b0dd86e
formatting
dmoka Jul 29, 2024
5764cdd
add comments
dmoka Jul 29, 2024
77e5a87
remove unnecessary into 32 conversion
dmoka Jul 29, 2024
218da40
renaming
dmoka Jul 29, 2024
6cab9f7
renaming
dmoka Jul 29, 2024
185e1ee
Merge remote-tracking branch 'origin/master' into feat/support-insuff…
dmoka Jul 29, 2024
2ac456d
make clippy happy
dmoka Jul 29, 2024
7fc6808
delete unused method
dmoka Jul 29, 2024
1eabcce
fix benchmark tests because HDX needs to be initialized to be suffici…
dmoka Jul 30, 2024
be7e3ac
refactoring
dmoka Jul 30, 2024
7f8e603
renaming
dmoka Jul 30, 2024
01a6120
renaming
dmoka Jul 30, 2024
0effd7b
refactoring for better readability
dmoka Jul 30, 2024
a4c5683
renawming
dmoka Jul 30, 2024
7f03319
remove unnecessary bound
dmoka Jul 30, 2024
da5f144
add dest as last param as it makes more sense
dmoka Jul 30, 2024
7f1493c
renaming
dmoka Jul 30, 2024
25f3ac1
formatting
dmoka Jul 30, 2024
3799d4a
Merge remote-tracking branch 'origin/master' into feat/support-insuff…
dmoka Jul 30, 2024
5d7b4f2
Merge remote-tracking branch 'origin/master' into feat/support-insuff…
dmoka Jul 30, 2024
a98e37b
bump versions
dmoka Jul 30, 2024
1c4dd3a
wip - add new benchmarking for transfer
dmoka Jul 31, 2024
74b2e9a
update orml benchmark tests as the worst case is when the user transf…
dmoka Jul 31, 2024
77e80e2
remove todos as irrelevant
dmoka Aug 1, 2024
6bc1650
formatting
dmoka Aug 1, 2024
1483a79
renaming
dmoka Aug 1, 2024
635e32b
rebenchmark pallets on ref machine
dmoka Aug 1, 2024
071e2d2
adjust benchmark to have worst case for setting currency
dmoka Aug 1, 2024
7438df5
rebenchmark multipayment as setting currency should be the worst case…
dmoka Aug 1, 2024
24f137d
renaming
dmoka Aug 1, 2024
b8c63a8
fix failing test as benchmark changed
dmoka Aug 1, 2024
33e7cbc
bump runtime version
dmoka Aug 1, 2024
0450333
make clippy happy
dmoka Aug 1, 2024
8671d2d
make clippy happy
dmoka Aug 1, 2024
ce52ca4
Merge remote-tracking branch 'origin/master' into feat/support-insuff…
dmoka Aug 9, 2024
c92171f
bump runtime
dmoka Aug 9, 2024
615d370
Merge remote-tracking branch 'origin/master' into feat/support-insuff…
dmoka Aug 21, 2024
dd8347d
update lock file
dmoka Aug 21, 2024
1db0246
add support for sufficiebnt but non feee payment asset
dmoka Aug 21, 2024
81ada93
renaming
dmoka Aug 21, 2024
e02529e
adjusting non fee payment interfaces
dmoka Aug 21, 2024
f1a6a84
formatting
dmoka Aug 21, 2024
dab4709
renaming
dmoka Aug 21, 2024
ea76841
formatting
dmoka Aug 21, 2024
d0bc0f9
add test for non accepted fee payment currency
dmoka Aug 21, 2024
5b2742c
fix multi payment tests
dmoka Aug 21, 2024
7a58880
formatting
dmoka Aug 21, 2024
85801b7
fix compilation error
dmoka Aug 22, 2024
43d8bce
invert condition to make it more readable
dmoka Aug 22, 2024
7871af4
formatting
dmoka Aug 22, 2024
2a0ea7e
bump runtime version
dmoka Aug 22, 2024
d1ef157
increase base extrinsic weight as we do xyk swap in withdraw fee
dmoka Aug 30, 2024
d21d20e
rebenchmark multi pallet
dmoka Aug 30, 2024
015a59b
make clippy happy
dmoka Aug 30, 2024
c0b9a6c
formatting
dmoka Aug 30, 2024
69dc06e
renaming
dmoka Aug 30, 2024
d439818
Merge remote-tracking branch 'origin/master' into feat/support-insuff…
dmoka Aug 30, 2024
77f3e1e
formatting
dmoka Aug 30, 2024
1776b26
fix test coming from renaming
dmoka Sep 2, 2024
68d7739
Merge remote-tracking branch 'origin/master' into feat/support-insuff…
dmoka Sep 13, 2024
d762e4f
update lock file
dmoka Sep 13, 2024
55a65d8
Merge remote-tracking branch 'origin/master' into feat/support-insuff…
dmoka Sep 23, 2024
f54aeef
update cargo
dmoka Sep 23, 2024
9d541f3
bump versions
dmoka Sep 23, 2024
63eb0d9
renaming
dmoka Sep 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "runtime-integration-tests"
version = "1.23.4"
version = "1.23.5"
description = "Integration tests"
authors = ["GalacticCouncil"]
edition = "2021"
Expand All @@ -24,6 +24,7 @@ pallet-stableswap = { workspace = true }
pallet-referrals = { workspace = true }
pallet-asset-registry = { workspace = true }
hydradx-traits = { workspace = true }
hydra-dx-math = { workspace = true }
pallet-transaction-multi-payment = { workspace = true, features = ["evm"] }
pallet-currencies = { workspace = true }
pallet-duster = { workspace = true }
Expand Down Expand Up @@ -138,6 +139,7 @@ pallet-relaychain-info = { workspace = true }
xcm-emulator = { workspace = true }
test-utils = { workspace = true }
libsecp256k1 = { workspace = true }
proptest = "1.5.0"


[features]
Expand Down
10 changes: 7 additions & 3 deletions integration-tests/src/cross_chain_transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,13 @@ fn claim_trapped_asset_should_work() {
claim_asset(asset.clone(), bob_loc);

Hydra::execute_with(|| {
assert_eq!(
hydradx_runtime::Tokens::free_balance(1, &AccountId::from(BOB)),
1_029_939_717_395_149 //1000 * UNITS + 30 * UNITS - fee
let fee = hydradx_runtime::Tokens::free_balance(LRNA, &hydradx_runtime::Treasury::account_id());
assert!(fee > 0, "treasury should have received fees");

let bob_new_lrna_balance = hydradx_runtime::Tokens::free_balance(LRNA, &AccountId::from(BOB));
assert!(
bob_new_lrna_balance > BOB_INITIAL_LRNA_BALANCE,
"Bob should have received the claimed trapped asset"
);

let origin = MultiLocation::new(1, X1(Junction::Parachain(ACALA_PARA_ID)));
Expand Down
Loading
Loading