Skip to content

Commit

Permalink
test: add test for multiple events of same type
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Bell committed Oct 29, 2022
1 parent 1a57f8c commit 3b8f781
Show file tree
Hide file tree
Showing 2 changed files with 133 additions and 0 deletions.
45 changes: 45 additions & 0 deletions tests/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[settings]
timeout = 1000

[relaychain]
chain = "rococo-local"
default_command = "./bin/polkadot"

[[relaychain.nodes]]
name = "alice"
validator = true
ws_port = 9900
extra_args = [ "-lparachain=debug" ]

[[relaychain.nodes]]
name = "bob"
validator = true
extra_args = [ "-lparachain=debug" ]

[[relaychain.nodes]]
name = "charlie"
validator = true
extra_args = [ "-lparachain=debug" ]

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

[[parachains.collators]]
name = "statemine-collator01"
command = "./bin/polkadot-parachain"
ws_port = 9910
args = ["--log=xcm=trace,pallet-assets=trace"]

[[parachains.collators]]
name = "statemine-collator02"
command = "./bin/polkadot-parachain"
ws_port = 9911
args = ["--log=xcm=trace,pallet-assets=trace"]

[types.Header]
number = "u64"
parent_hash = "Hash"
post_state = "Hash"
88 changes: 88 additions & 0 deletions tests/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
settings:
chains:
relay_chain: &relay_chain
wsPort: 9900
reserve_parachain:
wsPort: 9910
paraId: &reserve_parachain_id 1000
variables:
common:
amount_to_send: &amount_to_send 1000000000000000
chains:
relay_chain:
alice_signer: &relay_chain_signer //Alice
alice_account: &relay_chain_account 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
reserve_parachain:
bob_account: &reserve_parachain_account '0x8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48'

tests:
- name: Tests
describes:
- name: Multiple events of same type
its:
- name: Tests should support multiple events of the same type
actions:
- extrinsics:
- chain: *relay_chain
signer: *relay_chain_signer
pallet: xcmPallet
call: limitedTeleportAssets
args: [
{ # destination
v1: {
parents: 0,
interior: {
x1: {
Parachain: *reserve_parachain_id
}
}
}
},
{ # beneficiary
v1: {
parents: 0,
interior: {
x1: {
AccountId32: {
network: Any,
id: *reserve_parachain_account
}
}
}
}
},
{ # assets
v1: [
{
id: {
Concrete: {
parents: 0,
interior: Here
}
},
fun: {
Fungible: *amount_to_send
}
}
]
},
0, # feeAssetItem
Unlimited # weightLimit
]
events:
# ensure multiple events of same type can be matched
- name: balances.Withdraw
attributes:
- type: AccountId32
value: *relay_chain_account
- type: u128
value: *amount_to_send
- name: balances.Withdraw
attributes:
- type: AccountId32
value: *relay_chain_account
- type: u128
threshold: [10, 10]
value: 148,804,953
- name: xcmPallet.Attempted # ensure an event can be matched by name only

0 comments on commit 3b8f781

Please sign in to comment.