Skip to content

Commit

Permalink
Slp add XCM weight parameters (#1098)
Browse files Browse the repository at this point in the history
* Slp optimises XCM weight parameters

* Optimising code

* Add construct xcm test
  • Loading branch information
hqwangningbo authored Dec 12, 2023
1 parent da311d6 commit 62ca63e
Show file tree
Hide file tree
Showing 16 changed files with 527 additions and 110 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

54 changes: 41 additions & 13 deletions integration-tests/bifrost-kusama/src/slp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ fn transfer_back() {
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
Box::new(EXIT_ACCOUNT_MULTILOCATION),
50 * KSM_DECIMALS,
None
));
});

Expand Down Expand Up @@ -462,7 +463,8 @@ fn bond_works() {
RelayCurrencyId::get(),
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
50 * KSM_DECIMALS,
None
None,
None,
));
});

Expand Down Expand Up @@ -510,7 +512,8 @@ fn bond_extra_works() {
RelayCurrencyId::get(),
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
50 * KSM_DECIMALS,
None
None,
None,
));
});
BifrostKusama::execute_with(|| {
Expand All @@ -521,6 +524,7 @@ fn bond_extra_works() {
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
None,
20 * KSM_DECIMALS,
None
));
});

Expand Down Expand Up @@ -562,7 +566,8 @@ fn unbond_works() {
RelayCurrencyId::get(),
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
50 * KSM_DECIMALS,
None
None,
None,
));
});

Expand All @@ -586,6 +591,7 @@ fn unbond_works() {
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
None,
20 * KSM_DECIMALS,
None
));
});

Expand Down Expand Up @@ -625,7 +631,8 @@ fn unbond_all_works() {
RelayCurrencyId::get(),
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
50 * KSM_DECIMALS,
None
None,
None,
));
});

Expand All @@ -642,6 +649,7 @@ fn unbond_all_works() {
RuntimeOrigin::signed(AccountId::from(ALICE)),
RelayCurrencyId::get(),
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
None
));
});

Expand Down Expand Up @@ -677,7 +685,8 @@ fn rebond_works() {
RelayCurrencyId::get(),
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
50 * KSM_DECIMALS,
None
None,
None,
));
});

Expand All @@ -691,7 +700,8 @@ fn rebond_works() {
RelayCurrencyId::get(),
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
None,
30 * KSM_DECIMALS
30 * KSM_DECIMALS,
None
));
});

Expand All @@ -707,6 +717,7 @@ fn rebond_works() {
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
None,
Some(20 * KSM_DECIMALS),
None
));
});

Expand Down Expand Up @@ -757,7 +768,8 @@ fn delegate_works() {
RelayCurrencyId::get(),
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
50 * KSM_DECIMALS,
None
None,
None,
));
});

Expand All @@ -774,6 +786,7 @@ fn delegate_works() {
RelayCurrencyId::get(),
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
vec![KUSAMA_ALICE_STASH_MULTILOCATION, KUSAMA_BOB_STASH_MULTILOCATION],
None
));
});

Expand Down Expand Up @@ -806,7 +819,8 @@ fn undelegate_works() {
RelayCurrencyId::get(),
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
50 * KSM_DECIMALS,
None
None,
None,
));
});

Expand All @@ -820,6 +834,7 @@ fn undelegate_works() {
RelayCurrencyId::get(),
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
vec![KUSAMA_ALICE_STASH_MULTILOCATION, KUSAMA_BOB_STASH_MULTILOCATION],
None
));
});

Expand All @@ -834,6 +849,7 @@ fn undelegate_works() {
RelayCurrencyId::get(),
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
vec![KUSAMA_ALICE_STASH_MULTILOCATION],
None
));
});

Expand All @@ -859,7 +875,8 @@ fn redelegate_works() {
RelayCurrencyId::get(),
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
50 * KSM_DECIMALS,
None
None,
None,
));
});

Expand All @@ -873,6 +890,7 @@ fn redelegate_works() {
RelayCurrencyId::get(),
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
vec![KUSAMA_ALICE_STASH_MULTILOCATION, KUSAMA_BOB_STASH_MULTILOCATION],
None
));
});

Expand All @@ -887,6 +905,7 @@ fn redelegate_works() {
RelayCurrencyId::get(),
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
vec![KUSAMA_ALICE_STASH_MULTILOCATION],
None
));
});

Expand All @@ -899,7 +918,8 @@ fn redelegate_works() {
RuntimeOrigin::signed(AccountId::from(ALICE)),
RelayCurrencyId::get(),
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
Some(vec![KUSAMA_ALICE_STASH_MULTILOCATION, KUSAMA_BOB_STASH_MULTILOCATION])
Some(vec![KUSAMA_ALICE_STASH_MULTILOCATION, KUSAMA_BOB_STASH_MULTILOCATION]),
None
));
});

Expand Down Expand Up @@ -929,7 +949,8 @@ fn payout_works() {
RelayCurrencyId::get(),
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
Box::new(KUSAMA_ALICE_STASH_MULTILOCATION),
Some(TimeUnit::Era(27))
Some(TimeUnit::Era(27)),
None
));
});
}
Expand All @@ -944,7 +965,8 @@ fn liquidize_works() {
RelayCurrencyId::get(),
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
50 * KSM_DECIMALS,
None
None,
None,
));
});

Expand All @@ -958,6 +980,7 @@ fn liquidize_works() {
RelayCurrencyId::get(),
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
vec![KUSAMA_ALICE_STASH_MULTILOCATION, KUSAMA_BOB_STASH_MULTILOCATION],
None
));
});

Expand All @@ -971,7 +994,8 @@ fn liquidize_works() {
RelayCurrencyId::get(),
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
None,
20 * KSM_DECIMALS
20 * KSM_DECIMALS,
None
));
});

Expand Down Expand Up @@ -1002,6 +1026,7 @@ fn liquidize_works() {
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
Some(TimeUnit::SlashingSpan(5)),
None,
None,
None
));
});
Expand Down Expand Up @@ -1034,6 +1059,7 @@ fn chill_works() {
RelayCurrencyId::get(),
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
50 * KSM_DECIMALS,
None,
None
));
});
Expand All @@ -1044,6 +1070,7 @@ fn chill_works() {
RelayCurrencyId::get(),
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
vec![KUSAMA_ALICE_STASH_MULTILOCATION, KUSAMA_BOB_STASH_MULTILOCATION],
None
));
});

Expand All @@ -1066,6 +1093,7 @@ fn chill_works() {
RuntimeOrigin::signed(AccountId::from(ALICE)),
RelayCurrencyId::get(),
Box::new(KSM_DELEGATOR_0_MULTILOCATION),
None
));
});

Expand Down
Loading

0 comments on commit 62ca63e

Please sign in to comment.