-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Create benchmarks for XCM instructions introduced in v3 #4564
Changes from 1 commit
2f41600
7b56ff5
ab1c0c7
a099680
74ea1a8
5d1bab7
3c729b4
ec880ef
22de225
516b02d
3b7c47a
bc16824
70dc3f5
421dd8a
e731fdf
d32f33e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -374,6 +374,40 @@ benchmarks! { | |
| }))); | ||
| } | ||
|
|
||
| query_pallet { | ||
| let query_id = Default::default(); | ||
| let destination = T::valid_destination().map_err(|_| BenchmarkError::Skip)?; | ||
| let max_weight = Default::default(); | ||
| let mut executor = new_executor::<T>(Default::default()); | ||
|
|
||
| let instruction = Instruction::QueryPallet { | ||
| module_name: b"frame_system".to_vec(), | ||
| response_info: QueryResponseInfo { destination, query_id, max_weight }, | ||
| }; | ||
| let xcm = Xcm(vec![instruction]); | ||
| }: { | ||
| executor.execute(xcm)?; | ||
| } verify { | ||
| // TODO: Potentially add new trait to XcmSender to detect a queued outgoing message. #4426 | ||
| } | ||
|
|
||
| expect_pallet { | ||
| let mut executor = new_executor::<T>(Default::default()); | ||
|
|
||
| let instruction = Instruction::ExpectPallet { | ||
| index: 0, | ||
| name: b"System".to_vec(), | ||
| module_name: b"frame_system".to_vec(), | ||
| crate_major: 4, | ||
| min_crate_minor: 0, | ||
|
Comment on lines
+398
to
+402
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there a way to make this test more adaptable? For example, you will easily fail this benchmark when the crate version increments. Better to query some value you know will succeed here.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well hmm, I guess I could create a dummy pallet, import it into the runtime and give it a fixed index location.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would also need to be generic for any runtime we benchmark this on too, so making a custom pallet is not a good choice. |
||
| }; | ||
| let xcm = Xcm(vec![instruction]); | ||
| }: { | ||
| executor.execute(xcm)?; | ||
| } verify { | ||
| // the execution succeeding is all we need to verify this xcm was successful | ||
| } | ||
|
|
||
| impl_benchmark_test_suite!( | ||
| Pallet, | ||
| crate::generic::mock::new_test_ext(), | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.