use polkadot_sdk::*;
use crate::utils::ModuleId;
use alloc::boxed::Box;
use frame_support::weights::Weight;
use ismp::router::{PostRequest, Response, Timeout};
pub trait IsmpModuleWeight {
fn on_accept(&self, request: &PostRequest) -> Weight;
fn on_timeout(&self, request: &Timeout) -> Weight;
fn on_response(&self, response: &Response) -> Weight;
}
impl IsmpModuleWeight for () {
fn on_accept(&self, _request: &PostRequest) -> Weight {
Weight::zero()
}
fn on_timeout(&self, _request: &Timeout) -> Weight {
Weight::zero()
}
fn on_response(&self, _response: &Response) -> Weight {
Weight::zero()
}
}
pub trait WeightProvider {
fn module_callback(dest_module: ModuleId) -> Option<Box<dyn IsmpModuleWeight>>;
}
impl WeightProvider for () {
fn module_callback(_dest_module: ModuleId) -> Option<Box<dyn IsmpModuleWeight>> {
None
}
}
pub trait MigrationWeightInfo {
fn drain_state_commitments_step(n: u32) -> Weight;
fn drain_state_machine_update_time_step(n: u32) -> Weight;
fn drain_child_trie_state_commitments_step(n: u32) -> Weight;
}
impl MigrationWeightInfo for () {
fn drain_state_commitments_step(_n: u32) -> Weight {
Weight::zero()
}
fn drain_state_machine_update_time_step(_n: u32) -> Weight {
Weight::zero()
}
fn drain_child_trie_state_commitments_step(_n: u32) -> Weight {
Weight::zero()
}
}