Mass replace ,); pattern (#3580)

This is an artifact left by rustfmt which is not dare to remove the
comma being conservative.
This commit is contained in:
Sergei Shulepov
2021-08-05 19:53:17 +02:00
committed by GitHub
parent 00d6fc5af0
commit 68c03f66f3
46 changed files with 136 additions and 136 deletions
@@ -470,7 +470,7 @@ mod tests {
assert_ok!(Exchange::import_peer_transaction(
Origin::signed(SUBMITTER),
(true, transaction),
),);
));
// ensure that the transfer has been marked as completed
assert!(<Exchange as crate::Store>::Transfers::contains_key(0u64));
@@ -485,7 +485,7 @@ mod tests {
assert_ok!(Exchange::import_peer_transaction(
Origin::signed(SUBMITTER),
(true, transaction(0)),
),);
));
// ensure that the transfer has been marked as completed
assert!(<Exchange as crate::Store>::Transfers::contains_key(0u64));
@@ -336,7 +336,7 @@ mod tests {
Some(vec![validators_change_receipt(latest_block_id.hash)]),
)
.unwrap();
assert_eq!(finalized_blocks, vec![(parent_id, Some(100))],);
assert_eq!(finalized_blocks, vec![(parent_id, Some(100))]);
assert!(storage.header(&ctx.genesis.compute_hash()).is_none());
latest_block_id = rolling_last_block_id;
@@ -362,7 +362,7 @@ mod tests {
None,
)
.unwrap();
assert_eq!(finalized_blocks, vec![],);
assert_eq!(finalized_blocks, vec![]);
latest_block_id = rolling_last_block_id;
step += 3;
}
+1 -1
View File
@@ -1415,7 +1415,7 @@ pub(crate) mod tests {
example_header().compute_hash(),
1,
&[],
),);
));
});
}
@@ -359,7 +359,7 @@ pub(crate) mod tests {
// when we're inside list range
header.number = 150;
assert_eq!(validators.extract_validators_change(&header, None), Ok((None, None)),);
assert_eq!(validators.extract_validators_change(&header, None), Ok((None, None)));
// when we're at the block that switches to contract source
header.number = 200;
@@ -459,7 +459,7 @@ pub(crate) mod tests {
#[test]
fn finalize_validators_change_does_not_finalize_when_changes_are_not_scheduled() {
assert_eq!(try_finalize_with_scheduled_change(None), None,);
assert_eq!(try_finalize_with_scheduled_change(None), None);
}
#[test]
@@ -468,6 +468,6 @@ pub(crate) mod tests {
number: 5,
..Default::default()
};
assert_eq!(try_finalize_with_scheduled_change(Some(id5)), None,);
assert_eq!(try_finalize_with_scheduled_change(Some(id5)), None);
}
}
+1 -1
View File
@@ -777,7 +777,7 @@ mod tests {
run_test(|| {
<IsHalted<TestRuntime>>::put(true);
assert_noop!(submit_finality_proof(1), Error::<TestRuntime>::Halted,);
assert_noop!(submit_finality_proof(1), Error::<TestRuntime>::Halted);
})
}
+4 -4
View File
@@ -1301,7 +1301,7 @@ mod tests {
Ok(vec![message(1, REGULAR_PAYLOAD)]).into(),
1,
REGULAR_PAYLOAD.declared_weight,
),);
));
assert_ok!(Pallet::<TestRuntime>::receive_messages_delivery_proof(
Origin::signed(1),
@@ -1660,7 +1660,7 @@ mod tests {
Ok(vec![invalid_message]).into(),
1,
0, // weight may be zero in this case (all messages are improperly encoded)
),);
));
assert_eq!(
InboundLanes::<TestRuntime>::get(&TEST_LANE_ID).last_delivered_nonce(),
@@ -1686,7 +1686,7 @@ mod tests {
.into(),
3,
REGULAR_PAYLOAD.declared_weight + REGULAR_PAYLOAD.declared_weight,
),);
));
assert_eq!(
InboundLanes::<TestRuntime>::get(&TEST_LANE_ID).last_delivered_nonce(),
@@ -1802,7 +1802,7 @@ mod tests {
TEST_LANE_ID,
1,
100,
),);
));
assert!(TestMessageDeliveryAndDispatchPayment::is_fee_paid(1, 100));
});
}
@@ -210,19 +210,19 @@ mod tests {
let all_accs = vec![1, 2, 3, 4, 5];
// at least 1 validator is selected
assert_eq!(Pallet::<TestRuntime>::select_validators(0, &[1]), vec![1],);
assert_eq!(Pallet::<TestRuntime>::select_validators(0, &[1]), vec![1]);
// at session#0, shift is also 0
assert_eq!(Pallet::<TestRuntime>::select_validators(0, &all_accs), vec![1, 2, 3],);
assert_eq!(Pallet::<TestRuntime>::select_validators(0, &all_accs), vec![1, 2, 3]);
// at session#1, shift is also 1
assert_eq!(Pallet::<TestRuntime>::select_validators(1, &all_accs), vec![2, 3, 4],);
assert_eq!(Pallet::<TestRuntime>::select_validators(1, &all_accs), vec![2, 3, 4]);
// at session#3, we're wrapping
assert_eq!(Pallet::<TestRuntime>::select_validators(3, &all_accs), vec![4, 5, 1],);
assert_eq!(Pallet::<TestRuntime>::select_validators(3, &all_accs), vec![4, 5, 1]);
// at session#5, we're starting from the beginning again
assert_eq!(Pallet::<TestRuntime>::select_validators(5, &all_accs), vec![1, 2, 3],);
assert_eq!(Pallet::<TestRuntime>::select_validators(5, &all_accs), vec![1, 2, 3]);
});
}
}
@@ -729,6 +729,6 @@ mod tests {
stream.append(&2u64);
stream.append(&3u64);
assert_eq!(Receipt::is_successful_raw_receipt(&stream.out()), Ok(false),);
assert_eq!(Receipt::is_successful_raw_receipt(&stream.out()), Ok(false));
}
}
@@ -431,7 +431,7 @@ async fn submit_substrate_headers_batch(
mut ids: Vec<RialtoHeaderId>,
mut headers: HeadersBatch,
) -> Option<RpcError> {
debug_assert_eq!(ids.len(), headers.len(),);
debug_assert_eq!(ids.len(), headers.len());
// if parent of first header is either incomplete, or rejected, we assume that contract
// will reject this header as well
@@ -680,7 +680,7 @@ pub(crate) mod tests {
&target,
test_transaction_hash(0),
))
.is_err(),);
.is_err());
assert!(target.data.lock().submitted_proofs.is_empty());
}
@@ -861,7 +861,7 @@ pub(crate) mod tests {
failed: 1,
}),
);
assert_eq!(target.data.lock().submitted_proofs, vec![],);
assert_eq!(target.data.lock().submitted_proofs, vec![]);
}
#[test]
@@ -456,25 +456,25 @@ fn prune_recent_finality_proofs_works() {
// when there's proof for justified header in the vec
let mut recent_finality_proofs = original_recent_finality_proofs.clone();
prune_recent_finality_proofs::<TestFinalitySyncPipeline>(10, &mut recent_finality_proofs, 1024);
assert_eq!(&original_recent_finality_proofs[1..], recent_finality_proofs,);
assert_eq!(&original_recent_finality_proofs[1..], recent_finality_proofs);
// when there are no proof for justified header in the vec
let mut recent_finality_proofs = original_recent_finality_proofs.clone();
prune_recent_finality_proofs::<TestFinalitySyncPipeline>(11, &mut recent_finality_proofs, 1024);
assert_eq!(&original_recent_finality_proofs[1..], recent_finality_proofs,);
assert_eq!(&original_recent_finality_proofs[1..], recent_finality_proofs);
// when there are too many entries after initial prune && they also need to be pruned
let mut recent_finality_proofs = original_recent_finality_proofs.clone();
prune_recent_finality_proofs::<TestFinalitySyncPipeline>(10, &mut recent_finality_proofs, 2);
assert_eq!(&original_recent_finality_proofs[3..], recent_finality_proofs,);
assert_eq!(&original_recent_finality_proofs[3..], recent_finality_proofs);
// when last entry is pruned
let mut recent_finality_proofs = original_recent_finality_proofs.clone();
prune_recent_finality_proofs::<TestFinalitySyncPipeline>(19, &mut recent_finality_proofs, 2);
assert_eq!(&original_recent_finality_proofs[5..], recent_finality_proofs,);
assert_eq!(&original_recent_finality_proofs[5..], recent_finality_proofs);
// when post-last entry is pruned
let mut recent_finality_proofs = original_recent_finality_proofs.clone();
prune_recent_finality_proofs::<TestFinalitySyncPipeline>(20, &mut recent_finality_proofs, 2);
assert_eq!(&original_recent_finality_proofs[5..], recent_finality_proofs,);
assert_eq!(&original_recent_finality_proofs[5..], recent_finality_proofs);
}
@@ -374,7 +374,7 @@ fn source_reject_extra(method: &SourceMethod) {
fn target_accept_all_headers(method: &TargetMethod, data: &mut TargetData, requires_extra: bool) {
if let TargetMethod::SubmitHeaders(ref submitted) = method {
assert_eq!(submitted.iter().all(|header| header.extra().is_some()), requires_extra,);
assert_eq!(submitted.iter().all(|header| header.extra().is_some()), requires_extra);
data.submit_headers_result = Some(SubmittedHeaders {
submitted: submitted.iter().map(|header| header.id()).collect(),
@@ -872,7 +872,7 @@ pub(crate) mod tests {
exit_receiver.into_future().map(|(_, _)| ()),
);
assert_eq!(result.submitted_messages_proofs, vec![(1..=1, None)],);
assert_eq!(result.submitted_messages_proofs, vec![(1..=1, None)]);
}
#[test]
@@ -483,12 +483,12 @@ mod tests {
);
strategy.remove_le_nonces_from_source_queue(5);
assert_eq!(source_queue_nonces(&strategy.source_queue), vec![6, 7, 8, 9],);
assert_eq!(source_queue_nonces(&strategy.source_queue), vec![6, 7, 8, 9]);
strategy.remove_le_nonces_from_source_queue(9);
assert_eq!(source_queue_nonces(&strategy.source_queue), Vec::<MessageNonce>::new(),);
assert_eq!(source_queue_nonces(&strategy.source_queue), Vec::<MessageNonce>::new());
strategy.remove_le_nonces_from_source_queue(100);
assert_eq!(source_queue_nonces(&strategy.source_queue), Vec::<MessageNonce>::new(),);
assert_eq!(source_queue_nonces(&strategy.source_queue), Vec::<MessageNonce>::new());
}
}