Rename Statemint to Asset Hub (#2633)

* change dir names

* cargo toml updates

* fix crate imports for build

* change chain spec names and PR review rule

* update cli to accept asset-hub

* find/replace benchmark commands

* integration tests

* bridges docs

* more integration tests

* AuraId

* other statemint tidying

* rename statemint mod

* chain spec mod

* rename e2e test dirs

* one more Runtime::Statemine

* benchmark westmint

* rename chain spec name and id

* rename chain spec files

* more tidying in scripts/docs/tests

* rename old dir if exists

* Force people to manually do the move.

(Safer as there could be additional considerations with their setup)

* review touchups

* more renaming

* Update polkadot-parachain/src/command.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* better error message

* do not break on-chain spec_name

* log info message that path has been renamed

* better penpal docs

---------

Co-authored-by: gilescope <gilescope@gmail.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: parity-processbot <>
This commit is contained in:
joe petrowski
2023-06-02 11:58:19 +02:00
committed by GitHub
parent cad48b7136
commit 6007549589
161 changed files with 1123 additions and 1025 deletions
@@ -0,0 +1,145 @@
---
settings:
chains:
relay_chain: &relay_chain
wsPort: 9900
assets_parachain: &assets_parachain
wsPort: 9910
paraId: &ap_id 1000
penpal_parachain: &penpal_parachain
wsPort: 9920
paraId: &pp_id 2000
variables:
common:
xcm_version: &xcm_version 3
require_weight_at_most: &weight_at_most {refTime: 1000000000, proofSize: 200000}
weight_threshold: &weight_threshold { refTime: [10, 10], proofSize: [10, 10] }
chains:
relay_chain:
signer: &rc_signer //Alice
assets_parachain_destination: &ap_dest { v3: { 0, interior: { x1: { parachain: *ap_id }}}}
penpal_parachain:
signer: &pp_signer //Alice
decodedCalls:
ap_force_xcm_version:
chain: *assets_parachain
pallet: polkadotXcm
call: forceXcmVersion
args: [
{ # location
parents: 1,
interior: Here
},
*xcm_version # xcmVersion
]
tests:
- name: Initialize Chains
its:
- name: XCM supported versions between chains
actions:
- extrinsics: # Relay Chain sets supported version for Asset Parachain
- chain: *relay_chain
sudo: true
signer: *rc_signer
pallet: xcmPallet
call: forceXcmVersion
args: [
{ # location
parents: 0,
interior: {
X1: {
Parachain: *ap_id
}
}
},
*xcm_version # xcmVersion
]
events:
- name: sudo.Sudid
result: { sudoResult: Ok }
- name: xcmPallet.SupportedVersionChanged
result: [{ parents: 0, interior: { X1: { Parachain: *ap_id }}}, *xcm_version ]
- extrinsics: # Relay Chain sets supported version for Penpal Parachain
- chain: *relay_chain
sudo: true
signer: *rc_signer
pallet: xcmPallet
call: forceXcmVersion
args: [
{ # location
parents: 0,
interior: {
X1: {
Parachain: *pp_id
}
}
},
*xcm_version # xcmVersion
]
events:
- name: sudo.Sudid
result: { sudoResult: Ok }
- name: xcmPallet.SupportedVersionChanged
result: [{ parents: 0, interior: { X1: { Parachain: *pp_id }}}, *xcm_version ]
- extrinsics: # Asset Parachain sets supported version for Relay Chain through it
- chain: *relay_chain
signer: *rc_signer
sudo: true
pallet: xcmPallet
call: send
args: [
*ap_dest, # destination
{
v3: [ #message
{
UnpaidExecution: {
weightLimit: {
limited: {
refTime: 2200000000,
proofSize: 200000
}
}
}
},
{
Transact: {
originKind: Superuser,
requireWeightAtMost: *weight_at_most,
call: $ap_force_xcm_version
}
}
]
}
]
events:
- name: sudo.Sudid
result: { sudoResult: Ok }
- name: xcmPallet.Sent
- name: dmpQueue.ExecutedDownward
chain: *assets_parachain
threshold: *weight_threshold
result: {
outcome: { Complete: { refTime: '1,019,210,000', proofSize: '200,000' }}
}
- name: polkadotXcm.SupportedVersionChanged
chain: *assets_parachain
result: [{ parents: 1, interior: Here }, *xcm_version ]
- extrinsics: # Penpal Parachain sets supported version for Relay Chain
- chain: *penpal_parachain
signer: *pp_signer
sudo: true
pallet: polkadotXcm
call: forceXcmVersion
args: [
{ # location
parents: 1,
interior: Here
},
*xcm_version # xcmVersion
]
events:
- name: sudo.Sudid
result: { sudoResult: Ok }
- name: polkadotXcm.SupportedVersionChanged
result: [{ parents: 1, interior: Here }, *xcm_version ]
@@ -0,0 +1,267 @@
---
settings:
chains:
relay_chain: &relay_chain
wsPort: 9900
assets_parachain: &assets_parachain
wsPort: 9910
paraId: &ap_id 1000
variables:
common:
weight_threshold: &weight_threshold { refTime: [10, 10], proofSize: [10, 10] }
chains:
relay_chain:
signer: &rc_signer //Alice
wallet: &rc_wallet HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F
assets_parachain_destination: &ap_dest { v3: { parents: 0, interior: { x1: { parachain: *ap_id }}}}
assets_parachain_account: &ap_acc '0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d'
assets_parachain_beneficiary: &ap_benf { v3: { parents: 0, interior: { x1: { accountId32: { id: *ap_acc }}}}}
ksm: &rc_ksm { concrete: { parents: 0, interior: { here: true }}}
amount: &amount 1000000000000
ksm_fungible: &rc_ksm_fungible { id: *rc_ksm, fun: { fungible: *amount }}
require_weight_at_most: &rc_weight_at_most { refTime: 1000000000, proofSize: 200000 }
assets_parachain_account:
wallet: &ap_wallet HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F
asset_id: &asset_id 1
asset_min_balance: &asset_ed 1000
decodedCalls:
force_create_asset:
chain: *assets_parachain
pallet: assets
call: forceCreate
args: [
*asset_id,
{ Id: *ap_wallet }, # owner
true, # isSufficient
*asset_ed # minBalance
]
tests:
- name: DMP
its: []
describes:
- name: xcmPallet.limitedTeleportAssets
before: &before_get_balances
- name: Get the balances of the Relay Chain's sender & Assets Parachain's receiver
actions:
- queries:
balance_rc_sender_before:
chain: *relay_chain
pallet: system
call: account
args: [ *rc_wallet ]
balance_ap_receiver_before:
chain: *assets_parachain
pallet: system
call: account
args: [ *ap_wallet ]
its:
- name: Should teleport native assets from the Relay Chain to the Assets Parachain
actions:
- extrinsics:
- chain: *relay_chain
signer: *rc_signer
pallet: xcmPallet
call: limitedTeleportAssets
args: [
*ap_dest, # destination
*ap_benf, # beneficiary
{ v3: [ *rc_ksm_fungible ] },
0, # feeAssetItem
{ unlimited: true } # weightLimit
]
events:
- name: xcmPallet.Attempted
threshold: *weight_threshold
result: [{ Complete: { refTime: '764,772,000', proofSize: 0 }}]
- name: dmpQueue.ExecutedDownward
chain: *assets_parachain
threshold: *weight_threshold
result: {
outcome: { Complete: { refTime: '166,944,000', proofSize: 0 }}
}
- queries:
balance_rc_sender_after:
chain: *relay_chain
pallet: system
call: account
args: [ *rc_wallet ]
balance_ap_receiver_after:
chain: *assets_parachain
pallet: system
call: account
args: [ *ap_wallet ]
- name: Should reduce the balance of the sender
actions:
- asserts:
balanceDecreased:
args: [
{
balances: {
before: $balance_rc_sender_before,
after: $balance_rc_sender_after,
},
amount: *amount
}
]
- name: Should increase the balance of the receiver
actions:
- asserts:
balanceIncreased:
args: [
{
balances: {
before: $balance_ap_receiver_before,
after: $balance_ap_receiver_after,
}
}
]
- name: xcmPallet.send | Superuser - Transact(assets.forceCreate)
its:
- name: Relay Chain Superuser account SHOULD be able to execute a XCM Transact instruction in the Assets Parachain
actions:
- extrinsics:
- chain: *relay_chain
signer: *rc_signer
sudo: true
pallet: xcmPallet
call: send
args: [
*ap_dest, # destination
{
v3: [ #message
{
UnpaidExecution: {
weightLimit: Unlimited
}
},
{
Transact: {
originKind: Superuser,
requireWeightAtMost: *rc_weight_at_most,
call: $force_create_asset
}
}
]
}
]
events:
- name: xcmPallet.Sent
- name: dmpQueue.ExecutedDownward
chain: *assets_parachain
threshold: *weight_threshold
result: {
outcome: { Complete: { refTime: '1,014,103,000', proofSize: '200,000' }}
}
- queries:
forced_created_asset:
chain: *assets_parachain
pallet: assets
call: asset
args: [ *asset_id ]
- asserts:
isSome:
args: [ $forced_created_asset ]
- name: xcmPallet.send | Native - Transact(assets.forceCreate)
its:
- name: Relay Chain Native account SHOULD NOT be able to execute a XCM Transact instruction in the Assets Parachain
actions:
- extrinsics:
- chain: *relay_chain
signer: *rc_signer
pallet: xcmPallet
call: send
args: [
*ap_dest, # destination
{
v3: [ #message
{
UnpaidExecution: {
weightLimit: Unlimited
}
},
{
Transact: {
originKind: Native,
requireWeightAtMost: *rc_weight_at_most,
call: $force_create_asset
}
}
]
}
]
events:
- name: system.ExtrinsicFailed
result: { dispatchError: BadOrigin }
- name: xcmPallet.limitedReserveTransferAssets
before: *before_get_balances
its:
- name: SHOULD NOT reserved transfer native assets from the Relay Chain to the Assets Parachain
actions:
- extrinsics:
- chain: *relay_chain
signer: *rc_signer
pallet: xcmPallet
call: limitedReserveTransferAssets
args: [
*ap_dest, # destination
*ap_benf, # beneficiary
{ v3: [ *rc_ksm_fungible ] }, # assets
0, # feeAssetItem
{ unlimited: true } # weightLimit
]
events:
- name: xcmPallet.Attempted
threshold: *weight_threshold
result: [{ Complete: { refTime: '750,645,000', proofSize: 0 }}]
- name: dmpQueue.ExecutedDownward
chain: *assets_parachain
threshold: *weight_threshold
result: {
outcome: {
Incomplete: [
{ refTime: '1,000,000,000', proofSize: 0 },
UntrustedReserveLocation
]
}
}
- queries:
balance_rc_sender_after:
chain: *relay_chain
pallet: system
call: account
args: [ *rc_wallet ]
balance_ap_receiver_after:
chain: *assets_parachain
pallet: system
call: account
args: [ *ap_wallet ]
- name: Should reduce the balance of the sender
actions:
- asserts:
balanceDecreased:
args: [
{
balances: {
before: $balance_rc_sender_before,
after: $balance_rc_sender_after,
},
amount: *amount
}
]
- name: Should keep the balance of the receiver
actions:
- asserts:
equal:
args:
[
$balance_ap_receiver_before,
$balance_ap_receiver_after
]
@@ -0,0 +1,193 @@
---
settings:
chains:
relay_chain: &relay_chain
wsPort: 9900
assets_parachain: &assets_parachain
wsPort: 9910
paraId: &ap_id 1000
variables:
common:
amount: &amount 1000000000000
require_weight_at_most: &weight_at_most {refTime: 1000000000, proofSize: 0}
weight_threshold: &weight_threshold { refTime: [10, 10], proofSize: [10, 10] }
chains:
relay_chain:
signer: &rc_signer //Alice
wallet: &rc_wallet HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F #Alice
assets_parachain_destination: &ap_dest { v3: { 0, interior: { x1: { parachain: *ap_id }}}}
assets_parachain_account: &ap_acc '0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d'
assets_parachain_beneficiary: &ap_benf {v3: { parents: 0, interior: { x1: { accountId32: { id: *ap_acc }}}}}
ksm: &rc_ksm { concrete: { 0, interior: { here: true }}}
ksm_fungible: &rc_ksm_fungible { id: *rc_ksm, fun: { fungible: *amount }}
assets_parachain_account:
signer: &ap_signer //Alice
wallet: &ap_wallet HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F
relay_chain_destination: &rc_dest { v3: { parents: 1, interior: { here: true }}}
assets_parachain_account: &rc_acc '0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d' #Alice
relay_chain_beneficiary: &rc_benf {v3: { parents: 0, interior: { x1: { accountId32: { id: *rc_acc }}}}}
ksm: &ap_ksm { concrete: { parents: 1, interior: { here: true }}}
ksm_fungible: &ap_ksm_fungible { id: *ap_ksm, fun: { fungible: *amount }}
decodedCalls:
system_remark:
chain: *relay_chain
pallet: system
call: remark
args: [ 0x0011 ]
tests:
- name: UMP
describes:
- name: polkadotXcm.limitedTeleportAssets
before:
- name: DEPENDENCY | Do a 'limitedTeleportAssets' from the Relay Chain to the Assets Parachain to have funds to send them back
actions:
- extrinsics:
- chain: *relay_chain
signer: *rc_signer
pallet: xcmPallet
call: limitedTeleportAssets
args: [
*ap_dest, # destination
*ap_benf, # beneficiary
{ v3: [ *rc_ksm_fungible ] }, # assets
0, # feeAssetItem
{ unlimited: true } # weightLimit
]
events:
- name: xcmPallet.Attempted
threshold: *weight_threshold
result: [{ Complete: { refTime: '761,173,000', proofSize: 0 }}]
- name: dmpQueue.ExecutedDownward
chain: *assets_parachain
threshold: *weight_threshold
result: {
outcome: { Complete: { refTime: '166,944,000', proofSize: 0 }}
}
- name: Get the balances of the Assets Parachain's sender & Relay Chain's receiver
actions:
- queries:
balance_ap_sender_before:
chain: *assets_parachain
pallet: system
call: account
args: [ *ap_wallet ]
balance_rc_receiver_before:
chain: *relay_chain
pallet: system
call: account
args: [ *rc_wallet ]
its:
- name: Should teleport native assets back from Assets Parachain to the Relay Chain
actions:
- extrinsics:
- chain: *assets_parachain
signer: *ap_signer
pallet: polkadotXcm
call: limitedTeleportAssets
args: [
*rc_dest, # destination
*rc_benf, # beneficiary
{ v3: [ *ap_ksm_fungible ] }, # assets
0, # feeAssetItem
{ unlimited: true } # weightLimit
]
events:
- name: polkadotXcm.Attempted
threshold: *weight_threshold
result: [{ Complete: { refTime: '539,494,000', proofSize: '7,133' }}]
- name: ump.ExecutedUpward
chain: *relay_chain
threshold: *weight_threshold
result: [{ Complete: { refTime: '298,716,000', proofSize: 0 }}]
- queries:
balance_ap_sender_after:
chain: *assets_parachain
pallet: system
call: account
args: [ *ap_wallet ]
balance_rc_receiver_after:
chain: *relay_chain
pallet: system
call: account
args: [ *rc_wallet ]
- name: Should reduce the balance of the sender
actions:
- asserts:
balanceDecreased:
args: [
{
balances: {
before: $balance_ap_sender_before,
after: $balance_ap_sender_after,
},
amount: *amount
}
]
- name: Should increase the balance of the receiver
actions:
- asserts:
balanceIncreased:
args: [
{
balances: {
before: $balance_rc_receiver_before,
after: $balance_rc_receiver_after,
}
}
]
- name: polkadotXcm.send | Native - Transact(system.remark)
its:
- name: Assets Parachain SHOULD NOT be able to dispatch 'send' call
actions:
- extrinsics:
- chain: *assets_parachain
signer: *ap_signer
pallet: polkadotXcm
call: send
args: [
*rc_dest, # destination
{
v3: [ #message
{
UnpaidExecution: {
weightLimit: Unlimited
}
},
{
Transact: {
originKind: Native,
requireWeightAtMost: *weight_at_most,
call: $system_remark
}
}
]
}
]
events:
- name: system.ExtrinsicFailed
result: { dispatchError: BadOrigin }
- name: polkadotXcm.limitedReserveTransferAssets
its:
- name: Should NOT be able to reserve transfer native assets from the Assets Parachain to the Relay Chain
actions:
- extrinsics:
- chain: *assets_parachain
signer: *ap_signer
pallet: polkadotXcm
call: limitedReserveTransferAssets
args: [
*rc_dest, # destination
*rc_benf, # beneficiary
{ v3: [ *ap_ksm_fungible ] }, # assets
0, # feeAssetItem
{ unlimited: true } # weightLimit
]
events:
- name: polkadotXcm.Attempted
result: [{ Error: Barrier }]
@@ -0,0 +1,122 @@
---
settings:
chains:
relay_chain: &relay_chain
wsPort: 9900
assets_parachain:
wsPort: 9910
paraId: &ap_id 1000
penpal_parachain:
wsPort: 9920
paraId: &pp_id 2000
variables:
common:
amount: &amount 2000000000000
hrmp_channels:
proposed_max_capacity: &max_capacity 8
proposed_max_message_size: &max_message_size 8192
channel: &channel {
maxCapacity: *max_capacity,
maxTotalSize: *max_message_size,
maxMessageSize: *max_message_size,
msgCount: 0,
totalSize: 0,
mqcHead: null,
senderDeposit: 0,
recipientDeposit: 0
}
chains:
relay_chain:
signer: &rc_signer //Alice
assets_parachain_account:
sovereign_account: &ap_sovereign F7fq1jSNVTPfJmaHaXCMtatT1EZefCUsa7rRiQVNR5efcah
penpal_parachain:
sovereign_account: &pp_sovereign F7fq1jMZkfuCuoMTyiEVAP2DMpMt18WopgBqTJznLihLNbZ
tests:
- name: HRMP
beforeEach:
- name: DEPENDENCY | Penpal Parachain Sovereign account in the Relay Chain needs to be funded
actions:
- extrinsics:
- chain: *relay_chain
signer: *rc_signer
pallet: balances
call: transfer
args: [
*pp_sovereign, # destination
*amount, # value
]
events:
- name: balances.Transfer
- name: DEPENDENCY | Assets Parachain Sovereign account in the Relay Chain needs to be funded
actions:
- extrinsics:
- chain: *relay_chain
signer: *rc_signer
pallet: balances
call: transfer
args: [
*ap_sovereign, # destination
*amount, # value
]
events:
- name: balances.Transfer
describes:
- name: hrmp.forceOpenHrmpChannel (Penpal Parachain → Assets Parachain)
its:
- name: Open Penpal Parachain to Assets Parachain
actions:
- extrinsics:
- chain: *relay_chain
signer: *rc_signer
sudo: true
pallet: hrmp
call: forceOpenHrmpChannel
args: [
*pp_id,
*ap_id,
*max_capacity,
*max_message_size
]
events:
- name: sudo.Sudid
result: { sudoResult: Ok }
- name: hrmp.HrmpChannelForceOpened
- name: hrmp.forceOpenHrmpChannel (Assets Parachain → PenPal Parachain)
its:
- name: Open Assets Parachain to PenPal Parachain
actions:
- extrinsics:
- chain: *relay_chain
signer: *rc_signer
sudo: true
pallet: hrmp
call: forceOpenHrmpChannel
args: [
*ap_id,
*pp_id,
*max_capacity,
*max_message_size
]
events:
- name: sudo.Sudid
result: { sudoResult: Ok }
- name: hrmp.HrmpChannelForceOpened
- name: hrmp.forceProcessHrmpOpen (make sure all the channels are open)
its:
- name: Make sure all the pending channels are open
actions:
- extrinsics:
- chain: *relay_chain
signer: *rc_signer
sudo: true
pallet: hrmp
call: forceProcessHrmpOpen
args: [ 2 ]
events:
- name: sudo.Sudid
result: { sudoResult: Ok }
@@ -0,0 +1,390 @@
---
# Note: This tests depends on the 3_hrmp-open-channels.yml for opening channels, otherwise teleports aren't going to
# work.
settings:
chains:
relay_chain: &relay_chain
wsPort: 9900
assets_parachain: &assets_parachain
wsPort: 9910
paraId: &ap_id 1000
penpal_parachain: &penpal_parachain
wsPort: 9920
paraId: &pp_id 2000
variables:
common:
mint_amount: &mint_amount 1000000000000
amount: &amount 100000000000
require_weight_at_most: &weight_at_most {refTime: 1200000000, proofSize: 20000}
amount_to_send: &amount_to_send 500000000000
weight_threshold: &weight_threshold { refTime: [10, 10], proofSize: [10, 10] }
chains:
relay_chain:
signer: &rc_signer //Alice
assets_parachain_destination: &ap_dest { v3: { 0, interior: { x1: { parachain: *ap_id }}}}
assets_parachain_dest_routed: &ap_dest_routed { v3: { parents: 1, interior: { x1: { parachain: *ap_id } }}}
assets_parachain_account:
signer: &ap_signer //Alice
wallet: &ap_wallet HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F
asset_id: &asset_id 2
assets_pallet_id: &assets_pallet_id 50
asset_min_balance: &asset_ed 1000
penpal_parachain_destination: &pp_dest { v3: { parents: 1, interior: { x1: { parachain: *pp_id } }}}
ksm: &ap_ksm { concrete: { parents: 1, interior: { here: true }}}
ksm_fungible: &ap_ksm_fungible { id: *ap_ksm, fun: { fungible: *amount }}
suff_asset: &suff_asset { concrete: { parents: 0, interior: { x2: [ { PalletInstance: *assets_pallet_id }, { GeneralIndex: *asset_id } ] }}}
suff_asset_fail: &suff_asset_fail { concrete: { parents: 0, interior: { x2: [ { PalletInstance: *assets_pallet_id }, { GeneralIndex: 3 } ] }}}
suff_asset_fungible_fail: &ap_suff_asset_fungible_fail { id: *suff_asset_fail, fun: { fungible: 200000000000 }}
penpal_parachain:
sovereign_account: &pp_sovereign_sibl FBeL7EAeUroLWXW1yfKboiqTqVfbRBcsUKd6QqVf4kGBySS
signer: &pp_signer //Alice
penpal_parachain_account: &pp_acc '0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d'
decodedCalls:
force_create_asset:
chain: *assets_parachain
pallet: assets
call: forceCreate
args: [
*asset_id,
{ Id: *ap_wallet }, # owner
true, # isSufficient
*asset_ed # minBalance
]
force_create_asset2:
chain: *assets_parachain
pallet: assets
call: forceCreate
args: [
*asset_id,
{ Id: *ap_wallet }, # owner
true, # isSufficient
*asset_ed # minBalance
]
tests:
- name: HRMP
describes:
- name: polkadotXcm.limitedReserveTransferAssets (Asset) | Assets Parachain -> Penpal Parachain
before:
- name: DEPENDENCY | A sufficient Asset should exist in the Assets Parachain
actions:
- extrinsics:
- chain: *relay_chain
signer: *rc_signer
sudo: true
pallet: xcmPallet
call: send
args: [
*ap_dest, # destination
{
v3: [ #message
{
UnpaidExecution: {
weightLimit: Unlimited
}
},
{
SetTopic: '0x0123456789012345678901234567891201234567890123456789012345678912'
},
{
Transact: {
originKind: Superuser,
requireWeightAtMost: *weight_at_most,
call: $force_create_asset
}
}
]
}
]
events:
- name: xcmPallet.Sent
- name: dmpQueue.ExecutedDownward
chain: *assets_parachain
threshold: *weight_threshold
result: {
outcome: { Complete: { refTime: '1,216,703,000', proofSize: '20,000' }}
}
- queries:
forced_created_asset:
chain: *assets_parachain
pallet: assets
call: asset
args: [ *asset_id ]
- asserts:
isSome:
args: [ $forced_created_asset ]
- name: DEPENDENCY | Some Assets should be minted for the sender
actions:
- extrinsics:
- chain: *assets_parachain
signer: *ap_signer
pallet: assets
call: mint
args: [
*asset_id,
*ap_wallet,
*mint_amount
]
events:
- name: assets.Issued
result: { assetId: *asset_id, owner: *ap_wallet, amount: *mint_amount }
its:
- name: Assets Parachain should be able to reserve transfer an Asset to Penpal Parachain
actions:
- extrinsics:
- chain: *assets_parachain
signer: *ap_signer
pallet: polkadotXcm
call: limitedReserveTransferAssets
args: [
*pp_dest, # destination
{ # beneficiary
V3: {
parents: 0,
interior: {
X1: {
AccountId32: {
id: *pp_acc
}
}
}
}
},
{ # assets
V3: [
{
id: {
Concrete: {
parents: 0,
interior: {
X2: [
{
PalletInstance: *assets_pallet_id
},
{
GeneralIndex: *asset_id
}
]
}
}
},
fun: {
Fungible: *amount_to_send
}
}
]
},
0, # feeAssetItem
Unlimited # weightLimit
]
events:
- name: polkadotXcm.Attempted
threshold: *weight_threshold
result: [{ Complete: { refTime: '679,150,000', proofSize: '6,196' }}]
- name: assets.Transferred
result: {
assetId: *asset_id,
from: *ap_wallet,
to: *pp_sovereign_sibl,
amount: *amount_to_send
}
- name: polkadotXcm.limitedReserveTransferAssets (KSM) | Assets Parachain -> Penpal Parachain
its:
- name: Assets Parachain should be able to reserve transfer KSM to Penpal Parachain
actions:
- extrinsics:
- chain: *assets_parachain
signer: *ap_signer
pallet: polkadotXcm
call: limitedReserveTransferAssets
args: [
*pp_dest, # destination
{ # beneficiary
V3: {
parents: 0,
interior: {
X1: {
AccountId32: {
id: *pp_acc
}
}
}
}
},
{ # assets
V3: [
*ap_ksm_fungible
]
},
0, # feeAssetItem
Unlimited # weightLimit
]
events:
- name: polkadotXcm.Attempted
threshold: *weight_threshold
result: [{ Complete: { refTime: '679,150,000', proofSize: '6,196' }}]
- name: balances.Endowed
result: {
account: *pp_sovereign_sibl,
freeBalance: *amount
}
- name: polkadotXcm.send( assets.forceCreateAsset ) | Penpal Parachain -> Assets Parachain
before:
- name: Get the asset balance of the Penpal Parachain Sovereign account in Assets Parachain
actions:
- queries:
assets_balance_pp_sovereign_before:
chain: *assets_parachain
pallet: assets
call: account
args: [
*asset_id,
*pp_sovereign_sibl
]
its:
- name: Penpal Parachain should be able to send XCM message paying its fee with sufficient asset in Assets Parachain
actions:
- extrinsics:
- chain: *penpal_parachain
signer: *pp_signer
sudo: true
pallet: polkadotXcm
call: send
args: [
*ap_dest_routed, # destination
{
v3: [ #message
{
WithdrawAsset: [
{
id: {
concrete: {
parents: 0,
interior: {
X2: [
{ PalletInstance: *assets_pallet_id },
{ GeneralIndex: *asset_id }
]
}
}
},
fun: { fungible: *amount }}
]
},
{
BuyExecution: {
fees: { id: *suff_asset, fun: { fungible: *amount }},
weightLimit: Unlimited
}
},
{
Transact: {
originKind: SovereignAccount,
requireWeightAtMost: *weight_at_most,
call: $force_create_asset2
}
},
{
RefundSurplus
},
{
DepositAsset: {
assets: { Wild: All },
beneficiary: {
parents: 0,
interior: {
X1: {
AccountId32: {
network: , # None
id: *pp_acc
}
}
}}
}
}
]
}
]
events:
- name: sudo.Sudid
result: { sudoResult: Ok }
- name: polkadotXcm.Sent
- name: assets.Burned
chain: *assets_parachain
result: { assetId: *asset_id, owner: *pp_sovereign_sibl }
- name: assets.Issued
chain: *assets_parachain
result: { assetId: *asset_id }
- queries:
assets_balance_pp_sovereign_after:
chain: *assets_parachain
pallet: assets
call: account
args: [
*asset_id,
*pp_sovereign_sibl
]
forced_created_asset2:
chain: *assets_parachain
pallet: assets
call: asset
args: [ 3 ]
- asserts:
isSome:
args: [ $forced_created_asset2 ]
- name: Should reduce the assets balance of the Penpal Parachain's SovereignAccount in the Assets Parachain
actions:
- asserts:
assetsDecreased:
args: [
{
balances: {
before: $assets_balance_pp_sovereign_before,
after: $assets_balance_pp_sovereign_after,
},
}
]
- name: Penpal Parachain SHOULD NOT be able to send XCM message paying its fee with sufficient assets if not enough balance
actions:
- extrinsics:
- chain: *penpal_parachain
signer: *pp_signer
sudo: true
pallet: polkadotXcm
call: send
args: [
*ap_dest_routed, # destination
{
v3: [ #message
{
WithdrawAsset: [*ap_suff_asset_fungible_fail]
},
{
BuyExecution: {
fees: *ap_suff_asset_fungible_fail,
weightLimit: Unlimited
}
},
{
Transact: {
originKind: SovereignAccount,
requireWeightAtMost: *weight_at_most,
call: $force_create_asset2
}
}
]
}
]
events:
- name: xcmpQueue.Fail
chain: *assets_parachain
threshold: *weight_threshold
result: {
error: FailedToTransactAsset,
weight: { refTime: '152,426,000', proofSize: '3,593' }
}