This commit is contained in:
hinto.janai 2024-10-01 19:45:36 -04:00
parent 8c94b7131f
commit 0d9891de19
No known key found for this signature in database
GPG key ID: D47CE05FA175A499
7 changed files with 8 additions and 29 deletions

1
Cargo.lock generated
View file

@ -915,7 +915,6 @@ name = "cuprate-types"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"bytes", "bytes",
"cuprate-constants",
"cuprate-epee-encoding", "cuprate-epee-encoding",
"cuprate-fixed-bytes", "cuprate-fixed-bytes",
"curve25519-dalek", "curve25519-dalek",

View file

@ -13,7 +13,6 @@ default = []
block = [] block = []
build = [] build = []
rpc = [] rpc = []
output = []
[dependencies] [dependencies]

View file

@ -11,15 +11,3 @@ pub const MAX_BLOCK_HEIGHT: u64 = 500_000_000;
/// [`MAX_BLOCK_HEIGHT`] as a [`usize`]. /// [`MAX_BLOCK_HEIGHT`] as a [`usize`].
#[expect(clippy::cast_possible_truncation, reason = "will not be truncated")] #[expect(clippy::cast_possible_truncation, reason = "will not be truncated")]
pub const MAX_BLOCK_HEIGHT_USIZE: usize = MAX_BLOCK_HEIGHT as usize; 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: <https://monero-book.cuprate.org/consensus_rules/blocks/difficulty.html#target-seconds>
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: <https://monero-book.cuprate.org/consensus_rules/blocks/difficulty.html#target-seconds>
pub const BLOCK_TIME_V2: Duration = Duration::from_secs(120);

View file

@ -8,7 +8,5 @@ mod macros;
pub mod block; pub mod block;
#[cfg(feature = "build")] #[cfg(feature = "build")]
pub mod build; pub mod build;
#[cfg(feature = "output")]
pub mod output;
#[cfg(feature = "rpc")] #[cfg(feature = "rpc")]
pub mod rpc; pub mod rpc;

View file

@ -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;

View file

@ -16,7 +16,6 @@ serde = ["dep:serde"]
proptest = ["dep:proptest", "dep:proptest-derive"] proptest = ["dep:proptest", "dep:proptest-derive"]
[dependencies] [dependencies]
cuprate-constants = { path = "../constants", features = ["block"] }
cuprate-epee-encoding = { path = "../net/epee-encoding", optional = true } cuprate-epee-encoding = { path = "../net/epee-encoding", optional = true }
cuprate-fixed-bytes = { path = "../net/fixed-bytes" } cuprate-fixed-bytes = { path = "../net/fixed-bytes" }

View file

@ -3,7 +3,14 @@ use std::time::Duration;
use monero_serai::block::BlockHeader; use monero_serai::block::BlockHeader;
use cuprate_constants::block::{BLOCK_TIME_V1, BLOCK_TIME_V2}; /// Target block time for hf 1.
///
/// ref: <https://monero-book.cuprate.org/consensus_rules/blocks/difficulty.html#target-seconds>
const BLOCK_TIME_V1: Duration = Duration::from_secs(60);
/// Target block time from v2.
///
/// ref: <https://monero-book.cuprate.org/consensus_rules/blocks/difficulty.html#target-seconds>
const BLOCK_TIME_V2: Duration = Duration::from_secs(120);
/// An error working with a [`HardFork`]. /// An error working with a [`HardFork`].
#[derive(Debug, Copy, Clone, PartialEq, Eq, thiserror::Error)] #[derive(Debug, Copy, Clone, PartialEq, Eq, thiserror::Error)]