mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 04:01:02 +00:00
Client::info() no longer returns a Result (#2776)
This commit is contained in:
committed by
Bastian Köcher
parent
53e8ad8728
commit
5df89a8a6f
@@ -561,7 +561,7 @@ fn finalize_3_voters_no_observers() {
|
||||
net.sync();
|
||||
|
||||
for i in 0..3 {
|
||||
assert_eq!(net.peer(i).client().info().unwrap().chain.best_number, 20,
|
||||
assert_eq!(net.peer(i).client().info().chain.best_number, 20,
|
||||
"Peer #{} failed to sync", i);
|
||||
}
|
||||
|
||||
@@ -673,7 +673,7 @@ fn transition_3_voters_twice_1_full_observer() {
|
||||
|
||||
for (i, peer) in net.lock().peers().iter().enumerate() {
|
||||
let full_client = peer.client().as_full().expect("only full clients are used in test");
|
||||
assert_eq!(full_client.info().unwrap().chain.best_number, 1,
|
||||
assert_eq!(full_client.info().chain.best_number, 1,
|
||||
"Peer #{} failed to sync", i);
|
||||
|
||||
let set: AuthoritySet<Hash, BlockNumber> = crate::aux_schema::load_authorities(
|
||||
@@ -895,7 +895,7 @@ fn sync_justifications_on_change_blocks() {
|
||||
net.sync();
|
||||
|
||||
for i in 0..4 {
|
||||
assert_eq!(net.peer(i).client().info().unwrap().chain.best_number, 25,
|
||||
assert_eq!(net.peer(i).client().info().chain.best_number, 25,
|
||||
"Peer #{} failed to sync", i);
|
||||
}
|
||||
|
||||
@@ -966,7 +966,7 @@ fn finalizes_multiple_pending_changes_in_order() {
|
||||
|
||||
// all peers imported both change blocks
|
||||
for i in 0..6 {
|
||||
assert_eq!(net.peer(i).client().info().unwrap().chain.best_number, 30,
|
||||
assert_eq!(net.peer(i).client().info().chain.best_number, 30,
|
||||
"Peer #{} failed to sync", i);
|
||||
}
|
||||
|
||||
@@ -986,7 +986,7 @@ fn doesnt_vote_on_the_tip_of_the_chain() {
|
||||
net.sync();
|
||||
|
||||
for i in 0..3 {
|
||||
assert_eq!(net.peer(i).client().info().unwrap().chain.best_number, 100,
|
||||
assert_eq!(net.peer(i).client().info().chain.best_number, 100,
|
||||
"Peer #{} failed to sync", i);
|
||||
}
|
||||
|
||||
@@ -1016,7 +1016,7 @@ fn force_change_to_new_set() {
|
||||
|
||||
{
|
||||
// add a forced transition at block 12.
|
||||
let parent_hash = net.lock().peer(0).client().info().unwrap().chain.best_hash;
|
||||
let parent_hash = net.lock().peer(0).client().info().chain.best_hash;
|
||||
forced_transitions.lock().insert(parent_hash, (0, ScheduledChange {
|
||||
next_authorities: voters.clone(),
|
||||
delay: 10,
|
||||
@@ -1033,7 +1033,7 @@ fn force_change_to_new_set() {
|
||||
net.lock().sync();
|
||||
|
||||
for (i, peer) in net.lock().peers().iter().enumerate() {
|
||||
assert_eq!(peer.client().info().unwrap().chain.best_number, 26,
|
||||
assert_eq!(peer.client().info().chain.best_number, 26,
|
||||
"Peer #{} failed to sync", i);
|
||||
|
||||
let full_client = peer.client().as_full().expect("only full clients are used in test");
|
||||
@@ -1172,7 +1172,7 @@ fn voter_persists_its_votes() {
|
||||
net.peer(0).push_blocks(20, false);
|
||||
net.sync();
|
||||
|
||||
assert_eq!(net.peer(0).client().info().unwrap().chain.best_number, 20,
|
||||
assert_eq!(net.peer(0).client().info().chain.best_number, 20,
|
||||
"Peer #{} failed to sync", 0);
|
||||
|
||||
let mut runtime = current_thread::Runtime::new().unwrap();
|
||||
@@ -1289,7 +1289,7 @@ fn voter_persists_its_votes() {
|
||||
net.lock().peer(0).push_blocks(20, false);
|
||||
net.lock().sync();
|
||||
|
||||
assert_eq!(net.lock().peer(0).client().info().unwrap().chain.best_number, 40,
|
||||
assert_eq!(net.lock().peer(0).client().info().chain.best_number, 40,
|
||||
"Peer #{} failed to sync", 0);
|
||||
|
||||
#[allow(deprecated)]
|
||||
@@ -1366,7 +1366,7 @@ fn finalize_3_voters_1_light_observer() {
|
||||
net.sync();
|
||||
|
||||
for i in 0..4 {
|
||||
assert_eq!(net.peer(i).client().info().unwrap().chain.best_number, 20,
|
||||
assert_eq!(net.peer(i).client().info().chain.best_number, 20,
|
||||
"Peer #{} failed to sync", i);
|
||||
}
|
||||
|
||||
@@ -1412,7 +1412,7 @@ fn finality_proof_is_fetched_by_light_client_when_consensus_data_changes() {
|
||||
net.lock().sync_without_disconnects();
|
||||
|
||||
// check that the block#1 is finalized on light client
|
||||
while net.lock().peer(1).client().info().unwrap().chain.finalized_number != 1 {
|
||||
while net.lock().peer(1).client().info().chain.finalized_number != 1 {
|
||||
net.lock().tick_peer(1);
|
||||
net.lock().sync_without_disconnects();
|
||||
}
|
||||
@@ -1455,7 +1455,7 @@ fn empty_finality_proof_is_returned_to_light_client_when_authority_set_is_differ
|
||||
|
||||
// add a forced transition at block 5.
|
||||
if FORCE_CHANGE {
|
||||
let parent_hash = net.lock().peer(0).client().info().unwrap().chain.best_hash;
|
||||
let parent_hash = net.lock().peer(0).client().info().chain.best_hash;
|
||||
forced_transitions.lock().insert(parent_hash, (0, ScheduledChange {
|
||||
next_authorities: voters.clone(),
|
||||
delay: 3,
|
||||
@@ -1482,7 +1482,7 @@ fn empty_finality_proof_is_returned_to_light_client_when_authority_set_is_differ
|
||||
|
||||
// check block, finalized on light client
|
||||
assert_eq!(
|
||||
runner_net.lock().peer(3).client().info().unwrap().chain.finalized_number,
|
||||
runner_net.lock().peer(3).client().info().chain.finalized_number,
|
||||
if FORCE_CHANGE { 0 } else { 10 },
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user