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
+5 -5
View File
@@ -1221,14 +1221,14 @@ mod tests {
VoteImportError::ValidatorIndexOutOfBounds,
);
assert_err!(importer.import(ValidatorIndex(0), true), VoteImportError::DuplicateStatement,);
assert_err!(importer.import(ValidatorIndex(0), true), VoteImportError::DuplicateStatement);
assert_ok!(importer.import(ValidatorIndex(0), false));
assert_ok!(importer.import(ValidatorIndex(2), true));
assert_err!(importer.import(ValidatorIndex(2), true), VoteImportError::DuplicateStatement,);
assert_err!(importer.import(ValidatorIndex(2), true), VoteImportError::DuplicateStatement);
assert_ok!(importer.import(ValidatorIndex(2), false));
assert_err!(importer.import(ValidatorIndex(2), false), VoteImportError::DuplicateStatement,);
assert_err!(importer.import(ValidatorIndex(2), false), VoteImportError::DuplicateStatement);
let summary = importer.finish();
assert_eq!(summary.new_flags, DisputeStateFlags::default());
@@ -1241,7 +1241,7 @@ mod tests {
concluded_at: None,
},
);
assert_eq!(summary.spam_slot_changes, vec![(ValidatorIndex(2), SpamSlotChange::Inc)],);
assert_eq!(summary.spam_slot_changes, vec![(ValidatorIndex(2), SpamSlotChange::Inc)]);
assert!(summary.slash_for.is_empty());
assert!(summary.slash_against.is_empty());
assert_eq!(summary.new_participants, bitvec![BitOrderLsb0, u8; 0, 0, 1, 0, 0, 0, 0, 0]);
@@ -1898,7 +1898,7 @@ mod tests {
)],
}];
assert_ok!(Pallet::<Test>::provide_multi_dispute_data(stmts), vec![],);
assert_ok!(Pallet::<Test>::provide_multi_dispute_data(stmts), vec![]);
assert_eq!(SpamSlots::<Test>::get(3), Some(vec![0, 0, 0, 0]));
assert_eq!(SpamSlots::<Test>::get(4), Some(vec![0, 0, 0, 1]));
assert_eq!(SpamSlots::<Test>::get(5), Some(vec![0, 0, 0, 0]));
+5 -5
View File
@@ -952,12 +952,12 @@ impl<T: Config> Pallet<T> {
);
let config = <configuration::Pallet<T>>::config();
ensure!(proposed_max_capacity > 0, Error::<T>::OpenHrmpChannelZeroCapacity,);
ensure!(proposed_max_capacity > 0, Error::<T>::OpenHrmpChannelZeroCapacity);
ensure!(
proposed_max_capacity <= config.hrmp_channel_max_capacity,
Error::<T>::OpenHrmpChannelCapacityExceedsLimit,
);
ensure!(proposed_max_message_size > 0, Error::<T>::OpenHrmpChannelZeroMessageSize,);
ensure!(proposed_max_message_size > 0, Error::<T>::OpenHrmpChannelZeroMessageSize);
ensure!(
proposed_max_message_size <= config.hrmp_channel_max_message_size,
Error::<T>::OpenHrmpChannelMessageSizeExceedsLimit,
@@ -1035,7 +1035,7 @@ impl<T: Config> Pallet<T> {
let channel_id = HrmpChannelId { sender, recipient: origin };
let mut channel_req = <Self as Store>::HrmpOpenChannelRequests::get(&channel_id)
.ok_or(Error::<T>::AcceptHrmpChannelDoesntExist)?;
ensure!(!channel_req.confirmed, Error::<T>::AcceptHrmpChannelAlreadyConfirmed,);
ensure!(!channel_req.confirmed, Error::<T>::AcceptHrmpChannelAlreadyConfirmed);
// check if by accepting this open channel request, this parachain would exceed the
// number of inbound channels.
@@ -1748,7 +1748,7 @@ mod tests {
.expect("the ingress index must be present for para_b");
let ingress_index = <Vec<ParaId>>::decode(&mut &raw_ingress_index[..])
.expect("ingress indexx should be decodable as a list of para ids");
assert_eq!(ingress_index, vec![para_a],);
assert_eq!(ingress_index, vec![para_a]);
// Now, verify that we can access and decode the egress index.
let raw_egress_index =
@@ -1756,7 +1756,7 @@ mod tests {
.expect("the egress index must be present for para_a");
let egress_index = <Vec<ParaId>>::decode(&mut &raw_egress_index[..])
.expect("egress index should be decodable as a list of para ids");
assert_eq!(egress_index, vec![para_b],);
assert_eq!(egress_index, vec![para_b]);
});
}
+3 -3
View File
@@ -581,7 +581,7 @@ impl<T: Config> Pallet<T> {
// end of loop reached means that the candidate didn't appear in the non-traversed
// section of the `scheduled` slice. either it was not scheduled or didn't appear in
// `candidates` in the correct order.
ensure!(false, Error::<T>::UnscheduledCandidate,);
ensure!(false, Error::<T>::UnscheduledCandidate);
}
// check remainder of scheduled cores, if any.
@@ -917,7 +917,7 @@ impl<T: Config> CandidateCheckContext<T> {
self.relay_parent_number.saturating_sub(last) >=
self.config.validation_upgrade_frequency
});
ensure!(valid_upgrade_attempt, AcceptanceCheckErr::PrematureCodeUpgrade,);
ensure!(valid_upgrade_attempt, AcceptanceCheckErr::PrematureCodeUpgrade);
ensure!(
new_validation_code.0.len() <= self.config.max_code_size as _,
AcceptanceCheckErr::NewCodeTooLarge,
@@ -1673,7 +1673,7 @@ mod tests {
*votes.get_mut(2).unwrap() = true;
votes
},);
});
// and check that chain head was enacted.
assert_eq!(Paras::para_head(&chain_a), Some(vec![1, 2, 3, 4].into()));
+3 -3
View File
@@ -1538,7 +1538,7 @@ mod tests {
{
Paras::note_new_head(para_id, Default::default(), expected_at);
assert_eq!(Paras::past_code_meta(&para_id).most_recent_change(), Some(expected_at),);
assert_eq!(Paras::past_code_meta(&para_id).most_recent_change(), Some(expected_at));
assert_eq!(
<Paras as Store>::PastCodeHash::get(&(para_id, expected_at)),
Some(original_code.hash()),
@@ -1629,7 +1629,7 @@ mod tests {
Paras::note_new_head(para_id, Default::default(), expected_at + 4);
assert_eq!(Paras::past_code_meta(&para_id).most_recent_change(), Some(expected_at),);
assert_eq!(Paras::past_code_meta(&para_id).most_recent_change(), Some(expected_at));
// Some hypothetical block which would have triggered the code change
// should still use the old code.
@@ -2000,7 +2000,7 @@ mod tests {
run_to_block(10, None);
Paras::note_new_head(para_id, Default::default(), 7);
assert_eq!(Paras::past_code_meta(&para_id).upgrade_times, vec![upgrade_at(2, 10)],);
assert_eq!(Paras::past_code_meta(&para_id).upgrade_times, vec![upgrade_at(2, 10)]);
assert_eq!(fetch_validation_code_at(para_id, 2, None), Some(old_code.clone()));
assert_eq!(fetch_validation_code_at(para_id, 3, None), Some(old_code.clone()));
@@ -104,7 +104,7 @@ pub mod pallet {
Ok(Some(d)) => d,
Ok(None) => return None,
Err(_) => {
log::warn!(target: LOG_TARGET, "ParachainsInherentData failed to decode",);
log::warn!(target: LOG_TARGET, "ParachainsInherentData failed to decode");
return None
},
@@ -489,7 +489,7 @@ mod tests {
// we don't directly check the block's weight post-call. Instead, we check that the
// call has returned the appropriate post-dispatch weight for refund, and trust
// Substrate to do the right thing with that information.
assert_eq!(post_info.actual_weight.unwrap(), expected_weight,);
assert_eq!(post_info.actual_weight.unwrap(), expected_weight);
});
}
}
+2 -2
View File
@@ -181,7 +181,7 @@ mod tests {
])
);
assert_eq!(ParasShared::active_validator_keys(), validators,);
assert_eq!(ParasShared::active_validator_keys(), validators);
assert_eq!(
ParasShared::active_validator_indices(),
@@ -219,7 +219,7 @@ mod tests {
validator_pubkeys(&[Sr25519Keyring::Ferdie, Sr25519Keyring::Bob,])
);
assert_eq!(ParasShared::active_validator_keys(), validators,);
assert_eq!(ParasShared::active_validator_keys(), validators);
assert_eq!(
ParasShared::active_validator_indices(),