Remove GetNodeData

This commit is contained in:
rakita
2020-08-24 14:18:03 +02:00
committed by Artem Vorotnikov
parent 32ea4d69a3
commit a8668b371c
13 changed files with 12 additions and 187 deletions

View File

@@ -2278,10 +2278,6 @@ impl BlockChainClient for Client {
self.chain.read().find_uncle_hashes(hash, MAX_UNCLE_AGE)
}
fn state_data(&self, hash: &H256) -> Option<Bytes> {
self.state_db.read().journal_db().state(hash)
}
fn block_receipts(&self, hash: &H256) -> Option<BlockReceipts> {
self.chain.read().block_receipts(hash)
}

View File

@@ -929,17 +929,6 @@ impl BlockChainClient for TestBlockChainClient {
None
}
// TODO: returns just hashes instead of node state rlp(?)
fn state_data(&self, hash: &H256) -> Option<Bytes> {
// starts with 'f' ?
if *hash > H256::from("f000000000000000000000000000000000000000000000000000000000000000") {
let mut rlp = RlpStream::new();
rlp.append(&hash.clone());
return Some(rlp.out());
}
None
}
fn block_receipts(&self, hash: &H256) -> Option<BlockReceipts> {
// starts with 'f' ?
if *hash > H256::from("f000000000000000000000000000000000000000000000000000000000000000") {

View File

@@ -322,9 +322,6 @@ pub trait BlockChainClient:
/// Get all possible uncle hashes for a block.
fn find_uncles(&self, hash: &H256) -> Option<Vec<H256>>;
/// Get latest state node
fn state_data(&self, hash: &H256) -> Option<Bytes>;
/// Get block receipts data by block header hash.
fn block_receipts(&self, hash: &H256) -> Option<BlockReceipts>;

View File

@@ -89,15 +89,6 @@ fn should_return_registrar() {
assert!(U256::from_str(address).is_ok());
}
#[test]
fn returns_state_root_basic() {
let client = generate_dummy_client(6);
let test_spec = Spec::new_test();
let genesis_header = test_spec.genesis_header();
assert!(client.state_data(genesis_header.state_root()).is_some());
}
#[test]
fn imports_good_block() {
let db = test_helpers::new_db();