Merge pull request #158 from ethcore/h256-repr
Suppress RepresentH256 until it is used
This commit is contained in:
commit
d716d05e1d
|
@ -41,9 +41,7 @@ impl From<&'static str> for Block {
|
|||
}
|
||||
|
||||
impl RepresentH256 for Block {
|
||||
fn hash(&self) -> H256 {
|
||||
self.block_header.hash()
|
||||
}
|
||||
fn h256(&self) -> H256 { self.hash() }
|
||||
}
|
||||
|
||||
impl Block {
|
||||
|
@ -68,13 +66,16 @@ impl Block {
|
|||
pub fn drain(self) -> (BlockHeader, Vec<Transaction>) {
|
||||
(self.block_header, self.transactions)
|
||||
}
|
||||
|
||||
pub fn hash(&self) -> H256 {
|
||||
self.block_header.hash()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use hash::H256;
|
||||
use super::Block;
|
||||
use super::super::RepresentH256;
|
||||
|
||||
// Block 80000
|
||||
// https://blockchain.info/rawblock/000000000043a8c0fd1d6f726790caa2a406010d19efd2780db27bdbbd93baf6
|
||||
|
|
|
@ -10,7 +10,7 @@ mod merkle_root;
|
|||
mod transaction;
|
||||
|
||||
pub trait RepresentH256 {
|
||||
fn hash(&self) -> primitives::hash::H256;
|
||||
fn h256(&self) -> primitives::hash::H256;
|
||||
}
|
||||
|
||||
pub use rustc_serialize::hex;
|
||||
|
|
|
@ -8,7 +8,7 @@ use primitives::hash::H256;
|
|||
use primitives::bytes::Bytes;
|
||||
use super::{BlockRef, BestBlock, BlockLocation};
|
||||
use serialization::{serialize, deserialize};
|
||||
use chain::{self, RepresentH256};
|
||||
use chain;
|
||||
use parking_lot::RwLock;
|
||||
use transaction_meta::TransactionMeta;
|
||||
|
||||
|
@ -610,7 +610,7 @@ mod tests {
|
|||
|
||||
use super::{Storage, Store};
|
||||
use devtools::RandomTempPath;
|
||||
use chain::{Block, RepresentH256};
|
||||
use chain::Block;
|
||||
use super::super::{BlockRef, BlockLocation};
|
||||
use test_data;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ use super::{
|
|||
BlockRef, Store, Error, BestBlock, BlockLocation, BlockInsertedChain, BlockProvider,
|
||||
BlockStapler, TransactionMetaProvider, TransactionProvider,
|
||||
};
|
||||
use chain::{self, Block, RepresentH256};
|
||||
use chain::{self, Block};
|
||||
use primitives::hash::H256;
|
||||
use serialization;
|
||||
use chain::bytes::Bytes;
|
||||
|
|
|
@ -103,7 +103,7 @@ impl OrphanBlocksPool {
|
|||
}
|
||||
orphans.is_empty()
|
||||
};
|
||||
|
||||
|
||||
if remove_entry {
|
||||
orphan_entry.remove_entry();
|
||||
}
|
||||
|
@ -124,7 +124,6 @@ mod tests {
|
|||
use std::collections::HashSet;
|
||||
use test_data;
|
||||
use primitives::hash::H256;
|
||||
use chain::RepresentH256;
|
||||
use super::OrphanBlocksPool;
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
//! Block builder
|
||||
|
||||
use super::genesis;
|
||||
use chain::{self, RepresentH256};
|
||||
use chain;
|
||||
use primitives::hash::H256;
|
||||
use primitives::bytes::Bytes;
|
||||
use invoke::{Invoke, Identity};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
//! Bitcoin chain verifier
|
||||
|
||||
use db::{self, BlockRef, BlockLocation};
|
||||
use chain::{self, RepresentH256};
|
||||
use chain;
|
||||
use super::{Verify, VerificationResult, Chain, Error, TransactionError, ContinueVerify};
|
||||
use utils;
|
||||
|
||||
|
@ -277,7 +277,6 @@ mod tests {
|
|||
use test_data;
|
||||
use std::sync::Arc;
|
||||
use devtools::RandomTempPath;
|
||||
use chain::RepresentH256;
|
||||
use script;
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! Blocks verification queue
|
||||
|
||||
use chain::{Block, RepresentH256};
|
||||
use chain::Block;
|
||||
use primitives::hash::H256;
|
||||
use super::{Chain, ContinueVerify, BlockStatus, Error as VerificationError, TransactionError};
|
||||
use linked_hash_map::LinkedHashMap;
|
||||
|
@ -204,7 +204,7 @@ impl Queue {
|
|||
mod tests {
|
||||
use super::Queue;
|
||||
use super::super::{BlockStatus, VerificationResult, Verify, ContinueVerify, Chain, Error as VerificationError, TransactionError};
|
||||
use chain::{Block, RepresentH256};
|
||||
use chain::Block;
|
||||
use primitives::hash::H256;
|
||||
use test_data;
|
||||
use std::collections::HashMap;
|
||||
|
|
Loading…
Reference in New Issue