Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

wip: upgrade statemine/t integration tests to xcm v3 #2224

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
71 changes: 44 additions & 27 deletions parachains/integration-tests/statemine/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,64 @@ default_command = "./bin/polkadot"
default_args = [ "-lparachain=debug" ]
chain = "kusama-local"

[[relaychain.nodes]]
name = "alice"
ws_port = 9900
validator = true
[[relaychain.nodes]]
name = "alice"
ws_port = 9900
validator = true

[[relaychain.nodes]]
name = "bob"
validator = true
[[relaychain.nodes]]
name = "bob"
ws_port = 9901
validator = true

[[relaychain.nodes]]
name = "charlie"
validator = true
[[relaychain.nodes]]
name = "charlie"
ws_port = 9902
validator = true

[[relaychain.nodes]]
name = "dave"
validator = true
[[relaychain.nodes]]
name = "dave"
ws_port = 9903
validator = true

[[parachains]]
id = 1000
chain = "statemine-local"
cumulus_based = true

[[parachains.collators]]
name = "collator1"
ws_port = 9910
command = "./bin/polkadot-parachain"
[[parachains.collators]]
name = "collator1"
ws_port = 9910
command = "./bin/polkadot-parachain"

[[parachains.collators]]
name = "collator2"
command = "./bin/polkadot-parachain"
[[parachains.collators]]
name = "collator2"
ws_port = 9911
command = "./bin/polkadot-parachain"

[[parachains]]
id = 2000
chain = "penpal-kusama-2000"
cumulus_based = true

[[parachains.collators]]
name = "collator3"
ws_port = 9920
command = "./bin/polkadot-parachain"
[[parachains.collators]]
name = "collator3"
ws_port = 9920
command = "./bin/polkadot-parachain"

[[parachains.collators]]
name = "collator4"
command = "./bin/polkadot-parachain"
[[parachains.collators]]
name = "collator4"
ws_port = 9921
command = "./bin/polkadot-parachain"

# [[hrmpChannels]]
# sender = 1000
# recipient = 2000
# maxCapacity = 8
# maxMessageSize = 8192

# [[hrmpChannels]]
# sender = 2000
# recipient = 1000
# maxCapacity = 8
# maxMessageSize = 8192
72 changes: 41 additions & 31 deletions parachains/integration-tests/statemine/xcm/0_init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ settings:
paraId: &pp_id 2000
variables:
common:
xcm_verison: &xcm_version '2'
require_weight_at_most: &weight_at_most 1000000000
xcm_version: &xcm_version '3'
require_weight_at_most: &weight_at_most {refTime: 1000000000, proofSize: 200000}
chains:
relay_chain:
signer: &rc_signer //Alice
assets_parachain_destination: &ap_dest { v1: { 0, interior: { x1: { parachain: *ap_id }}}}
assets_parachain_destination: &ap_dest { v3: { 0, interior: { x1: { parachain: *ap_id }}}}
penpal_parachain:
signer: &pp_signer //Alice
decodedCalls:
Expand All @@ -37,7 +37,7 @@ tests:
its:
- name: XCM supported versions between chains
actions:
- extrinsics: # Relay Chain sets supported version for Assset Parachain
- extrinsics: # Relay Chain sets supported version for Asset Parachain
- chain: *relay_chain
sudo: true
signer: *rc_signer
Expand All @@ -56,13 +56,13 @@ tests:
]
events:
- name: sudo.Sudid
attribute:
type: Result<Null, SpRuntimeDispatchError>
value: Ok
attributes:
- type: Result<Null, SpRuntimeDispatchError>
value: Ok
- name: xcmPallet.SupportedVersionChanged
attribute:
type: u32
value: *xcm_version
attributes:
- type: u32
value: *xcm_version
- extrinsics: # Relay Chain sets supported version for Penpal Parachain
- chain: *relay_chain
sudo: true
Expand All @@ -82,14 +82,14 @@ tests:
]
events:
- name: sudo.Sudid
attribute:
type: Result<Null, SpRuntimeDispatchError>
value: Ok
attributes:
- type: Result<Null, SpRuntimeDispatchError>
value: Ok
- name: xcmPallet.SupportedVersionChanged
attribute:
type: u32
value: *xcm_version
- extrinsics: # Assset Parachain sets supported version for Relay Chain through it
attributes:
- type: u32
value: *xcm_version
- extrinsics: # Asset Parachain sets supported version for Relay Chain through it
- chain: *relay_chain
signer: *rc_signer
sudo: true
Expand All @@ -98,10 +98,20 @@ tests:
args: [
*ap_dest, # destination
{
v2: [ #message
v3: [ #message
{
UnpaidExecution: {
weightLimit: {
limited: {
refTime: 2200000000,
proofSize: 200000
}
}
}
},
{
Transact: {
originType: Superuser,
originKind: Superuser,
requireWeightAtMost: *weight_at_most,
call: $ap_force_xcm_version
}
Expand All @@ -111,15 +121,15 @@ tests:
]
events:
- name: sudo.Sudid
attribute:
type: Result<Null, SpRuntimeDispatchError>
value: Ok
attributes:
- type: Result<Null, SpRuntimeDispatchError>
value: Ok
- name: xcmPallet.Sent
- name: polkadotXcm.SupportedVersionChanged
chain: *assets_parachain
attribute:
type: u32
value: *xcm_version
attributes:
- type: u32
value: *xcm_version
- extrinsics: # Penpal Parachain sets supported version for Relay Chain
- chain: *penpal_parachain
signer: *pp_signer
Expand All @@ -135,10 +145,10 @@ tests:
]
events:
- name: sudo.Sudid
attribute:
type: Result<Null, SpRuntimeDispatchError>
value: Ok
attributes:
- type: Result<Null, SpRuntimeDispatchError>
value: Ok
- name: polkadotXcm.SupportedVersionChanged
attribute:
type: u32
value: *xcm_version
attributes:
- type: u32
value: *xcm_version
81 changes: 47 additions & 34 deletions parachains/integration-tests/statemine/xcm/1_dmp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ settings:
relay_chain:
signer: &rc_signer //Alice
wallet: &rc_wallet HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F
assets_parachain_destination: &ap_dest { v1: { parents: 0, interior: { x1: { parachain: *ap_id }}}}
assets_parachain_destination: &ap_dest { v3: { parents: 0, interior: { x1: { parachain: *ap_id }}}}
assets_parachain_account: &ap_acc '0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d'
assets_parachain_beneficiary: &ap_benf {v1: { parents: 0, interior: { x1: { accountId32: { network: { any: true }, id: *ap_acc }}}}}
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 1000000000
require_weight_at_most: &rc_weight_at_most {refTime: 1000000000, proofSize: 200000}
assets_parachain_account:
wallet: &ap_wallet HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F
asset_id: &asset_id 1
Expand Down Expand Up @@ -63,22 +63,24 @@ tests:
args: [
*ap_dest, # destination
*ap_benf, # beneficiary
{ v1: [ *rc_ksm_fungible ] }, # assets
{ v3: [ *rc_ksm_fungible ] },
0, # feeAssetItem
{ unlimited: true } # weightLimit
]
events:
- name: xcmPallet.Attempted
attribute:
type: XcmV2TraitsOutcome
isComplete: true
attributes:
- type: XcmV3TraitsOutcome
# xcmOutcome: Complete
- name: dmpQueue.ExecutedDownward
chain: *assets_parachain
attribute:
type: XcmV2TraitsOutcome
isComplete: true
threshold: [10, 10]
value: 1,021,973,000
attributes:
- type: XcmV3TraitsOutcome
# xcmOutcome: Complete
# threshold: [10, 10]
# value: "100"
value: {"Complete":{"refTime":"1,010,034,000","proofSize":"0"}}
#{"Complete":{"refTime":"1010034000","proofSize":"0"}}
- queries:
balance_rc_sender_after:
chain: *relay_chain
Expand Down Expand Up @@ -131,10 +133,15 @@ tests:
args: [
*ap_dest, # destination
{
v2: [ #message
v3: [ #message
{
UnpaidExecution: {
weightLimit: Unlimited
}
},
{
Transact: {
originType: Superuser,
originKind: Superuser,
requireWeightAtMost: *rc_weight_at_most,
call: $force_create_asset
}
Expand All @@ -146,11 +153,11 @@ tests:
- name: xcmPallet.Sent
- name: dmpQueue.ExecutedDownward
chain: *assets_parachain
attribute:
type: XcmV2TraitsOutcome
isComplete: true
threshold: [10, 10]
value: 1,021,258,000
attributes:
- type: XcmV3TraitsOutcome
# xcmOutcome: Complete
# threshold: [10, 10]
value: {"Complete":{"refTime":"1,014,103,000","proofSize":"200,000"}}
- queries:
forced_created_asset:
chain: *assets_parachain
Expand All @@ -173,10 +180,15 @@ tests:
args: [
*ap_dest, # destination
{
v2: [ #message
v3: [ #message
{
UnpaidExecution: {
weightLimit: Unlimited
}
},
{
Transact: {
originType: Native,
originKind: Native,
requireWeightAtMost: *rc_weight_at_most,
call: $force_create_asset
}
Expand All @@ -186,9 +198,9 @@ tests:
]
events:
- name: system.ExtrinsicFailed
attribute:
type: SpRuntimeDispatchError
value: BadOrigin
attributes:
- type: SpRuntimeDispatchError
value: BadOrigin

- name: xcmPallet.limitedReserveTransferAssets
before: *before_get_balances
Expand All @@ -203,23 +215,24 @@ tests:
args: [
*ap_dest, # destination
*ap_benf, # beneficiary
{ v1: [ *rc_ksm_fungible ] }, # assets
{ v3: [ *rc_ksm_fungible ] }, # assets
0, # feeAssetItem
{ unlimited: true } # weightLimit
]
events:
- name: xcmPallet.Attempted
attribute:
type: XcmV2TraitsOutcome
isComplete: true
threshold: [10, 10]
value: 750,645,000
attributes:
- type: XcmV3TraitsOutcome
# xcmOutcome: Complete
# threshold: [10, 10]
value: {"Complete":{"refTime":"750,645,000","proofSize":"0"}}
- name: dmpQueue.ExecutedDownward
chain: *assets_parachain
attribute:
type: XcmV2TraitsOutcome
isError: true
value: "WeightNotComputable"
attributes:
- type: XcmV3TraitsOutcome
# xcmOutcome: Error
# value: "WeightNotComputable"
value: {"Incomplete":[{"refTime":"1,000,000,000","proofSize":"0"},"UntrustedReserveLocation"]}
- queries:
balance_rc_sender_after:
chain: *relay_chain
Expand Down
Loading