Skip to content

Commit

Permalink
Merge pull request #2702 from subspace/remove-polkadot-sdk-from-subsp…
Browse files Browse the repository at this point in the history
…ace-farmer

Remove polkadot-sdk from `subspace-farmer`'s dependencies
  • Loading branch information
nazar-pc authored Apr 23, 2024
2 parents d92a0f4 + be07ce3 commit c9f3932
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions crates/subspace-verification/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ include = [
[dependencies]
codec = { package = "parity-scale-codec", version = "3.6.5", default-features = false }
schnorrkel = { version = "0.11.4", default-features = false }
sp-arithmetic = { default-features = false, git = "https://github.com/subspace/polkadot-sdk", rev = "44d742b90e7852aed1f08ab5299d5d88cfa1c6ed" }
subspace-archiving = { version = "0.1.0", path = "../subspace-archiving", default-features = false }
subspace-core-primitives = { version = "0.1.0", path = "../subspace-core-primitives", default-features = false }
subspace-proof-of-space = { version = "0.1.0", path = "../subspace-proof-of-space", default-features = false }
Expand All @@ -29,7 +28,6 @@ default = ["std"]
std = [
"codec/std",
"schnorrkel/std",
"sp-arithmetic/std",
"subspace-archiving/std",
"subspace-core-primitives/std",
"thiserror"
Expand Down
4 changes: 2 additions & 2 deletions crates/subspace-verification/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ use core::mem;
use core::simd::Simd;
use schnorrkel::context::SigningContext;
use schnorrkel::SignatureError;
use sp_arithmetic::traits::SaturatedConversion;
use subspace_archiving::archiver;
use subspace_core_primitives::crypto::kzg::{Commitment, Kzg, Witness};
use subspace_core_primitives::crypto::{
Expand Down Expand Up @@ -335,13 +334,14 @@ pub fn derive_next_solution_range(
// next_solution_range =
// (solution_ranges.current as f64 * adjustment_factor).round() as u64;
// ```
u64::saturated_from(
u64::try_from(
u128::from(current_solution_range)
.saturating_mul(u128::from(era_slot_count))
.saturating_mul(u128::from(slot_probability.0))
/ u128::from(era_duration)
/ u128::from(slot_probability.1),
)
.unwrap_or(u64::MAX)
.clamp(
current_solution_range / 4,
current_solution_range.saturating_mul(4),
Expand Down
9 changes: 6 additions & 3 deletions domains/primitives/messenger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ use crate::messages::MessageKey;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use codec::{Decode, Encode};
use frame_support::inherent::{InherentData, InherentIdentifier, IsFatalError};
#[cfg(feature = "std")]
use frame_support::inherent::InherentData;
use frame_support::inherent::{InherentIdentifier, IsFatalError};
use messages::{BlockMessagesWithStorageKey, CrossDomainMessage, MessageId};
use sp_domains::{ChainId, DomainAllowlistUpdates, DomainId};
use sp_inherents::Error;

/// Messenger inherent identifier.
pub const INHERENT_IDENTIFIER: InherentIdentifier = *b"messengr";
Expand Down Expand Up @@ -133,7 +134,9 @@ impl sp_inherents::InherentDataProvider for InherentDataProvider {

let error = InherentError::decode(&mut &*error).ok()?;

Some(Err(Error::Application(Box::from(format!("{error:?}")))))
Some(Err(sp_inherents::Error::Application(Box::from(format!(
"{error:?}"
)))))
}
}

Expand Down

0 comments on commit c9f3932

Please sign in to comment.