Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 0d1c34a

Browse files
NachoPalgilescope
authored andcommitted
Update Integration tests Statemine & Statemint (#1526)
1 parent 05abc1a commit 0d1c34a

File tree

6 files changed

+29
-156
lines changed

6 files changed

+29
-156
lines changed

parachains/integration-tests/statemine/xcm/0_init.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ tests:
5656
]
5757
events:
5858
- name: sudo.Sudid
59-
attributes:
59+
attribute:
6060
type: Result<Null, SpRuntimeDispatchError>
6161
value: Ok
6262
- name: xcmPallet.SupportedVersionChanged
@@ -82,7 +82,7 @@ tests:
8282
]
8383
events:
8484
- name: sudo.Sudid
85-
attributes:
85+
attribute:
8686
type: Result<Null, SpRuntimeDispatchError>
8787
value: Ok
8888
- name: xcmPallet.SupportedVersionChanged

parachains/integration-tests/statemine/xcm/3_hrmp-open-channels.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,10 @@ tests:
200200
- name: polkadotXcm.Sent
201201
- name: ump.ExecutedUpward
202202
chain: *relay_chain
203-
attributes:
203+
attribute:
204204
type: XcmV2TraitsOutcome
205205
isComplete: true
206-
value: 4,000,000
206+
value: 1,160,892,000
207207
- name: hrmp.OpenChannelRequested
208208
chain: *relay_chain
209209
- queries:
@@ -394,9 +394,9 @@ tests:
394394
- name: polkadotXcm.Sent
395395
- name: ump.ExecutedUpward
396396
chain: *relay_chain
397-
attributes:
397+
attribute:
398398
type: XcmV2TraitsOutcome
399399
isComplete: true
400-
value: 4,000,000
400+
value: 1,160,892,000
401401
- name: hrmp.OpenChannelAccepted
402402
chain: *relay_chain

parachains/integration-tests/statemine/xcm/4_hrmp.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -165,16 +165,16 @@ tests:
165165
]
166166
events:
167167
- name: polkadotXcm.Attempted
168-
attributes:
168+
attribute:
169169
type: XcmV2TraitsOutcome
170170
isComplete: true
171171
value: 1,000,000,000
172172
- name: assets.Transferred
173-
attributes:
173+
attribute:
174174
type: AccountId32
175175
value: *pp_sovereign_sibl
176176
- name: assets.Transferred
177-
attributes:
177+
attribute:
178178
type: u128
179179
value: *amount_to_send
180180

@@ -212,16 +212,16 @@ tests:
212212
]
213213
events:
214214
- name: polkadotXcm.Attempted
215-
attributes:
215+
attribute:
216216
type: XcmV2TraitsOutcome
217217
isComplete: true
218218
value: 1,000,000,000
219219
- name: balances.Endowed
220-
attributes:
220+
attribute:
221221
type: AccountId32
222222
value: *pp_sovereign_sibl
223223
- name: balances.Endowed
224-
attributes:
224+
attribute:
225225
type: u128
226226
value: *amount
227227

@@ -278,17 +278,17 @@ tests:
278278
- name: polkadotXcm.Sent
279279
- name: assets.Burned
280280
chain: *assets_parachain
281-
attributes:
281+
attribute:
282282
type: AccountId32
283283
value: *pp_sovereign_sibl
284284
- name: assets.Issued
285285
chain: *assets_parachain
286-
attributes:
286+
attribute:
287287
type: u32
288288
value: *asset_id
289289
- name: system.Remarked
290290
chain: *assets_parachain
291-
attributes:
291+
attribute:
292292
type: AccountId32
293293
value: *pp_sovereign_sibl
294294
- queries:
@@ -348,6 +348,6 @@ tests:
348348
events:
349349
- name: xcmpQueue.Fail
350350
chain: *assets_parachain
351-
attributes:
351+
attribute:
352352
type: XcmV2TraitsError
353353
value: FailedToTransactAsset

parachains/integration-tests/statemint/xcm/0_init.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ tests:
5656
]
5757
events:
5858
- name: sudo.Sudid
59-
attributes:
59+
attribute:
6060
type: Result<Null, SpRuntimeDispatchError>
6161
value: Ok
6262
- name: xcmPallet.SupportedVersionChanged
@@ -82,7 +82,7 @@ tests:
8282
]
8383
events:
8484
- name: sudo.Sudid
85-
attributes:
85+
attribute:
8686
type: Result<Null, SpRuntimeDispatchError>
8787
value: Ok
8888
- name: xcmPallet.SupportedVersionChanged

parachains/integration-tests/statemint/xcm/3_hrmp-open-channels.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,10 @@ tests:
198198
- name: polkadotXcm.Sent
199199
- name: ump.ExecutedUpward
200200
chain: *relay_chain
201-
attributes:
201+
attribute:
202202
type: XcmV2TraitsOutcome
203203
isComplete: true
204-
value: 4,000,000
204+
value: 4,000,000,000
205205
- name: hrmp.OpenChannelRequested
206206
chain: *relay_chain
207207
- queries:
@@ -392,9 +392,9 @@ tests:
392392
- name: polkadotXcm.Sent
393393
- name: ump.ExecutedUpward
394394
chain: *relay_chain
395-
attributes:
395+
attribute:
396396
type: XcmV2TraitsOutcome
397397
isComplete: true
398-
value: 4,000,000
398+
value: 4,000,000,000
399399
- name: hrmp.OpenChannelAccepted
400400
chain: *relay_chain

parachains/integration-tests/statemint/xcm/4_hrmp.yml

+7-134
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ settings:
3333
suff_asset_fungible: &ap_suff_asset_fungible { id: *suff_asset, fun: { fungible: *weight_at_most }}
3434
suff_asset_fungible_fail: &ap_suff_asset_fungible_fail { id: *suff_asset_fail, fun: { fungible: *weight_at_most }}
3535
penpal_parachain:
36-
sovereign_account: &pp_sovereign_sibl FBeL7EAeUroLWXW1yfKboiqTqVfbRBcsUKd6QqVf4kGBySS
36+
sovereign_account: &pp_sovereign_sibl 13cKp89Msu7M2PiaCuuGr1BzAsD5V3vaVbDMs3YtjMZHdGwR
3737
signer: &pp_signer //Alice
3838
penpal_parachain_account: &pp_acc '0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d'
3939
decodedCalls:
@@ -164,16 +164,16 @@ tests:
164164
]
165165
events:
166166
- name: polkadotXcm.Attempted
167-
attributes:
167+
attribute:
168168
type: XcmV2TraitsOutcome
169169
isComplete: true
170170
value: 1,000,000,000
171171
- name: assets.Transferred
172-
attributes:
172+
attribute:
173173
type: AccountId32
174174
value: *pp_sovereign_sibl
175175
- name: assets.Transferred
176-
attributes:
176+
attribute:
177177
type: u128
178178
value: *amount_to_send
179179

@@ -211,142 +211,15 @@ tests:
211211
]
212212
events:
213213
- name: polkadotXcm.Attempted
214-
attributes:
214+
attribute:
215215
type: XcmV2TraitsOutcome
216216
isComplete: true
217217
value: 1,000,000,000
218218
- name: balances.Endowed
219-
attributes:
219+
attribute:
220220
type: AccountId32
221221
value: *pp_sovereign_sibl
222222
- name: balances.Endowed
223-
attributes:
223+
attribute:
224224
type: u128
225225
value: *amount
226-
227-
- name: polkadotXcm.send( system.remarkWithEvent() ) | Penpal Parachain -> Assets Parachain
228-
before:
229-
- name: Get the asset balance of the Penpal Parachain Sovereign account in Assets Parachain
230-
actions:
231-
- queries:
232-
assets_balance_pp_sovereign_before:
233-
chain: *assets_parachain
234-
pallet: assets
235-
call: account
236-
args: [
237-
*asset_id,
238-
*pp_sovereign_sibl
239-
]
240-
its:
241-
- name: Penpal Parachain should be able to send XCM message paying its fee with sufficient asset[2] in Assets Parachain
242-
actions:
243-
- extrinsics:
244-
- chain: *penpal_parachain
245-
signer: *pp_signer
246-
sudo: true
247-
pallet: polkadotXcm
248-
call: send
249-
args: [
250-
*ap_dest_routed, # destination
251-
{
252-
v2: [ #message
253-
{
254-
WithdrawAsset: [*ap_suff_asset_fungible]
255-
},
256-
{
257-
BuyExecution: {
258-
fees: *ap_suff_asset_fungible,
259-
weightLimit: Unlimited
260-
}
261-
},
262-
{
263-
Transact: {
264-
originType: SovereignAccount,
265-
requireWeightAtMost: *weight_at_most,
266-
call: $system_remark_with_event
267-
}
268-
}
269-
]
270-
}
271-
]
272-
events:
273-
- name: sudo.Sudid
274-
attribute:
275-
type: Result<Null, SpRuntimeDispatchError>
276-
value: Ok
277-
- name: polkadotXcm.Sent
278-
- name: assets.Burned
279-
chain: *assets_parachain
280-
attributes:
281-
type: AccountId32
282-
value: *pp_sovereign_sibl
283-
- name: assets.Issued
284-
chain: *assets_parachain
285-
attributes:
286-
type: u32
287-
value: *asset_id
288-
- name: system.Remarked
289-
chain: *assets_parachain
290-
attributes:
291-
type: AccountId32
292-
value: *pp_sovereign_sibl
293-
- queries:
294-
assets_balance_pp_sovereign_after:
295-
chain: *assets_parachain
296-
pallet: assets
297-
call: account
298-
args: [
299-
*asset_id,
300-
*pp_sovereign_sibl
301-
]
302-
303-
- name: Should reduce the asset[2] balance of the Penpal Parachain's SovereignAccount in the Assets Parachain
304-
actions:
305-
- asserts:
306-
assetsDecreased:
307-
args: [
308-
{
309-
balances: {
310-
before: $assets_balance_pp_sovereign_before,
311-
after: $assets_balance_pp_sovereign_after,
312-
},
313-
}
314-
]
315-
316-
- name: Penpal Parachain SHOULD NOT be able to send XCM message paying its fee with sufficient asset[3] if not balance
317-
actions:
318-
- extrinsics:
319-
- chain: *penpal_parachain
320-
signer: *pp_signer
321-
sudo: true
322-
pallet: polkadotXcm
323-
call: send
324-
args: [
325-
*ap_dest_routed, # destination
326-
{
327-
v2: [ #message
328-
{
329-
WithdrawAsset: [*ap_suff_asset_fungible_fail]
330-
},
331-
{
332-
BuyExecution: {
333-
fees: *ap_suff_asset_fungible_fail,
334-
weightLimit: Unlimited
335-
}
336-
},
337-
{
338-
Transact: {
339-
originType: SovereignAccount,
340-
requireWeightAtMost: *weight_at_most,
341-
call: $system_remark_with_event
342-
}
343-
}
344-
]
345-
}
346-
]
347-
events:
348-
- name: xcmpQueue.Fail
349-
chain: *assets_parachain
350-
attributes:
351-
type: XcmV2TraitsError
352-
value: FailedToTransactAsset

0 commit comments

Comments
 (0)