mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 01:41:03 +00:00
Collectives parachain integration tests update (#2036)
* Collectives: update integration tests * update title
This commit is contained in:
@@ -7,28 +7,40 @@ settings:
|
|||||||
wsPort: 9710
|
wsPort: 9710
|
||||||
paraId: &cp_id 1001
|
paraId: &cp_id 1001
|
||||||
variables:
|
variables:
|
||||||
xcm_version: &xcm_version '2'
|
|
||||||
weight_to_send_teleport: &weight_to_send_teleport 2,000,000,000 # must be same for both chains
|
weight_to_send_teleport: &weight_to_send_teleport 2,000,000,000 # must be same for both chains
|
||||||
weight_to_receive_teleport: &weight_to_receive_teleport 4,000,000,000 # must be same for both chains
|
weight_to_receive_teleport: &weight_to_receive_teleport 4,000,000,000 # must be same for both chains
|
||||||
chains:
|
accounts:
|
||||||
accounts:
|
alice_signer: &acc_alice_signer //Alice
|
||||||
alice_signer: &alice_signer //Alice
|
alice_account32: &acc_alice_acc32 '0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d'
|
||||||
alice_account32: &alice_acc32 '0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d'
|
alice_ss58: &acc_alice_ss58 '15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5'
|
||||||
alice_ss58: &acc_alice_ss58 '15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5'
|
|
||||||
|
|
||||||
tests:
|
tests:
|
||||||
- name: Teleport assets from Relay Chain to Collectives Parachain successful
|
- name: Teleport assets from Relay Chain to Collectives Parachain successful.
|
||||||
|
before:
|
||||||
|
- name: Get the Alice balances on Relay & Collectives Chains.
|
||||||
|
actions:
|
||||||
|
- queries:
|
||||||
|
balance_rc_alice_1:
|
||||||
|
chain: *relay_chain
|
||||||
|
pallet: system
|
||||||
|
call: account
|
||||||
|
args: [ *acc_alice_acc32 ]
|
||||||
|
balance_cp_alice_1:
|
||||||
|
chain: *collectives_parachain
|
||||||
|
pallet: system
|
||||||
|
call: account
|
||||||
|
args: [ *acc_alice_acc32 ]
|
||||||
its:
|
its:
|
||||||
- name: Teleport assets from Relay Chain to Collectives Parachain
|
- name: Teleport assets from Relay Chain to Collectives Parachain
|
||||||
actions:
|
actions:
|
||||||
- extrinsics:
|
- extrinsics:
|
||||||
- chain: *relay_chain
|
- chain: *relay_chain
|
||||||
signer: *alice_signer
|
signer: *acc_alice_signer
|
||||||
pallet: xcmPallet
|
pallet: xcmPallet
|
||||||
call: teleportAssets
|
call: teleportAssets
|
||||||
args: [
|
args: [
|
||||||
{ v1: { 0, interior: { x1: { parachain: *cp_id }}}}, # destination
|
{ v1: { 0, interior: { x1: { parachain: *cp_id }}}}, # destination
|
||||||
{ v1: { parents: 0, interior: { x1: { accountId32: { network: { any: true }, id: *alice_acc32 }}}}}, # beneficiary
|
{ v1: { parents: 0, interior: { x1: { accountId32: { network: { any: true }, id: *acc_alice_acc32 }}}}}, # beneficiary
|
||||||
{
|
{
|
||||||
v1: [
|
v1: [
|
||||||
# {
|
# {
|
||||||
@@ -53,15 +65,6 @@ tests:
|
|||||||
xcmOutcome: Complete
|
xcmOutcome: Complete
|
||||||
# the weight must be static
|
# the weight must be static
|
||||||
value: *weight_to_send_teleport
|
value: *weight_to_send_teleport
|
||||||
- name: balances.Deposit
|
|
||||||
chain: *collectives_parachain
|
|
||||||
attributes:
|
|
||||||
- type: u128
|
|
||||||
# TODO (P2)
|
|
||||||
# Flaky assert since sent assets used to pay a fee
|
|
||||||
# query and assert Alice balance before and after teleport (see example in kick_member test)
|
|
||||||
# drop this event assert
|
|
||||||
value: 19,999,953,648,988 # amount received
|
|
||||||
- name: dmpQueue.ExecutedDownward
|
- name: dmpQueue.ExecutedDownward
|
||||||
chain: *collectives_parachain
|
chain: *collectives_parachain
|
||||||
attributes:
|
attributes:
|
||||||
@@ -69,17 +72,49 @@ tests:
|
|||||||
xcmOutcome: Complete
|
xcmOutcome: Complete
|
||||||
# the weight must be static
|
# the weight must be static
|
||||||
value: *weight_to_receive_teleport
|
value: *weight_to_receive_teleport
|
||||||
|
- queries:
|
||||||
|
balance_rc_alice_2:
|
||||||
|
chain: *relay_chain
|
||||||
|
pallet: system
|
||||||
|
call: account
|
||||||
|
args: [ *acc_alice_acc32 ]
|
||||||
|
balance_cp_alice_2:
|
||||||
|
chain: *collectives_parachain
|
||||||
|
pallet: system
|
||||||
|
call: account
|
||||||
|
args: [ *acc_alice_acc32 ]
|
||||||
|
- name: Alice deposit check, balance decreased on Relay Chain, increased on Collectives.
|
||||||
|
actions:
|
||||||
|
- asserts:
|
||||||
|
balanceDecreased:
|
||||||
|
args: [
|
||||||
|
{
|
||||||
|
balances: {
|
||||||
|
before: $balance_rc_alice_1,
|
||||||
|
after: $balance_rc_alice_2,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
balanceIncreased:
|
||||||
|
args: [
|
||||||
|
{
|
||||||
|
balances: {
|
||||||
|
before: $balance_cp_alice_1,
|
||||||
|
after: $balance_cp_alice_2,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
- name: Teleport assets from Collectives Parachain to Relay Chain successful
|
- name: Teleport assets from Collectives Parachain to Relay Chain successful
|
||||||
actions:
|
actions:
|
||||||
- extrinsics:
|
- extrinsics:
|
||||||
- chain: *collectives_parachain
|
- chain: *collectives_parachain
|
||||||
signer: *alice_signer
|
signer: *acc_alice_signer
|
||||||
pallet: polkadotXcm
|
pallet: polkadotXcm
|
||||||
call: teleportAssets
|
call: teleportAssets
|
||||||
args: [
|
args: [
|
||||||
{ v1: { parents: 1, interior: { here: true }}}, # destination
|
{ v1: { parents: 1, interior: { here: true }}}, # destination
|
||||||
{ v1: { parents: 0, interior: { x1: { accountId32: { network: { any: true }, id: *alice_acc32 }}}}}, # beneficiary
|
{ v1: { parents: 0, interior: { x1: { accountId32: { network: { any: true }, id: *acc_alice_acc32 }}}}}, # beneficiary
|
||||||
{
|
{
|
||||||
v1: [
|
v1: [
|
||||||
{
|
{
|
||||||
@@ -91,8 +126,6 @@ tests:
|
|||||||
0, # feeAssetItem
|
0, # feeAssetItem
|
||||||
]
|
]
|
||||||
events:
|
events:
|
||||||
# TODO assert balance.Deposit event on relay chain
|
|
||||||
# not possible now / issue - https://github.com/paritytech/parachains-integration-tests/issues/58
|
|
||||||
- name: balances.Withdraw
|
- name: balances.Withdraw
|
||||||
attributes:
|
attributes:
|
||||||
- type: AccountId32
|
- type: AccountId32
|
||||||
@@ -120,7 +153,38 @@ tests:
|
|||||||
xcmOutcome: Complete
|
xcmOutcome: Complete
|
||||||
# the weight must be static
|
# the weight must be static
|
||||||
value: *weight_to_receive_teleport
|
value: *weight_to_receive_teleport
|
||||||
|
- queries:
|
||||||
|
balance_rc_alice_3:
|
||||||
|
chain: *relay_chain
|
||||||
|
pallet: system
|
||||||
|
call: account
|
||||||
|
args: [ *acc_alice_acc32 ]
|
||||||
|
balance_cp_alice_3:
|
||||||
|
chain: *collectives_parachain
|
||||||
|
pallet: system
|
||||||
|
call: account
|
||||||
|
args: [ *acc_alice_acc32 ]
|
||||||
|
|
||||||
# TODO (P2) assert Alice balance before and after teleport (see example in kick_member test)
|
- name: Alice deposit check, balance decreased on Collectives, increased on Relay Chain.
|
||||||
|
actions:
|
||||||
#TODO (P1) test: teleport of non relay chain assets fails
|
- asserts:
|
||||||
|
balanceDecreased:
|
||||||
|
args: [
|
||||||
|
{
|
||||||
|
balances: {
|
||||||
|
before: $balance_cp_alice_2,
|
||||||
|
after: $balance_cp_alice_3,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
balanceIncreased:
|
||||||
|
args: [
|
||||||
|
{
|
||||||
|
balances: {
|
||||||
|
before: $balance_rc_alice_2,
|
||||||
|
after: $balance_rc_alice_3,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
# TODO (P2) assert Alice balance before and after teleport (see example in kick_member test)
|
||||||
|
# TODO (P1) test: teleport of non relay chain assets fails
|
||||||
|
|||||||
@@ -33,9 +33,7 @@ settings:
|
|||||||
[
|
[
|
||||||
*acc_liam_acc32,
|
*acc_liam_acc32,
|
||||||
*acc_olivia_acc32,
|
*acc_olivia_acc32,
|
||||||
*acc_noah_acc32
|
*acc_noah_acc32,
|
||||||
],
|
|
||||||
[
|
|
||||||
*acc_emma_acc32,
|
*acc_emma_acc32,
|
||||||
*acc_james_acc32,
|
*acc_james_acc32,
|
||||||
*acc_ava_acc32
|
*acc_ava_acc32
|
||||||
@@ -58,7 +56,6 @@ settings:
|
|||||||
*acc_ava_acc32,
|
*acc_ava_acc32,
|
||||||
*acc_mia_acc32
|
*acc_mia_acc32
|
||||||
],
|
],
|
||||||
[],
|
|
||||||
[]
|
[]
|
||||||
]
|
]
|
||||||
disband:
|
disband:
|
||||||
@@ -67,7 +64,7 @@ settings:
|
|||||||
call: disband
|
call: disband
|
||||||
args: [
|
args: [
|
||||||
{
|
{
|
||||||
votingMembers: 6,
|
fellowMembers: 6,
|
||||||
allyMembers: 1
|
allyMembers: 1
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -185,7 +182,7 @@ tests:
|
|||||||
chain: *collectives_parachain
|
chain: *collectives_parachain
|
||||||
attributes:
|
attributes:
|
||||||
- type: u32
|
- type: u32
|
||||||
key: votingMembers
|
key: fellowMembers
|
||||||
value: 6
|
value: 6
|
||||||
- type: u32
|
- type: u32
|
||||||
key: allyMembers
|
key: allyMembers
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ settings:
|
|||||||
init_teleport_amount: &init_teleport_amount 20000000000000 # 20_000_000_000_000
|
init_teleport_amount: &init_teleport_amount 20000000000000 # 20_000_000_000_000
|
||||||
weight_to_send_teleport: &weight_to_send_teleport 2,000,000,000 # must be same for both chains
|
weight_to_send_teleport: &weight_to_send_teleport 2,000,000,000 # must be same for both chains
|
||||||
weight_to_receive_teleport: &weight_to_receive_teleport 4,000,000,000 # must be same for both chains
|
weight_to_receive_teleport: &weight_to_receive_teleport 4,000,000,000 # must be same for both chains
|
||||||
|
weight_to_receive_transact: &weight_to_receive_transact 3,000,000,000 # must be same for both chains
|
||||||
accounts:
|
accounts:
|
||||||
alice_signer: &acc_alice_signer //Alice
|
alice_signer: &acc_alice_signer //Alice
|
||||||
treasury_account32: &acc_treasury_acc32 '0x6d6f646c70792f74727372790000000000000000000000000000000000000000'
|
treasury_account32: &acc_treasury_acc32 '0x6d6f646c70792f74727372790000000000000000000000000000000000000000'
|
||||||
@@ -134,7 +135,7 @@ tests:
|
|||||||
{
|
{
|
||||||
Transact: {
|
Transact: {
|
||||||
originType: Superuser,
|
originType: Superuser,
|
||||||
requireWeightAtMost: 1000000000,
|
requireWeightAtMost: 2000000000,
|
||||||
call: $alliance_kick_member
|
call: $alliance_kick_member
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -159,7 +160,7 @@ tests:
|
|||||||
- type: XcmV2TraitsOutcome
|
- type: XcmV2TraitsOutcome
|
||||||
xcmOutcome: Complete
|
xcmOutcome: Complete
|
||||||
# must be static
|
# must be static
|
||||||
value: *weight_to_send_teleport
|
value: *weight_to_receive_transact
|
||||||
|
|
||||||
- queries:
|
- queries:
|
||||||
balance_rc_treasury_after:
|
balance_rc_treasury_after:
|
||||||
|
|||||||
Reference in New Issue
Block a user