Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 12a02a5

Browse files
committed
store: Rename test_store::Chain to FakeBlockList
1 parent 7170bf7 commit 12a02a5

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

store/postgres/tests/chain_head.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ use graph_store_postgres::Store as DieselStore;
1515
use graph_store_postgres::{layout_for_tests::FAKE_NETWORK_SHARED, ChainStore as DieselChainStore};
1616

1717
use test_store::block_store::{
18-
Chain, FakeBlock, BLOCK_FIVE, BLOCK_FOUR, BLOCK_ONE, BLOCK_ONE_NO_PARENT, BLOCK_ONE_SIBLING,
19-
BLOCK_THREE, BLOCK_THREE_NO_PARENT, BLOCK_TWO, BLOCK_TWO_NO_PARENT, GENESIS_BLOCK, NO_PARENT,
18+
FakeBlock, FakeBlockList, BLOCK_FIVE, BLOCK_FOUR, BLOCK_ONE, BLOCK_ONE_NO_PARENT,
19+
BLOCK_ONE_SIBLING, BLOCK_THREE, BLOCK_THREE_NO_PARENT, BLOCK_TWO, BLOCK_TWO_NO_PARENT,
20+
GENESIS_BLOCK, NO_PARENT,
2021
};
2122
use test_store::*;
2223

@@ -25,7 +26,7 @@ use test_store::*;
2526
const ANCESTOR_COUNT: BlockNumber = 3;
2627

2728
/// Test harness for running database integration tests.
28-
fn run_test<F>(chain: Chain, test: F)
29+
fn run_test<F>(chain: FakeBlockList, test: F)
2930
where
3031
F: Fn(Arc<DieselChainStore>, Arc<DieselStore>) -> Result<(), Error> + Send + 'static,
3132
{
@@ -42,7 +43,7 @@ where
4243
});
4344
}
4445

45-
fn run_test_async<R, F>(chain: Chain, test: F)
46+
fn run_test_async<R, F>(chain: FakeBlockList, test: F)
4647
where
4748
F: Fn(Arc<DieselChainStore>, Arc<DieselStore>) -> R + Send + Sync + 'static,
4849
R: Future<Output = ()> + Send + 'static,
@@ -65,7 +66,7 @@ where
6566
/// is the one indicated in `head_exp`. If `missing` is not `None`, check that
6667
/// `attempt_chain_head_update` reports that block as missing
6768
fn check_chain_head_update(
68-
chain: Chain,
69+
chain: FakeBlockList,
6970
head_exp: Option<&'static FakeBlock>,
7071
missing: Option<&'static str>,
7172
) {

store/test-store/src/block_store.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,12 @@ impl Block for FakeBlock {
107107
}
108108
}
109109

110-
pub type Chain<'a> = Vec<&'static FakeBlock>;
110+
pub type FakeBlockList<'a> = Vec<&'static FakeBlock>;
111111

112112
/// Store the given chain as the blocks for the `network` set the
113113
/// network's genesis block to `genesis_hash`, and head block to
114114
/// `null`
115-
pub fn set_chain(chain: Chain, network: &str) {
115+
pub fn set_chain(chain: FakeBlockList, network: &str) {
116116
let store = crate::store::STORE
117117
.block_store()
118118
.chain_store(network)

0 commit comments

Comments
 (0)