mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 18:41:03 +00:00
e2e tests for Gov2 (#2944)
* Fellowship e2e tests * fixes * fixe wrong result * Update parachains/integration-tests/e2e/collectives/README.md * Apply suggestions from code review Co-authored-by: Squirrel <gilescope@gmail.com> * fixes --------- Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> Co-authored-by: Squirrel <gilescope@gmail.com>
This commit is contained in:
+149
@@ -0,0 +1,149 @@
|
||||
---
|
||||
settings:
|
||||
chains:
|
||||
relay_chain: &relay_chain
|
||||
wsPort: 9700
|
||||
assethub_parachain: &assethub_parachain
|
||||
wsPort: 9810
|
||||
paraId: &ap_id 1000
|
||||
variables:
|
||||
proposal_index: &proposal_index 0
|
||||
chains:
|
||||
accounts:
|
||||
alice_signer: &alice_signer //Alice
|
||||
bob_signer: &bob_signer //Bob
|
||||
decodedCalls:
|
||||
set_candidates_ap:
|
||||
chain: *assethub_parachain
|
||||
encode: true
|
||||
pallet: collatorSelection
|
||||
call: setDesiredCandidates
|
||||
args: [
|
||||
3
|
||||
]
|
||||
send_set_candidates_rc:
|
||||
chain: *relay_chain
|
||||
encode: false
|
||||
pallet: xcmPallet
|
||||
call: send
|
||||
args: [
|
||||
{ v3: { parents: 0, interior: { x1: { parachain: *ap_id }}}}, # destination
|
||||
{
|
||||
v3: [ #message
|
||||
{
|
||||
UnpaidExecution: {
|
||||
weightLimit: Unlimited
|
||||
}
|
||||
},
|
||||
{
|
||||
Transact: {
|
||||
originKind: Xcm,
|
||||
requireWeightAtMost: {
|
||||
refTime: 200000000, # 200_000_000
|
||||
proofSize: 100000, # 100_000
|
||||
},
|
||||
call: $set_candidates_ap
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
tests:
|
||||
- name: OpenGov
|
||||
describes:
|
||||
- name: Set desired candidates on AssetHub from Relay Chain OpenGov Staking track
|
||||
its:
|
||||
- name: Note preimage from xcm send set_desired_candidates call
|
||||
actions:
|
||||
- extrinsics:
|
||||
- chain: *relay_chain
|
||||
signer: *alice_signer
|
||||
pallet: preimage
|
||||
call: notePreimage
|
||||
args: [
|
||||
$send_set_candidates_rc
|
||||
]
|
||||
events:
|
||||
- name: preimage.Noted
|
||||
result: {hash_: $send_set_candidates_rc.hash }
|
||||
- name: Submit a proposal to set desired candidates
|
||||
actions:
|
||||
- extrinsics:
|
||||
- chain: *relay_chain
|
||||
signer: *alice_signer
|
||||
pallet: referenda
|
||||
call: submit
|
||||
args: [
|
||||
{
|
||||
"Origins": "StakingAdmin",
|
||||
},
|
||||
{
|
||||
"Lookup": {
|
||||
"hash_": $send_set_candidates_rc.hash,
|
||||
"len": $send_set_candidates_rc.len,
|
||||
},
|
||||
},
|
||||
{
|
||||
"After": 1,
|
||||
},
|
||||
]
|
||||
events:
|
||||
- name: referenda.Submitted
|
||||
result: {
|
||||
index: *proposal_index,
|
||||
proposal: { Lookup: { hash_: $send_set_candidates_rc.hash, len: $send_set_candidates_rc.len }}
|
||||
}
|
||||
- name: Alice Vote Aye
|
||||
actions:
|
||||
- extrinsics:
|
||||
- chain: *relay_chain
|
||||
signer: *alice_signer
|
||||
pallet: convictionVoting
|
||||
call: vote
|
||||
args: [
|
||||
*proposal_index,
|
||||
{
|
||||
"Standard": {
|
||||
"vote": {
|
||||
"aye": true,
|
||||
"conviction": "Locked1x",
|
||||
},
|
||||
"balance": 200000000000000,
|
||||
}
|
||||
},
|
||||
] # TODO no event to catch https://github.com/paritytech/substrate/issues/14687
|
||||
- name: Bob Vote Aye
|
||||
actions:
|
||||
- extrinsics:
|
||||
- chain: *relay_chain
|
||||
signer: *bob_signer
|
||||
pallet: convictionVoting
|
||||
call: vote
|
||||
args: [
|
||||
*proposal_index,
|
||||
{
|
||||
"Standard": {
|
||||
"vote": {
|
||||
"aye": true,
|
||||
"conviction": "Locked1x",
|
||||
},
|
||||
"balance": 200000000000000,
|
||||
}
|
||||
},
|
||||
] # TODO no event to catch https://github.com/paritytech/substrate/issues/14687
|
||||
- name: Submit the decision deposit
|
||||
actions:
|
||||
- extrinsics:
|
||||
- chain: *relay_chain
|
||||
signer: *alice_signer
|
||||
pallet: referenda
|
||||
call: placeDecisionDeposit
|
||||
args: [
|
||||
*proposal_index,
|
||||
]
|
||||
events:
|
||||
- name: referenda.DecisionDepositPlaced
|
||||
result: { index: *proposal_index }
|
||||
- name: collatorSelection.NewDesiredCandidates
|
||||
chain: *assethub_parachain
|
||||
result: { desiredCandidates: 3 }
|
||||
Reference in New Issue
Block a user