From 0d9891de1968bf257050eee939791062e7af28b6 Mon Sep 17 00:00:00 2001 From: "hinto.janai" Date: Tue, 1 Oct 2024 19:45:36 -0400 Subject: [PATCH] revert --- Cargo.lock | 1 - constants/Cargo.toml | 1 - constants/src/block.rs | 12 ------------ constants/src/lib.rs | 2 -- constants/src/output.rs | 11 ----------- types/Cargo.toml | 1 - types/src/hard_fork.rs | 9 ++++++++- 7 files changed, 8 insertions(+), 29 deletions(-) delete mode 100644 constants/src/output.rs diff --git a/Cargo.lock b/Cargo.lock index 42ddb4f..0fc5da0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -915,7 +915,6 @@ name = "cuprate-types" version = "0.0.0" dependencies = [ "bytes", - "cuprate-constants", "cuprate-epee-encoding", "cuprate-fixed-bytes", "curve25519-dalek", diff --git a/constants/Cargo.toml b/constants/Cargo.toml index 11dbb82..6d3e031 100644 --- a/constants/Cargo.toml +++ b/constants/Cargo.toml @@ -13,7 +13,6 @@ default = [] block = [] build = [] rpc = [] -output = [] [dependencies] diff --git a/constants/src/block.rs b/constants/src/block.rs index 0a39186..7df40e8 100644 --- a/constants/src/block.rs +++ b/constants/src/block.rs @@ -11,15 +11,3 @@ pub const MAX_BLOCK_HEIGHT: u64 = 500_000_000; /// [`MAX_BLOCK_HEIGHT`] as a [`usize`]. #[expect(clippy::cast_possible_truncation, reason = "will not be truncated")] pub const MAX_BLOCK_HEIGHT_USIZE: usize = MAX_BLOCK_HEIGHT as usize; - -/// Target block time for hardfork 1. -#[doc = monero_definition_link!(a1dc85c5373a30f14aaf7dcfdd95f5a7375d3623, "/src/cryptonote_config.h", 81)] -/// -/// ref: -pub const BLOCK_TIME_V1: Duration = Duration::from_secs(60); - -/// Target block time from hardfork v2. -#[doc = monero_definition_link!(a1dc85c5373a30f14aaf7dcfdd95f5a7375d3623, "/src/cryptonote_config.h", 80)] -/// -/// ref: -pub const BLOCK_TIME_V2: Duration = Duration::from_secs(120); diff --git a/constants/src/lib.rs b/constants/src/lib.rs index d53bde5..f1b29fb 100644 --- a/constants/src/lib.rs +++ b/constants/src/lib.rs @@ -8,7 +8,5 @@ mod macros; pub mod block; #[cfg(feature = "build")] pub mod build; -#[cfg(feature = "output")] -pub mod output; #[cfg(feature = "rpc")] pub mod rpc; diff --git a/constants/src/output.rs b/constants/src/output.rs deleted file mode 100644 index f3ce7a0..0000000 --- a/constants/src/output.rs +++ /dev/null @@ -1,11 +0,0 @@ -//! Output related. - -use crate::macros::monero_definition_link; - -/// The minimum amount of blocks a coinbase output is locked for. -#[doc = monero_definition_link!(a1dc85c5373a30f14aaf7dcfdd95f5a7375d3623, "/src/cryptonote_config.h", 40)] -pub const COINBASE_LOCK_WINDOW: usize = 60; - -/// The minimum amount of blocks an output is locked for. -#[doc = monero_definition_link!(a1dc85c5373a30f14aaf7dcfdd95f5a7375d3623, "/src/cryptonote_config.h", 49)] -pub const DEFAULT_LOCK_WINDOW: usize = 10; diff --git a/types/Cargo.toml b/types/Cargo.toml index 1788d61..4b9204b 100644 --- a/types/Cargo.toml +++ b/types/Cargo.toml @@ -16,7 +16,6 @@ serde = ["dep:serde"] proptest = ["dep:proptest", "dep:proptest-derive"] [dependencies] -cuprate-constants = { path = "../constants", features = ["block"] } cuprate-epee-encoding = { path = "../net/epee-encoding", optional = true } cuprate-fixed-bytes = { path = "../net/fixed-bytes" } diff --git a/types/src/hard_fork.rs b/types/src/hard_fork.rs index 4f87bb3..8b2cd78 100644 --- a/types/src/hard_fork.rs +++ b/types/src/hard_fork.rs @@ -3,7 +3,14 @@ use std::time::Duration; use monero_serai::block::BlockHeader; -use cuprate_constants::block::{BLOCK_TIME_V1, BLOCK_TIME_V2}; +/// Target block time for hf 1. +/// +/// ref: +const BLOCK_TIME_V1: Duration = Duration::from_secs(60); +/// Target block time from v2. +/// +/// ref: +const BLOCK_TIME_V2: Duration = Duration::from_secs(120); /// An error working with a [`HardFork`]. #[derive(Debug, Copy, Clone, PartialEq, Eq, thiserror::Error)]