mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 11:41:02 +00:00
* Use into_account_truncating Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * more truncating * more truncating * more * clean up parachain primitives * more truncating * update lockfile for {"substrate"} Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: parity-processbot <>
This commit is contained in:
committed by
GitHub
parent
2907a7aeae
commit
157b5186ba
@@ -40,4 +40,7 @@ std = [
|
||||
"xcm/std",
|
||||
"xcm-executor/std",
|
||||
]
|
||||
runtime-benchmarks = []
|
||||
runtime-benchmarks = [
|
||||
"frame-system/runtime-benchmarks",
|
||||
"xcm-builder/runtime-benchmarks",
|
||||
]
|
||||
|
||||
@@ -1074,7 +1074,7 @@ pub mod pallet {
|
||||
|
||||
pub fn check_account() -> T::AccountId {
|
||||
const ID: PalletId = PalletId(*b"py/xcmch");
|
||||
AccountIdConversion::<T::AccountId>::into_account(&ID)
|
||||
AccountIdConversion::<T::AccountId>::into_account_truncating(&ID)
|
||||
}
|
||||
|
||||
fn do_new_query(
|
||||
|
||||
@@ -36,8 +36,10 @@ const SEND_AMOUNT: u128 = 10;
|
||||
|
||||
#[test]
|
||||
fn report_outcome_notify_works() {
|
||||
let balances =
|
||||
vec![(ALICE, INITIAL_BALANCE), (ParaId::from(PARA_ID).into_account(), INITIAL_BALANCE)];
|
||||
let balances = vec![
|
||||
(ALICE, INITIAL_BALANCE),
|
||||
(ParaId::from(PARA_ID).into_account_truncating(), INITIAL_BALANCE),
|
||||
];
|
||||
let sender = AccountId32 { network: AnyNetwork::get(), id: ALICE.into() }.into();
|
||||
let mut message = Xcm(vec![TransferAsset {
|
||||
assets: (Here, SEND_AMOUNT).into(),
|
||||
@@ -96,8 +98,10 @@ fn report_outcome_notify_works() {
|
||||
|
||||
#[test]
|
||||
fn report_outcome_works() {
|
||||
let balances =
|
||||
vec![(ALICE, INITIAL_BALANCE), (ParaId::from(PARA_ID).into_account(), INITIAL_BALANCE)];
|
||||
let balances = vec![
|
||||
(ALICE, INITIAL_BALANCE),
|
||||
(ParaId::from(PARA_ID).into_account_truncating(), INITIAL_BALANCE),
|
||||
];
|
||||
let sender = AccountId32 { network: AnyNetwork::get(), id: ALICE.into() }.into();
|
||||
let mut message = Xcm(vec![TransferAsset {
|
||||
assets: (Here, SEND_AMOUNT).into(),
|
||||
@@ -148,8 +152,10 @@ fn report_outcome_works() {
|
||||
/// Asserts that the expected message is sent and the event is emitted
|
||||
#[test]
|
||||
fn send_works() {
|
||||
let balances =
|
||||
vec![(ALICE, INITIAL_BALANCE), (ParaId::from(PARA_ID).into_account(), INITIAL_BALANCE)];
|
||||
let balances = vec![
|
||||
(ALICE, INITIAL_BALANCE),
|
||||
(ParaId::from(PARA_ID).into_account_truncating(), INITIAL_BALANCE),
|
||||
];
|
||||
new_test_ext_with_balances(balances).execute_with(|| {
|
||||
let sender: MultiLocation =
|
||||
AccountId32 { network: AnyNetwork::get(), id: ALICE.into() }.into();
|
||||
@@ -185,8 +191,10 @@ fn send_works() {
|
||||
/// Asserts that `send` fails with `Error::SendFailure`
|
||||
#[test]
|
||||
fn send_fails_when_xcm_router_blocks() {
|
||||
let balances =
|
||||
vec![(ALICE, INITIAL_BALANCE), (ParaId::from(PARA_ID).into_account(), INITIAL_BALANCE)];
|
||||
let balances = vec![
|
||||
(ALICE, INITIAL_BALANCE),
|
||||
(ParaId::from(PARA_ID).into_account_truncating(), INITIAL_BALANCE),
|
||||
];
|
||||
new_test_ext_with_balances(balances).execute_with(|| {
|
||||
let sender: MultiLocation =
|
||||
Junction::AccountId32 { network: AnyNetwork::get(), id: ALICE.into() }.into();
|
||||
@@ -212,8 +220,10 @@ fn send_fails_when_xcm_router_blocks() {
|
||||
/// local effects.
|
||||
#[test]
|
||||
fn teleport_assets_works() {
|
||||
let balances =
|
||||
vec![(ALICE, INITIAL_BALANCE), (ParaId::from(PARA_ID).into_account(), INITIAL_BALANCE)];
|
||||
let balances = vec![
|
||||
(ALICE, INITIAL_BALANCE),
|
||||
(ParaId::from(PARA_ID).into_account_truncating(), INITIAL_BALANCE),
|
||||
];
|
||||
new_test_ext_with_balances(balances).execute_with(|| {
|
||||
let weight = 2 * BaseXcmWeight::get();
|
||||
assert_eq!(Balances::total_balance(&ALICE), INITIAL_BALANCE);
|
||||
@@ -253,8 +263,10 @@ fn teleport_assets_works() {
|
||||
/// local effects.
|
||||
#[test]
|
||||
fn limmited_teleport_assets_works() {
|
||||
let balances =
|
||||
vec![(ALICE, INITIAL_BALANCE), (ParaId::from(PARA_ID).into_account(), INITIAL_BALANCE)];
|
||||
let balances = vec![
|
||||
(ALICE, INITIAL_BALANCE),
|
||||
(ParaId::from(PARA_ID).into_account_truncating(), INITIAL_BALANCE),
|
||||
];
|
||||
new_test_ext_with_balances(balances).execute_with(|| {
|
||||
let weight = 2 * BaseXcmWeight::get();
|
||||
assert_eq!(Balances::total_balance(&ALICE), INITIAL_BALANCE);
|
||||
@@ -295,8 +307,10 @@ fn limmited_teleport_assets_works() {
|
||||
/// local effects.
|
||||
#[test]
|
||||
fn unlimmited_teleport_assets_works() {
|
||||
let balances =
|
||||
vec![(ALICE, INITIAL_BALANCE), (ParaId::from(PARA_ID).into_account(), INITIAL_BALANCE)];
|
||||
let balances = vec![
|
||||
(ALICE, INITIAL_BALANCE),
|
||||
(ParaId::from(PARA_ID).into_account_truncating(), INITIAL_BALANCE),
|
||||
];
|
||||
new_test_ext_with_balances(balances).execute_with(|| {
|
||||
let weight = 2 * BaseXcmWeight::get();
|
||||
assert_eq!(Balances::total_balance(&ALICE), INITIAL_BALANCE);
|
||||
@@ -335,8 +349,10 @@ fn unlimmited_teleport_assets_works() {
|
||||
/// is increased. Verifies the correct message is sent and event is emitted.
|
||||
#[test]
|
||||
fn reserve_transfer_assets_works() {
|
||||
let balances =
|
||||
vec![(ALICE, INITIAL_BALANCE), (ParaId::from(PARA_ID).into_account(), INITIAL_BALANCE)];
|
||||
let balances = vec![
|
||||
(ALICE, INITIAL_BALANCE),
|
||||
(ParaId::from(PARA_ID).into_account_truncating(), INITIAL_BALANCE),
|
||||
];
|
||||
new_test_ext_with_balances(balances).execute_with(|| {
|
||||
let weight = BaseXcmWeight::get();
|
||||
let dest: MultiLocation =
|
||||
@@ -352,7 +368,7 @@ fn reserve_transfer_assets_works() {
|
||||
// Alice spent amount
|
||||
assert_eq!(Balances::free_balance(ALICE), INITIAL_BALANCE - SEND_AMOUNT);
|
||||
// Destination account (parachain account) has amount
|
||||
let para_acc: AccountId = ParaId::from(PARA_ID).into_account();
|
||||
let para_acc: AccountId = ParaId::from(PARA_ID).into_account_truncating();
|
||||
assert_eq!(Balances::free_balance(para_acc), INITIAL_BALANCE + SEND_AMOUNT);
|
||||
assert_eq!(
|
||||
sent_xcm(),
|
||||
@@ -381,8 +397,10 @@ fn reserve_transfer_assets_works() {
|
||||
/// is increased. Verifies the correct message is sent and event is emitted.
|
||||
#[test]
|
||||
fn limited_reserve_transfer_assets_works() {
|
||||
let balances =
|
||||
vec![(ALICE, INITIAL_BALANCE), (ParaId::from(PARA_ID).into_account(), INITIAL_BALANCE)];
|
||||
let balances = vec![
|
||||
(ALICE, INITIAL_BALANCE),
|
||||
(ParaId::from(PARA_ID).into_account_truncating(), INITIAL_BALANCE),
|
||||
];
|
||||
new_test_ext_with_balances(balances).execute_with(|| {
|
||||
let weight = BaseXcmWeight::get();
|
||||
let dest: MultiLocation =
|
||||
@@ -399,7 +417,7 @@ fn limited_reserve_transfer_assets_works() {
|
||||
// Alice spent amount
|
||||
assert_eq!(Balances::free_balance(ALICE), INITIAL_BALANCE - SEND_AMOUNT);
|
||||
// Destination account (parachain account) has amount
|
||||
let para_acc: AccountId = ParaId::from(PARA_ID).into_account();
|
||||
let para_acc: AccountId = ParaId::from(PARA_ID).into_account_truncating();
|
||||
assert_eq!(Balances::free_balance(para_acc), INITIAL_BALANCE + SEND_AMOUNT);
|
||||
assert_eq!(
|
||||
sent_xcm(),
|
||||
@@ -428,8 +446,10 @@ fn limited_reserve_transfer_assets_works() {
|
||||
/// is increased. Verifies the correct message is sent and event is emitted.
|
||||
#[test]
|
||||
fn unlimited_reserve_transfer_assets_works() {
|
||||
let balances =
|
||||
vec![(ALICE, INITIAL_BALANCE), (ParaId::from(PARA_ID).into_account(), INITIAL_BALANCE)];
|
||||
let balances = vec![
|
||||
(ALICE, INITIAL_BALANCE),
|
||||
(ParaId::from(PARA_ID).into_account_truncating(), INITIAL_BALANCE),
|
||||
];
|
||||
new_test_ext_with_balances(balances).execute_with(|| {
|
||||
let weight = BaseXcmWeight::get();
|
||||
let dest: MultiLocation =
|
||||
@@ -446,7 +466,7 @@ fn unlimited_reserve_transfer_assets_works() {
|
||||
// Alice spent amount
|
||||
assert_eq!(Balances::free_balance(ALICE), INITIAL_BALANCE - SEND_AMOUNT);
|
||||
// Destination account (parachain account) has amount
|
||||
let para_acc: AccountId = ParaId::from(PARA_ID).into_account();
|
||||
let para_acc: AccountId = ParaId::from(PARA_ID).into_account_truncating();
|
||||
assert_eq!(Balances::free_balance(para_acc), INITIAL_BALANCE + SEND_AMOUNT);
|
||||
assert_eq!(
|
||||
sent_xcm(),
|
||||
@@ -473,8 +493,10 @@ fn unlimited_reserve_transfer_assets_works() {
|
||||
/// is increased. Verifies the expected event is emitted.
|
||||
#[test]
|
||||
fn execute_withdraw_to_deposit_works() {
|
||||
let balances =
|
||||
vec![(ALICE, INITIAL_BALANCE), (ParaId::from(PARA_ID).into_account(), INITIAL_BALANCE)];
|
||||
let balances = vec![
|
||||
(ALICE, INITIAL_BALANCE),
|
||||
(ParaId::from(PARA_ID).into_account_truncating(), INITIAL_BALANCE),
|
||||
];
|
||||
new_test_ext_with_balances(balances).execute_with(|| {
|
||||
let weight = 3 * BaseXcmWeight::get();
|
||||
let dest: MultiLocation =
|
||||
|
||||
Reference in New Issue
Block a user