Tweaks from template downstream review #80 (#705)

* tweaks from template downstream review #80

* more tweaks

* Update parachain-template/node/src/command.rs

* tweaks to template and other chainspecs

* fmt

* update more tweaks from downstream

* fix build
This commit is contained in:
Dan Shields
2021-11-11 12:20:39 -07:00
committed by GitHub
parent 7100363a35
commit 496fab27b5
25 changed files with 107 additions and 132 deletions
+1 -1
View File
@@ -255,7 +255,7 @@ impl ExtBuilder {
(6, 60 * self.balance_factor),
]
} else {
vec![]
Vec::new()
},
}
.assimilate_storage(&mut t)
@@ -88,7 +88,7 @@ fn register_validators<T: Config + session::Config>(count: u32) {
let validators = (0..count).map(|c| validator::<T>(c)).collect::<Vec<_>>();
for (who, keys) in validators {
<session::Pallet<T>>::set_keys(RawOrigin::Signed(who).into(), keys, vec![]).unwrap();
<session::Module<T>>::set_keys(RawOrigin::Signed(who).into(), keys, Vec::new()).unwrap();
}
}
@@ -160,7 +160,7 @@ benchmarks! {
<session::Pallet<T>>::set_keys(
RawOrigin::Signed(caller.clone()).into(),
keys::<T>(c + 1),
vec![]
Vec::new()
).unwrap();
}: _(RawOrigin::Signed(caller.clone()))
+1 -1
View File
@@ -145,7 +145,7 @@ impl From<UintAuthorityId> for MockSessionKeys {
}
parameter_types! {
pub static SessionHandlerCollators: Vec<u64> = vec![];
pub static SessionHandlerCollators: Vec<u64> = Vec::new();
pub static SessionChangeBlock: u64 = 0;
}
+1 -1
View File
@@ -188,7 +188,7 @@ fn register_as_candidate_works() {
// given
assert_eq!(CollatorSelection::desired_candidates(), 2);
assert_eq!(CollatorSelection::candidacy_bond(), 10);
assert_eq!(CollatorSelection::candidates(), vec![]);
assert_eq!(CollatorSelection::candidates(), Vec::new());
assert_eq!(CollatorSelection::invulnerables(), vec![1, 2]);
// take two endowed, non-invulnerables accounts.
+2 -2
View File
@@ -475,7 +475,7 @@ mod tests {
Xcm(vec![Transact {
origin_type: OriginKind::Native,
require_weight_at_most: weight,
call: vec![].into(),
call: Vec::new().into(),
}])
}
@@ -506,7 +506,7 @@ mod tests {
new_test_ext().execute_with(|| {
let weight_used = handle_messages(&[], 1000);
assert_eq!(weight_used, 0);
assert_eq!(take_trace(), vec![]);
assert_eq!(take_trace(), Vec::new());
assert!(queue_is_empty());
});
}
+2 -2
View File
@@ -609,7 +609,7 @@ pub mod pallet {
if let Ok(hash) = Self::validate_authorized_upgrade(code) {
return Ok(ValidTransaction {
priority: 100,
requires: vec![],
requires: Vec::new(),
provides: vec![hash.as_ref().to_vec()],
longevity: TransactionLongevity::max_value(),
propagate: true,
@@ -1008,7 +1008,7 @@ pub trait CheckInherents<Block: BlockT> {
) -> frame_support::inherent::CheckInherentsResult;
}
/// Implements [`BlockNumberProvider`] that returns relaychain block number fetched from
/// Implements [`BlockNumberProvider`] that returns relay chain block number fetched from
/// validation data.
/// NTOE: When validation data is not available (e.g. within on_initialize), 0 will be returned.
pub struct RelaychainBlockNumberProvider<T>(sp_std::marker::PhantomData<T>);
@@ -92,7 +92,7 @@ fn validate_block_no_extra_extrinsics() {
let (client, parent_head) = create_test_client();
let TestBlockData { block, validation_data } =
build_block_with_witness(&client, vec![], parent_head.clone(), Default::default());
build_block_with_witness(&client, Vec::new(), parent_head.clone(), Default::default());
let header = block.header().clone();
let res_header =
@@ -133,7 +133,7 @@ fn validate_block_invalid_parent_hash() {
if env::var("RUN_TEST").is_ok() {
let (client, parent_head) = create_test_client();
let TestBlockData { block, validation_data } =
build_block_with_witness(&client, vec![], parent_head.clone(), Default::default());
build_block_with_witness(&client, Vec::new(), parent_head.clone(), Default::default());
let (mut header, extrinsics, witness) = block.deconstruct();
header.set_parent_hash(Hash::from_low_u64_be(1));
@@ -159,7 +159,7 @@ fn validate_block_fails_on_invalid_validation_data() {
if env::var("RUN_TEST").is_ok() {
let (client, parent_head) = create_test_client();
let TestBlockData { block, .. } =
build_block_with_witness(&client, vec![], parent_head.clone(), Default::default());
build_block_with_witness(&client, Vec::new(), parent_head.clone(), Default::default());
call_validate_block(parent_head, block, Hash::random()).unwrap_err();
} else {
@@ -184,7 +184,7 @@ fn check_inherent_fails_on_validate_block_as_expected() {
let TestBlockData { block, validation_data } = build_block_with_witness(
&client,
vec![],
Vec::new(),
parent_head.clone(),
RelayStateSproofBuilder { current_slot: 1337.into(), ..Default::default() },
);