Update & revamp e2e tests (#2614)

* update & revamp e2e tests

* add seeds as comments

* ".git/.scripts/commands/fmt/fmt.sh"

---------

Co-authored-by: command-bot <>
This commit is contained in:
Ignacio Palacios
2023-05-24 20:07:22 +02:00
committed by GitHub
parent 7c884813c3
commit 5c91c70b78
21 changed files with 392 additions and 532 deletions
@@ -7,12 +7,13 @@ settings:
wsPort: 9710
paraId: &cp_id 1001
variables:
xcm_version: &xcm_version '3'
xcm_version: &xcm_version 3
weight_threshold: &weight_threshold { refTime: [10, 10], proofSize: [10, 10] }
chains:
accounts:
alice_signer: &alice_signer //Alice
decodedCalls:
ap_force_xcm_version:
cp_force_xcm_version:
chain: *collectives_parachain
pallet: polkadotXcm
call: forceXcmVersion
@@ -48,13 +49,9 @@ tests:
]
events:
- name: sudo.Sudid
attributes:
- type: Result<Null, SpRuntimeDispatchError>
value: Ok
result: { sudoResult: Ok }
- name: xcmPallet.SupportedVersionChanged
attributes:
- type: u32
value: *xcm_version
result: [{ parents: 0, interior: { X1: { Parachain: *cp_id }}}, *xcm_version ]
- extrinsics: # Collectives Parachain sets supported version for Relay Chain through it
- chain: *relay_chain
signer: *alice_signer
@@ -82,7 +79,7 @@ tests:
refTime: 200000000, # 200_000_000
proofSize: 0,
},
call: $ap_force_xcm_version
call: $cp_force_xcm_version
}
}
]
@@ -90,17 +87,14 @@ tests:
]
events:
- name: sudo.Sudid
attributes:
- type: Result<Null, SpRuntimeDispatchError>
value: Ok
result: { sudoResult: Ok }
- name: xcmPallet.Sent
- name: polkadotXcm.SupportedVersionChanged
chain: *collectives_parachain
attributes:
- type: u32
value: *xcm_version
- name: dmpQueue.ExecutedDownward
chain: *collectives_parachain
attributes:
- type: XcmV3TraitsOutcome
xcmOutcome: Complete
threshold: *weight_threshold
result: {
outcome: { Complete: { refTime: '2,200,000,000', proofSize: 0 }}
}
- name: polkadotXcm.SupportedVersionChanged
chain: *collectives_parachain
result: [{ parents: 1, interior: Here }, *xcm_version ]
@@ -7,10 +7,13 @@ settings:
wsPort: 9710
paraId: &cp_id 1001
variables:
weight_threshold: &weight_threshold { refTime: [10, 10], proofSize: [10, 10] }
accounts:
alice_signer: &acc_alice_signer //Alice
alice_account32: &acc_alice_acc32 '0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d'
alice_ss58: &acc_alice_ss58 '15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5'
checking_account: &checking_account '13UVJyLnbVp9x5XDyJv8g8r3UddNwBrdaH7AADCmw9XQWvYW'
tests:
- name: Teleport assets from Relay Chain to Collectives Parachain successful.
@@ -57,15 +60,14 @@ tests:
]
events:
- name: xcmPallet.Attempted
chain: *relay_chain
attributes:
- type: XcmV3TraitsOutcome
xcmOutcome: Complete
threshold: *weight_threshold
result: [{ Complete: { refTime: '3,000,000,000', proofSize: 0 }}]
- name: dmpQueue.ExecutedDownward
chain: *collectives_parachain
attributes:
- type: XcmV3TraitsOutcome
xcmOutcome: Complete
threshold: *weight_threshold
result: {
outcome: { Complete: { refTime: '4,000,000,000', proofSize: 0 }}
}
- queries:
balance_rc_alice_2:
chain: *relay_chain
@@ -121,28 +123,17 @@ tests:
]
events:
- name: balances.Withdraw
attributes:
- type: AccountId32
key: who
value: *acc_alice_ss58
- type: u128
key: amount
value: 10000000000000
result: { who: *acc_alice_ss58, amount: 10000000000000 }
- name: polkadotXcm.Attempted
attributes:
- type: XcmV3TraitsOutcome
xcmOutcome: Complete
threshold: *weight_threshold
result: [{ Complete: { refTime: '3,000,000,000', proofSize: 0 }}]
- name: balances.Withdraw
chain: *relay_chain
attributes:
- type: u128
key: amount
value: 10000000000000 # amount received and withdrawn from registry account
result: { who: *checking_account, amount: 10000000000000 } # amount received and withdrawn from registry account
- name: ump.ExecutedUpward
chain: *relay_chain
attributes:
- type: XcmV3TraitsOutcome
xcmOutcome: Complete
threshold: *weight_threshold
result: [{ Complete: { refTime: '4,000,000,000', proofSize: 0 }}]
- queries:
balance_rc_alice_3:
chain: *relay_chain
@@ -7,11 +7,11 @@ settings:
wsPort: 9710
paraId: &cp_id 1001
variables:
weight_threshold: &weight_threshold { refTime: [10, 10], proofSize: [10, 10] }
chains:
accounts:
alice_signer: &alice_signer //Alice
alice_account32: &alice_acc32 '0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d'
alice_ss58: &acc_alice_ss58 '15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5'
tests:
- name: Reserve assets from Relay Chain to Collectives Parachain fails
@@ -38,12 +38,16 @@ tests:
]
events:
- name: xcmPallet.Attempted
chain: *relay_chain
attributes:
- type: XcmV3TraitsOutcome
xcmOutcome: Complete
threshold: *weight_threshold
result: [{ Complete: { refTime: '2,000,000,000', proofSize: 0 }}]
- name: dmpQueue.ExecutedDownward
chain: *collectives_parachain
attributes:
- type: XcmV3TraitsOutcome
xcmOutcome: Incomplete
threshold: *weight_threshold
result: {
outcome: {
Incomplete: [
{ refTime: '1,000,000,000', proofSize: 0 },
UntrustedReserveLocation
]
}
}
@@ -1,15 +1,13 @@
---
settings:
chains:
relay_chain: &relay_chain
relay_chain:
wsPort: 9700
collectives_parachain: &collectives_parachain
wsPort: 9710
paraId: &cp_id 1001
variables:
accounts:
alice_signer: &alice_signer //Alice
alice_account32: &cp_alice_acc32 '0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d'
tests:
- name: Alice fails to join an the Alliance, since it is not initialized yet.
@@ -24,11 +22,8 @@ tests:
args: []
events:
- name: system.ExtrinsicFailed
attributes:
- type: SpRuntimeDispatchError
key: dispatchError
# TODO assert with Alliance Error variant - alliance.AllianceNotYetInitialized
# issue - https://github.com/paritytech/parachains-integration-tests/issues/59
value: {"Module":{"index":"50","error":"0x00000000"}}
result: {
dispatchError: { Module: { index: 50, error: '0x00000000' }}
}
# TODO assert with Alliance Error variant - alliance.AllianceNotYetInitialized
# issue - https://github.com/paritytech/parachains-integration-tests/issues/59
@@ -7,23 +7,16 @@ settings:
wsPort: 9710
paraId: &coll_para_id 1001
variables:
weight_threshold: &weight_threshold { refTime: [10, 10], proofSize: [10, 10] }
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"
liam_account32: &acc_liam_acc32 "0x3614671a5de540d891eb8c4939c8153a4aa790602b347c18177b86d0fc546221" # //Liam
olivia_account32: &acc_olivia_acc32 "0x24ee8a659c6716fe9f7cb4e9e028602aa12867654ca02737da9171b7ff697d5c" # //Olivia
noah_account32: &acc_noah_acc32 "0x9c6ad3bc3aa2f1b2e837898e6da9980445f7ef8b3eee0b8c8e305f8cfae68517" # //Noah
emma_account32: &acc_emma_acc32 "0x8ac272b333ba1127c8db57fa777ec820b24598a236efa648caf0d26d86f64572" # //Emma
james_account32: &acc_james_acc32 "0x9a52805151a0b5effc084af9264011139872a21a3950cb9ae0b2955c4bf92c18" # //James
ava_account32: &acc_ava_acc32 "0x348ef0b8776adbc09c862ddc29b1d193b9e24738e54eea3b0609c83856dc101c" # //Ava
mia_account32: &acc_mia_acc32 "0xaebf15374cf7e758d10232514c569a7abf81cc1b8f1e81a73dbc608a0e335264" # //Mia
decodedCalls:
init_alliance_members:
chain: *collectives_parachain
@@ -109,17 +102,16 @@ tests:
]
events:
- name: sudo.Sudid
attributes:
- type: Result<Null, SpRuntimeDispatchError>
value: Ok
result: { sudoResult: Ok }
- name: xcmPallet.Sent
- name: alliance.MembersInitialized
chain: *collectives_parachain
- name: dmpQueue.ExecutedDownward
chain: *collectives_parachain
attributes:
- type: XcmV3TraitsOutcome
xcmOutcome: Complete
threshold: *weight_threshold
result: {
outcome: { Complete: { refTime: '3,000,000,000', proofSize: '1,000,000' }}
}
- name: Alliance init call fails.
actions:
@@ -162,15 +154,14 @@ tests:
# 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
result: { sudoResult: Ok }
- name: xcmPallet.Sent
- name: dmpQueue.ExecutedDownward
chain: *collectives_parachain
attributes:
- type: XcmV3TraitsOutcome
xcmOutcome: Complete
threshold: *weight_threshold
result: {
outcome: { Complete: { refTime: '3,000,000,000', proofSize: '1,000,000' }}
}
- name: Alliance disbanded and initialized again.
actions:
@@ -209,27 +200,17 @@ tests:
]
events:
- name: sudo.Sudid
attributes:
- type: Result<Null, SpRuntimeDispatchError>
value: Ok
result: { sudoResult: Ok }
- name: xcmPallet.Sent
- name: alliance.AllianceDisbanded
chain: *collectives_parachain
attributes:
- type: u32
key: fellowMembers
value: 6
- type: u32
key: allyMembers
value: 1
- type: u32
key: unreserved
value: 0
result: { fellowMembers: 6, allyMembers: 1, unreserved: 0 }
- name: dmpQueue.ExecutedDownward
chain: *collectives_parachain
attributes:
- type: XcmV3TraitsOutcome
xcmOutcome: Complete
threshold: *weight_threshold
result: {
outcome: { Complete: { refTime: '3,321,495,872', proofSize: '181,779' }}
}
- name: Alliance initiated, founders and fellows are set.
actions:
- extrinsics:
@@ -267,14 +248,13 @@ tests:
]
events:
- name: sudo.Sudid
attributes:
- type: Result<Null, SpRuntimeDispatchError>
value: Ok
result: { sudoResult: Ok }
- name: xcmPallet.Sent
- name: alliance.MembersInitialized
chain: *collectives_parachain
- name: dmpQueue.ExecutedDownward
chain: *collectives_parachain
attributes:
- type: XcmV3TraitsOutcome
xcmOutcome: Complete
threshold: *weight_threshold
result: {
outcome: { Complete: { refTime: '3,000,000,000', proofSize: '1,000,000' }}
}
@@ -1,15 +1,14 @@
---
settings:
chains:
relay_chain: &relay_chain
relay_chain:
wsPort: 9700
collectives_parachain: &collectives_parachain
wsPort: 9710
paraId: &cp_id 1001
paraId: 1001
variables:
accounts:
liam_signer: &acc_liam_signer //Liam
liam_account32: &acc_liam_acc32 "0x3614671a5de540d891eb8c4939c8153a4aa790602b347c18177b86d0fc546221"
tests:
- name: Liam fails to join an the Alliance, Liam is already a member.
@@ -24,11 +23,8 @@ tests:
args: []
events:
- name: system.ExtrinsicFailed
attributes:
- type: SpRuntimeDispatchError
key: dispatchError
# TODO assert with Alliance Error variant - alliance.AllianceNotYetInitialized
# issue - https://github.com/paritytech/parachains-integration-tests/issues/59
value: {"Module":{"index":"50","error":"0x02000000"}}
result: {
dispatchError: { Module: { index: 50, error: '0x02000000' }}
}
# TODO assert with Alliance Error variant - alliance.AllianceNotYetInitialized
# issue - https://github.com/paritytech/parachains-integration-tests/issues/59
@@ -7,6 +7,7 @@ settings:
wsPort: 9710
paraId: &cp_id 1001
variables:
weight_threshold: &weight_threshold { refTime: [10, 10], proofSize: [10, 10] }
init_teleport_amount: &init_teleport_amount 20000000000000 # 20_000_000_000_000
accounts:
alice_signer: &acc_alice_signer //Alice
@@ -41,20 +42,17 @@ tests:
]
events:
- name: xcmPallet.Attempted
attributes:
- type: XcmV3TraitsOutcome
xcmOutcome: Complete
threshold: *weight_threshold
result: [{ Complete: { refTime: '3,000,000,000', proofSize: 0 }}]
- name: balances.Deposit
chain: *collectives_parachain
attributes:
- type: AccountId32
key: who
value: *acc_alice_ss58
result: { who: *acc_alice_ss58 }
- name: dmpQueue.ExecutedDownward
chain: *collectives_parachain
attributes:
- type: XcmV3TraitsOutcome
xcmOutcome: Complete
threshold: *weight_threshold
result: {
outcome: { Complete: { refTime: '4,000,000,000', proofSize: 0 }}
}
- name: Get the balances of the Relay Chain's treasury & Collectives parachain's future alliance member
actions:
- queries:
@@ -80,18 +78,9 @@ tests:
events:
- name: balances.Reserved
chain: *collectives_parachain
attributes:
- type: AccountId32
key: who
value: *acc_alice_ss58
- type: u128
key: amount
value: 10,000,000,000,000
result: { who: *acc_alice_ss58, amount: '10,000,000,000,000' }
- name: alliance.NewAllyJoined
attributes:
- type: AccountId32
key: ally
value: *acc_alice_ss58
result: { ally: *acc_alice_ss58 }
- queries:
balance_cp_alice_after:
chain: *collectives_parachain
@@ -148,21 +137,17 @@ tests:
]
events:
- name: sudo.Sudid
attributes:
- type: Result<Null, SpRuntimeDispatchError>
value: Ok
result: { sudoResult: Ok }
- name: xcmPallet.Sent
- name: alliance.MemberKicked
chain: *collectives_parachain
attributes:
- type: AccountId32
key: member
value: *acc_alice_ss58
result: { member: *acc_alice_ss58 }
- name: dmpQueue.ExecutedDownward
chain: *collectives_parachain
attributes:
- type: XcmV3TraitsOutcome
xcmOutcome: Complete
threshold: *weight_threshold
result: {
outcome: { Complete: { refTime: '4,000,000,000', proofSize: '1,000,000' }}
}
- queries:
balance_rc_treasury_after:
@@ -7,20 +7,21 @@ chain = "polkadot-local"
name = "alice"
ws_port = 9700
validator = true
args = ["--state-cache-size=0"]
[[relaychain.nodes]]
name = "bob"
ws_port = 9701
ws_port = 9701
validator = true
[[relaychain.nodes]]
name = "charlie"
ws_port = 9702
ws_port = 9702
validator = true
[[relaychain.nodes]]
[[relaychain.nodes]]
name = "dave"
ws_port = 9703
ws_port = 9703
validator = true
[[parachains]]
@@ -32,10 +33,10 @@ cumulus_based = true
name = "collator1"
ws_port = 9710
command = "./bin/polkadot-parachain"
args = ["-lxcm=trace"]
args = [ "-lxcm=trace", "--state-cache-size=0" ]
[[parachains.collators]]
name = "collator2"
ws_port = 9711
ws_port = 9711
command = "./bin/polkadot-parachain"
args = ["-lxcm=trace"]