Explorar el Código

[clock] moved clock to consensus

mohab metwally hace 3 años
padre
commit
fca2e499a6
Se han modificado 5 ficheros con 5 adiciones y 6 borrados
  1. 0 1
      example/lead.rs
  2. 0 0
      src/consensus/clock.rs
  3. 4 0
      src/consensus/mod.rs
  4. 1 1
      src/stakeholder/mod.rs
  5. 0 4
      src/util/mod.rs

+ 0 - 1
example/lead.rs

@@ -17,7 +17,6 @@ fn main() {
     //
 
     //
-    const LEN: usize = 10;
     let _value = 33223; //static stake value
 
     //

+ 0 - 0
src/util/clock.rs → src/consensus/clock.rs


+ 4 - 0
src/consensus/mod.rs

@@ -29,6 +29,10 @@ pub mod proto;
 /// async tasks to utilize the protocols
 pub mod task;
 
+/// Lamport clock
+pub mod clock;
+pub use clock::{Clock, Ticks};
+
 use lazy_static::lazy_static;
 lazy_static! {
     /// Genesis hash for the mainnet chain

+ 1 - 1
src/stakeholder/mod.rs

@@ -15,6 +15,7 @@ use crate::{
     consensus::{
         Block, BlockInfo, Header, OuroborosMetadata, StakeholderMetadata, StreamletMetadata,
         TransactionLeadProof,
+        clock::{Clock, Ticks},
     },
     crypto::{
         address::Address,
@@ -37,7 +38,6 @@ use crate::{
         Transaction,
     },
     util::{
-        clock::{Clock, Ticks},
         path::expand_path,
         time::Timestamp,
     },

+ 0 - 4
src/util/mod.rs

@@ -5,10 +5,6 @@ pub mod async_util;
 /// Command-line interface utilities
 pub mod cli;
 
-/// Lamport clock (TODO: maybe shouldn't be in util module)
-pub mod clock;
-pub use clock::{Clock, Ticks};
-
 /// Various encoding formats
 pub mod encoding;