From 9fa55cb0f419375f272b9b1f60d1f79264b6d365 Mon Sep 17 00:00:00 2001 From: Sergej Date: Fri, 10 May 2024 20:03:33 +0200 Subject: [PATCH] fix tests --- pallets/regions/src/ismp_mock.rs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/pallets/regions/src/ismp_mock.rs b/pallets/regions/src/ismp_mock.rs index 5160a0f7..ea282e42 100644 --- a/pallets/regions/src/ismp_mock.rs +++ b/pallets/regions/src/ismp_mock.rs @@ -14,11 +14,12 @@ // along with RegionX. If not, see . use ismp::{ + dispatcher::{DispatchRequest, FeeMetadata, IsmpDispatcher}, error::Error, - router::{DispatchRequest, Get as IsmpGet, IsmpDispatcher, PostResponse, Request}, + router::{Get as IsmpGet, PostResponse, Request}, }; use ismp_testsuite::mocks::Host; -use sp_core::Get; +use sp_core::{Get, H256}; use std::{cell::RefCell, marker::PhantomData, sync::Arc}; pub struct MockDispatcher(pub Arc, PhantomData); @@ -47,9 +48,8 @@ impl IsmpDispatcher for MockDispatcher { fn dispatch_request( &self, request: DispatchRequest, - who: Self::Account, - _fee: Self::Balance, - ) -> Result<(), Error> { + fee: FeeMetadata, + ) -> Result { let request = match request { DispatchRequest::Get(get) => Request::Get(IsmpGet { source: T::CoretimeChain::get(), @@ -65,19 +65,18 @@ impl IsmpDispatcher for MockDispatcher { REQUESTS.with(|requests| { let mut requests = requests.borrow_mut(); - requests.push(MockRequest { request, who }); + requests.push(MockRequest { request, who: fee.payer }); }); - Ok(()) + Ok(Default::default()) } fn dispatch_response( &self, _response: PostResponse, - _who: Self::Account, - _fee: Self::Balance, - ) -> Result<(), Error> { - Ok(()) + _fee: FeeMetadata, + ) -> Result { + Ok(Default::default()) } }