Client::info() no longer returns a Result (#2776)

This commit is contained in:
Pierre Krieger
2019-06-04 16:09:46 +02:00
committed by Bastian Köcher
parent 53e8ad8728
commit 5df89a8a6f
33 changed files with 235 additions and 274 deletions
@@ -134,7 +134,7 @@ impl<S, F, Block> BlockchainHeaderBackend<Block> for Blockchain<S, F> where Bloc
}
}
fn info(&self) -> ClientResult<BlockchainInfo<Block>> {
fn info(&self) -> BlockchainInfo<Block> {
self.storage.info()
}
@@ -223,8 +223,8 @@ pub mod tests {
Err(ClientError::Backend("Test error".into()))
}
fn info(&self) -> ClientResult<Info<Block>> {
Err(ClientError::Backend("Test error".into()))
fn info(&self) -> Info<Block> {
panic!("Test error")
}
fn status(&self, _id: BlockId<Block>) -> ClientResult<BlockStatus> {
+4 -4
View File
@@ -668,8 +668,8 @@ pub mod tests {
test_client::LocalExecutor::new(None)
);
let local_checker = &local_checker as &FetchChecker<Block>;
let max = remote_client.info().unwrap().chain.best_number;
let max_hash = remote_client.info().unwrap().chain.best_hash;
let max = remote_client.info().chain.best_number;
let max_hash = remote_client.info().chain.best_hash;
for (index, (begin, end, key, expected_result)) in test_cases.into_iter().enumerate() {
let begin_hash = remote_client.block_hash(begin).unwrap().unwrap();
@@ -764,8 +764,8 @@ pub mod tests {
test_client::LocalExecutor::new(None)
);
let local_checker = &local_checker as &FetchChecker<Block>;
let max = remote_client.info().unwrap().chain.best_number;
let max_hash = remote_client.info().unwrap().chain.best_hash;
let max = remote_client.info().chain.best_number;
let max_hash = remote_client.info().chain.best_hash;
let (begin, end, key, _) = test_cases[0].clone();
let begin_hash = remote_client.block_hash(begin).unwrap().unwrap();