mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 15:11:02 +00:00
Collectives integration tests (#1979)
Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -0,0 +1,240 @@
|
||||
---
|
||||
settings:
|
||||
chains:
|
||||
relay_chain: &relay_chain
|
||||
wsPort: 9700
|
||||
collectives_parachain: &collectives_parachain
|
||||
wsPort: 9710
|
||||
paraId: &coll_para_id 1001
|
||||
variables:
|
||||
accounts:
|
||||
alice_signer: &acc_alice_signer //Alice
|
||||
alice_account32: &acc_alice_acc32 "0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"
|
||||
liam_signer: &acc_liam_signer //Liam
|
||||
liam_account32: &acc_liam_acc32 "0x3614671a5de540d891eb8c4939c8153a4aa790602b347c18177b86d0fc546221"
|
||||
olivia_signer: &acc_olivia_signer //Olivia
|
||||
olivia_account32: &acc_olivia_acc32 "0x24ee8a659c6716fe9f7cb4e9e028602aa12867654ca02737da9171b7ff697d5c"
|
||||
noah_signer: &acc_noah_signer //Noah
|
||||
noah_account32: &acc_noah_acc32 "0x9c6ad3bc3aa2f1b2e837898e6da9980445f7ef8b3eee0b8c8e305f8cfae68517"
|
||||
emma_signer: &acc_emma_signer //Emma
|
||||
emma_account32: &acc_emma_acc32 "0x8ac272b333ba1127c8db57fa777ec820b24598a236efa648caf0d26d86f64572"
|
||||
james_signer: &acc_james_signer //James
|
||||
james_account32: &acc_james_acc32 "0x9a52805151a0b5effc084af9264011139872a21a3950cb9ae0b2955c4bf92c18"
|
||||
ava_signer: &acc_ava_signer //Ava
|
||||
ava_account32: &acc_ava_acc32 "0x348ef0b8776adbc09c862ddc29b1d193b9e24738e54eea3b0609c83856dc101c"
|
||||
mia_signer: &acc_mia_signer //Mia
|
||||
mia_account32: &acc_mia_acc32 "0xaebf15374cf7e758d10232514c569a7abf81cc1b8f1e81a73dbc608a0e335264"
|
||||
decodedCalls:
|
||||
init_alliance_members:
|
||||
chain: *collectives_parachain
|
||||
pallet: alliance
|
||||
call: initMembers
|
||||
args: [
|
||||
[
|
||||
*acc_liam_acc32,
|
||||
*acc_olivia_acc32,
|
||||
*acc_noah_acc32
|
||||
],
|
||||
[
|
||||
*acc_emma_acc32,
|
||||
*acc_james_acc32,
|
||||
*acc_ava_acc32
|
||||
],
|
||||
[
|
||||
*acc_mia_acc32
|
||||
]
|
||||
]
|
||||
init_alliance_voting_members:
|
||||
chain: *collectives_parachain
|
||||
pallet: alliance
|
||||
call: initMembers
|
||||
args: [
|
||||
[
|
||||
*acc_liam_acc32,
|
||||
*acc_olivia_acc32,
|
||||
*acc_noah_acc32,
|
||||
*acc_emma_acc32,
|
||||
*acc_james_acc32,
|
||||
*acc_ava_acc32,
|
||||
*acc_mia_acc32
|
||||
],
|
||||
[],
|
||||
[]
|
||||
]
|
||||
disband:
|
||||
chain: *collectives_parachain
|
||||
pallet: alliance
|
||||
call: disband
|
||||
args: [
|
||||
{
|
||||
votingMembers: 6,
|
||||
allyMembers: 1
|
||||
}
|
||||
]
|
||||
|
||||
tests:
|
||||
- name: Alliance initiated with the root call, second init call fails. Alliance disband and set again.
|
||||
its:
|
||||
- name: Alliance initiated, founders and fellows are set.
|
||||
actions:
|
||||
- extrinsics:
|
||||
- chain: *relay_chain
|
||||
signer: *acc_alice_signer
|
||||
sudo: true
|
||||
pallet: xcmPallet
|
||||
call: send
|
||||
args: [
|
||||
{ v1: { parents: 0, interior: { x1: { parachain: *coll_para_id }}}}, # destination
|
||||
{
|
||||
v2: [ # message
|
||||
{
|
||||
Transact: {
|
||||
originType: Superuser,
|
||||
requireWeightAtMost: 1000000000, # 1_000_000_000
|
||||
call: $init_alliance_members
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
events:
|
||||
- name: sudo.Sudid
|
||||
attributes:
|
||||
- type: Result<Null, SpRuntimeDispatchError>
|
||||
value: Ok
|
||||
- name: xcmPallet.Sent
|
||||
- name: alliance.MembersInitialized
|
||||
chain: *collectives_parachain
|
||||
- name: dmpQueue.ExecutedDownward
|
||||
chain: *collectives_parachain
|
||||
attributes:
|
||||
- type: XcmV2TraitsOutcome
|
||||
xcmOutcome: Complete
|
||||
# we don't know how much weight will be spent for custom call within Transact operation
|
||||
# value: skipping the assertion
|
||||
|
||||
- name: Alliance init call fails.
|
||||
actions:
|
||||
- extrinsics:
|
||||
- chain: *relay_chain
|
||||
signer: *acc_alice_signer
|
||||
sudo: true
|
||||
pallet: xcmPallet
|
||||
call: send
|
||||
args: [
|
||||
{ v1: { parents: 0, interior: { x1: { parachain: *coll_para_id }}}}, # destination
|
||||
{
|
||||
v2: [ # message
|
||||
{
|
||||
Transact: {
|
||||
originType: Superuser,
|
||||
requireWeightAtMost: 1000000000, # 1_000_000_000
|
||||
call: $init_alliance_voting_members
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
events:
|
||||
# TODO can not currently assert variant AllianceAlreadyInitialized, XCM Transact fails silently
|
||||
# issue - https://github.com/paritytech/polkadot/issues/4623
|
||||
# Next test with a disband call will fail, if this call does not fail,
|
||||
# since a witness data from a disband call will be invalid.
|
||||
- name: sudo.Sudid
|
||||
attributes:
|
||||
- type: Result<Null, SpRuntimeDispatchError>
|
||||
value: Ok
|
||||
- name: xcmPallet.Sent
|
||||
- name: dmpQueue.ExecutedDownward
|
||||
chain: *collectives_parachain
|
||||
attributes:
|
||||
- type: XcmV2TraitsOutcome
|
||||
xcmOutcome: Complete
|
||||
# the call must fail, the weight spent is static
|
||||
value: 2,000,000,000
|
||||
|
||||
- name: Alliance disbanded and initialized again.
|
||||
actions:
|
||||
- extrinsics:
|
||||
- chain: *relay_chain
|
||||
signer: *acc_alice_signer
|
||||
sudo: true
|
||||
pallet: xcmPallet
|
||||
call: send
|
||||
args: [
|
||||
{ v1: { parents: 0, interior: { x1: { parachain: *coll_para_id }}}}, # destination
|
||||
{
|
||||
v2: [ # message
|
||||
{
|
||||
Transact: {
|
||||
originType: Superuser,
|
||||
requireWeightAtMost: 100000000000, # 100_000_000_000
|
||||
call: $disband
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
events:
|
||||
- name: sudo.Sudid
|
||||
attributes:
|
||||
- type: Result<Null, SpRuntimeDispatchError>
|
||||
value: Ok
|
||||
- name: xcmPallet.Sent
|
||||
- name: alliance.AllianceDisbanded
|
||||
chain: *collectives_parachain
|
||||
attributes:
|
||||
- type: u32
|
||||
key: votingMembers
|
||||
value: 6
|
||||
- type: u32
|
||||
key: allyMembers
|
||||
value: 1
|
||||
- type: u32
|
||||
key: unreserved
|
||||
value: 0
|
||||
- name: dmpQueue.ExecutedDownward
|
||||
chain: *collectives_parachain
|
||||
attributes:
|
||||
- type: XcmV2TraitsOutcome
|
||||
xcmOutcome: Complete
|
||||
# we don't know how much weight will be spent for custom call within Transact operation
|
||||
# value: skipping the assertion
|
||||
- name: Alliance initiated, founders and fellows are set.
|
||||
actions:
|
||||
- extrinsics:
|
||||
- chain: *relay_chain
|
||||
signer: *acc_alice_signer
|
||||
sudo: true
|
||||
pallet: xcmPallet
|
||||
call: send
|
||||
args: [
|
||||
{ v1: { parents: 0, interior: { x1: { parachain: *coll_para_id }}}}, # destination
|
||||
{
|
||||
v2: [ # message
|
||||
{
|
||||
Transact: {
|
||||
originType: Superuser,
|
||||
requireWeightAtMost: 1000000000, # 1_000_000_000
|
||||
call: $init_alliance_members
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
events:
|
||||
- name: sudo.Sudid
|
||||
attributes:
|
||||
- type: Result<Null, SpRuntimeDispatchError>
|
||||
value: Ok
|
||||
- name: xcmPallet.Sent
|
||||
- name: alliance.MembersInitialized
|
||||
chain: *collectives_parachain
|
||||
- name: dmpQueue.ExecutedDownward
|
||||
chain: *collectives_parachain
|
||||
attributes:
|
||||
- type: XcmV2TraitsOutcome
|
||||
xcmOutcome: Complete
|
||||
# we don't know how much weight will be spent for custom call within Transact operation
|
||||
# value: skipping the assertion
|
||||
|
||||
Reference in New Issue
Block a user