diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 26647ca..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "ismp-solidity"] - path = pallet-ismp/evm/solidity/lib/ismp-solidity - url = https://github.com/polytope-labs/ismp-solidity.git diff --git a/Cargo.lock b/Cargo.lock index f2e70b1..38bea38 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1627,7 +1627,7 @@ dependencies = [ [[package]] name = "ismp" version = "0.1.0" -source = "git+https://github.com/polytope-labs/ismp-rs?branch=main#3a85db0d968eab5a88427a19a2a612332caec23f" +source = "git+https://github.com/polytope-labs/ismp-rs?branch=main#5c4e0f412de788b5d86de8146b49f6db6795ca12" dependencies = [ "derive_more", "parity-scale-codec", @@ -1706,7 +1706,7 @@ dependencies = [ [[package]] name = "ismp-testsuite" version = "0.1.0" -source = "git+https://github.com/polytope-labs/ismp-rs?branch=main#3a85db0d968eab5a88427a19a2a612332caec23f" +source = "git+https://github.com/polytope-labs/ismp-rs?branch=main#5c4e0f412de788b5d86de8146b49f6db6795ca12" dependencies = [ "ismp", "parity-scale-codec", diff --git a/ismp-demo/src/lib.rs b/ismp-demo/src/lib.rs index ebd3e3e..82da701 100644 --- a/ismp-demo/src/lib.rs +++ b/ismp-demo/src/lib.rs @@ -206,9 +206,8 @@ pub mod pallet { /// Dispatch request to a connected EVM chain. #[pallet::weight(Weight::from_parts(1_000_000, 0))] #[pallet::call_index(2)] - pub fn disptach_to_evm(origin: OriginFor, params: EvmParams) -> DispatchResult { + pub fn dispatch_to_evm(origin: OriginFor, params: EvmParams) -> DispatchResult { ensure_signed(origin)?; - let post = DispatchPost { dest: StateMachine::Ethereum(params.destination), from: PALLET_ID.to_bytes(), @@ -217,13 +216,13 @@ pub mod pallet { data: b"Hello from polkadot".to_vec(), gas_limit: 10_000_000, }; - - // dispatch the request let dispatcher = T::IsmpDispatcher::default(); - dispatcher - .dispatch_request(DispatchRequest::Post(post)) - .map_err(|_| Error::::TransferFailed)?; - + for _ in 0..params.count { + // dispatch the request + dispatcher + .dispatch_request(DispatchRequest::Post(post.clone())) + .map_err(|_| Error::::TransferFailed)?; + } Ok(()) } } @@ -288,6 +287,9 @@ pub mod pallet { /// Timeout timestamp on destination chain in seconds pub timeout: u64, + + /// Request count + pub count: u64, } } diff --git a/pallet-ismp/rpc/src/lib.rs b/pallet-ismp/rpc/src/lib.rs index baa676e..3e82da8 100644 --- a/pallet-ismp/rpc/src/lib.rs +++ b/pallet-ismp/rpc/src/lib.rs @@ -122,10 +122,6 @@ where #[method(name = "ismp_queryChallengePeriod")] fn query_challenge_period(&self, client_id: ConsensusClientId) -> Result; - /// Query the latest timestamp for chain - #[method(name = "ismp_queryTimestamp")] - fn query_timestamp(&self) -> Result; - /// Query the latest height for a state machine #[method(name = "ismp_queryStateMachineLatestHeight")] fn query_state_machine_latest_height(&self, id: StateMachineId) -> Result; @@ -273,15 +269,6 @@ where .ok_or_else(|| runtime_error_into_rpc_error("Error fetching Challenge period")) } - fn query_timestamp(&self) -> Result { - let api = self.client.runtime_api(); - let at = self.client.info().best_hash; - api.timestamp(at) - .ok() - .flatten() - .ok_or_else(|| runtime_error_into_rpc_error("Error fetching latest timestamp")) - } - fn query_state_machine_latest_height(&self, id: StateMachineId) -> Result { let api = self.client.runtime_api(); let at = self.client.info().best_hash; diff --git a/pallet-ismp/runtime-api/src/lib.rs b/pallet-ismp/runtime-api/src/lib.rs index b558bd3..a8364c5 100644 --- a/pallet-ismp/runtime-api/src/lib.rs +++ b/pallet-ismp/runtime-api/src/lib.rs @@ -54,9 +54,6 @@ sp_api::decl_runtime_apis! { /// Return the timestamp this client was last updated in seconds fn consensus_update_time(id: ConsensusClientId) -> Option; - /// Return the latest timestamp for the chain - fn timestamp() -> Option; - /// Return the challenge period timestamp fn challenge_period(id: ConsensusClientId) -> Option;