pallet_messenger/extensions/
weights.rs1use crate::extensions::weights_from_consensus::WeightInfo as WeightsFromConsensus;
4use crate::extensions::weights_from_domains::WeightInfo as WeightsFromDomains;
5use core::marker::PhantomData;
6use frame_support::pallet_prelude::Weight;
7
8pub trait WeightInfo: FromConsensusWeightInfo + FromDomainWeightInfo {
10 fn mmr_proof_verification_on_consensus() -> Weight;
11 fn mmr_proof_verification_on_domain() -> Weight;
12}
13
14pub trait FromConsensusWeightInfo {
15 fn from_consensus_relay_message_channel_open() -> Weight;
16 fn from_consensus_relay_message() -> Weight;
17 fn from_consensus_relay_message_response() -> Weight;
18}
19
20pub trait FromDomainWeightInfo {
21 fn from_domains_relay_message_channel_open() -> Weight;
22 fn from_domains_relay_message() -> Weight;
23 fn from_domains_relay_message_response() -> Weight;
24}
25
26pub struct SubstrateWeight<T>(PhantomData<T>);
28
29impl<T: frame_system::Config> FromConsensusWeightInfo for SubstrateWeight<T> {
30 fn from_consensus_relay_message_channel_open() -> Weight {
31 WeightsFromConsensus::<T>::from_consensus_relay_message_channel_open()
32 }
33
34 fn from_consensus_relay_message() -> Weight {
35 WeightsFromConsensus::<T>::from_consensus_relay_message()
36 }
37
38 fn from_consensus_relay_message_response() -> Weight {
39 WeightsFromConsensus::<T>::from_consensus_relay_message_response()
40 }
41}
42
43impl<T: frame_system::Config> FromDomainWeightInfo for SubstrateWeight<T> {
44 fn from_domains_relay_message_channel_open() -> Weight {
45 WeightsFromDomains::<T>::from_domains_relay_message_channel_open()
46 }
47
48 fn from_domains_relay_message() -> Weight {
49 WeightsFromDomains::<T>::from_domains_relay_message()
50 }
51
52 fn from_domains_relay_message_response() -> Weight {
53 WeightsFromDomains::<T>::from_domains_relay_message_response()
54 }
55}
56
57impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
58 fn mmr_proof_verification_on_consensus() -> Weight {
59 Weight::from_parts(153_000_000, 0)
62 }
63
64 fn mmr_proof_verification_on_domain() -> Weight {
65 Weight::from_parts(595_000_000, 0)
68 }
69}