From d8f5adf23eeed6e602bb3fc73643dffcd1479ba9 Mon Sep 17 00:00:00 2001 From: aggstam Date: Sat, 9 Apr 2022 14:51:50 +0300 Subject: [PATCH] CL checks conflicts resolved --- Cargo.toml | 1 + src/consensus/util.rs | 21 +-------------------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cc737c418..776e23494 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -198,6 +198,7 @@ blockchain = [ "util", "crypto", "net", + "blockchain2", ] blockchain2 = [ diff --git a/src/consensus/util.rs b/src/consensus/util.rs index 4ca0b1b65..9aa5faa22 100644 --- a/src/consensus/util.rs +++ b/src/consensus/util.rs @@ -1,10 +1,6 @@ use chrono::{NaiveDateTime, Utc}; -use std::io; -use crate::{ - util::serial::{Decodable, Encodable, ReadExt, SerialDecodable, SerialEncodable, WriteExt}, - Result, -}; +use crate::util::serial::{SerialDecodable, SerialEncodable}; // Serialized blake3 hash bytes for character "⊥" pub const GENESIS_HASH_BYTES: [u8; 32] = [ @@ -30,18 +26,3 @@ impl Timestamp { pub fn get_current_time() -> Timestamp { Timestamp(Utc::now().timestamp()) } - -impl Encodable for blake3::Hash { - fn encode(&self, mut s: S) -> Result { - s.write_slice(self.as_bytes())?; - Ok(32) - } -} - -impl Decodable for blake3::Hash { - fn decode(mut d: D) -> Result { - let mut bytes = [0u8; 32]; - d.read_slice(&mut bytes)?; - Ok(bytes.into()) - } -}