Added receive_single_message_proof_with_dispatch benchmark (#1990)

* added receive_single_message_proof_with_dispatch benchmark

* clippy
This commit is contained in:
Svyatoslav Nikolsky
2023-03-24 13:45:39 +03:00
committed by Bastian Köcher
parent a75c28d5b2
commit 830afff353
13 changed files with 276 additions and 228 deletions
@@ -403,6 +403,21 @@ pub trait WeightInfoExt: WeightInfo {
(15 * 1024);
proof_size_in_bytes * byte_weight
}
// Functions that may be used by runtime developers.
/// Returns dispatch weight of message of given size.
///
/// This function would return correct value only if your runtime is configured to run
/// `receive_single_message_proof_with_dispatch` benchmark. See its requirements for
/// details.
fn message_dispatch_weight(message_size: u32) -> Weight {
// There may be a tiny overweight/underweight here, because we don't account how message
// size affects all steps before dispatch. But the effect should be small enough and we
// may ignore it.
Self::receive_single_message_proof_with_dispatch(message_size)
.saturating_sub(Self::receive_single_message_proof())
}
}
impl WeightInfoExt for () {