From 144afed36aa105d69b36f34ff586ad874c3123ec Mon Sep 17 00:00:00 2001 From: dastansam Date: Fri, 3 May 2024 12:40:18 +0200 Subject: [PATCH] Clean up comments, todos --- crates/subspace-fake-runtime-api/Cargo.toml | 2 +- crates/subspace-fake-runtime-api/src/lib.rs | 33 ++------------------- crates/subspace-service/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 33 deletions(-) diff --git a/crates/subspace-fake-runtime-api/Cargo.toml b/crates/subspace-fake-runtime-api/Cargo.toml index 7bed1185574..5e1f48129fd 100644 --- a/crates/subspace-fake-runtime-api/Cargo.toml +++ b/crates/subspace-fake-runtime-api/Cargo.toml @@ -2,7 +2,7 @@ name = "subspace-fake-runtime-api" version = "0.1.0" authors = ["Subspace Labs "] -description = "Fake subspace runtime." +description = "Fake subspace runtime API." edition = "2021" license = "GPL-3.0-or-later" homepage = "https://subspace.network" diff --git a/crates/subspace-fake-runtime-api/src/lib.rs b/crates/subspace-fake-runtime-api/src/lib.rs index 8de4f04d53a..7cf5ce18f57 100644 --- a/crates/subspace-fake-runtime-api/src/lib.rs +++ b/crates/subspace-fake-runtime-api/src/lib.rs @@ -14,9 +14,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -//! Provides "fake" runtime API and `RuntimeGenesisConfig` implementations as a workaround for compile-time checks. -//! -//! These are used to provide a type that implements these runtime apis without requiring to import the native runtimes. +//! Provides "fake" runtime API implementation as a workaround for compile-time checks. use domain_runtime_primitives::opaque::Header as DomainHeader; use domain_runtime_primitives::{BlockNumber as DomainNumber, Hash as DomainHash}; @@ -51,18 +49,10 @@ mod mmr { pub use pallet_mmr::primitives::*; use sp_core::H256; // Full type for this is actually `<::Hashing as sp_runtime::traits::Hash>::Output` - // but since we don't really want to impl pallet for the test runtime, we just use the `Keccak256::Output = H256` + // but since we don't really want to impl pallet for the fake runtime, we just use the `Keccak256::Output = H256` pub type Hash = H256; } -sp_api::decl_runtime_apis! { - /// This runtime api is only implemented for the test runtime! - pub trait GetLastTimestamp { - /// Returns the last timestamp of a runtime. - fn get_last_timestamp() -> u64; - } -} - struct Runtime; sp_api::impl_runtime_apis! { @@ -137,7 +127,6 @@ sp_api::impl_runtime_apis! { } fn validated_object_call_hashes() -> Vec { - // No pallets produce objects right now unreachable!() } } @@ -164,8 +153,6 @@ sp_api::impl_runtime_apis! { } fn is_in_block_list(_farmer_public_key: &FarmerPublicKey) -> bool { - // TODO: Either check tx pool too for pending equivocations or replace equivocation - // mechanism with an alternative one, so that blocking happens faster unreachable!() } @@ -462,20 +449,4 @@ sp_api::impl_runtime_apis! { unreachable!() } } - - #[cfg(feature = "runtime-benchmarks")] - impl frame_benchmarking::Benchmark for Runtime { - fn benchmark_metadata(_extra: bool) -> ( - Vec, - Vec, - ) { - unreachable!() - } - - fn dispatch_benchmark( - _config: frame_benchmarking::BenchmarkConfig - ) -> Result, sp_runtime::RuntimeString> { - unreachable!() - } - } } diff --git a/crates/subspace-service/Cargo.toml b/crates/subspace-service/Cargo.toml index 73db5487da9..9042b6e08bb 100644 --- a/crates/subspace-service/Cargo.toml +++ b/crates/subspace-service/Cargo.toml @@ -93,4 +93,4 @@ pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/subspac runtime-benchmarks = [ "dep:frame-benchmarking", "sc-domains/runtime-benchmarks", -] \ No newline at end of file +]