Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit c57cb15

Browse files
Merge branch 'master' of github.com:paritytech/substrate into fix
2 parents cf20d13 + 911f65b commit c57cb15

File tree

42 files changed

+28
-202
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+28
-202
lines changed

client/db/src/lib.rs

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,14 +1291,13 @@ impl<Block: BlockT> Backend<Block> {
12911291
header: &Block::Header,
12921292
last_finalized: Option<Block::Hash>,
12931293
justification: Option<Justification>,
1294-
finalization_displaced: &mut Option<FinalizationOutcome<Block::Hash, NumberFor<Block>>>,
12951294
) -> ClientResult<MetaUpdate<Block>> {
12961295
// TODO: ensure best chain contains this block.
12971296
let number = *header.number();
12981297
self.ensure_sequential_finalization(header, last_finalized)?;
12991298
let with_state = sc_client_api::Backend::have_state_at(self, hash, number);
13001299

1301-
self.note_finalized(transaction, header, hash, finalization_displaced, with_state)?;
1300+
self.note_finalized(transaction, header, hash, with_state)?;
13021301

13031302
if let Some(justification) = justification {
13041303
transaction.set_from_vec(
@@ -1362,7 +1361,6 @@ impl<Block: BlockT> Backend<Block> {
13621361

13631362
fn try_commit_operation(&self, mut operation: BlockImportOperation<Block>) -> ClientResult<()> {
13641363
let mut transaction = Transaction::new();
1365-
let mut finalization_displaced_leaves = None;
13661364

13671365
operation.apply_aux(&mut transaction);
13681366
operation.apply_offchain(&mut transaction);
@@ -1381,7 +1379,6 @@ impl<Block: BlockT> Backend<Block> {
13811379
&block_header,
13821380
Some(last_finalized_hash),
13831381
justification,
1384-
&mut finalization_displaced_leaves,
13851382
)?);
13861383
last_finalized_hash = block_hash;
13871384
last_finalized_num = *block_header.number();
@@ -1554,13 +1551,7 @@ impl<Block: BlockT> Backend<Block> {
15541551
if finalized {
15551552
// TODO: ensure best chain contains this block.
15561553
self.ensure_sequential_finalization(header, Some(last_finalized_hash))?;
1557-
self.note_finalized(
1558-
&mut transaction,
1559-
header,
1560-
hash,
1561-
&mut finalization_displaced_leaves,
1562-
operation.commit_state,
1563-
)?;
1554+
self.note_finalized(&mut transaction, header, hash, operation.commit_state)?;
15641555
} else {
15651556
// canonicalize blocks which are old enough, regardless of finality.
15661557
self.force_delayed_canonicalize(&mut transaction)?
@@ -1692,7 +1683,6 @@ impl<Block: BlockT> Backend<Block> {
16921683
transaction: &mut Transaction<DbHash>,
16931684
f_header: &Block::Header,
16941685
f_hash: Block::Hash,
1695-
displaced: &mut Option<FinalizationOutcome<Block::Hash, NumberFor<Block>>>,
16961686
with_state: bool,
16971687
) -> ClientResult<()> {
16981688
let f_num = *f_header.number();
@@ -1720,10 +1710,6 @@ impl<Block: BlockT> Backend<Block> {
17201710

17211711
let new_displaced = self.blockchain.leaves.write().finalize_height(f_num);
17221712
self.prune_blocks(transaction, f_num, &new_displaced)?;
1723-
match displaced {
1724-
x @ &mut None => *x = Some(new_displaced),
1725-
&mut Some(ref mut displaced) => displaced.merge(new_displaced),
1726-
}
17271713

17281714
Ok(())
17291715
}
@@ -2013,16 +1999,15 @@ impl<Block: BlockT> sc_client_api::backend::Backend<Block> for Backend<Block> {
20131999
) -> ClientResult<()> {
20142000
let mut transaction = Transaction::new();
20152001
let header = self.blockchain.expect_header(hash)?;
2016-
let mut displaced = None;
20172002

20182003
let m = self.finalize_block_with_transaction(
20192004
&mut transaction,
20202005
hash,
20212006
&header,
20222007
None,
20232008
justification,
2024-
&mut displaced,
20252009
)?;
2010+
20262011
self.storage.db.commit(transaction)?;
20272012
self.blockchain.update_meta(m);
20282013
Ok(())

frame/atomic-swap/src/tests.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
use super::*;
44
use crate as pallet_atomic_swap;
55

6-
use frame_support::{
7-
parameter_types,
8-
traits::{ConstU32, ConstU64},
9-
};
6+
use frame_support::traits::{ConstU32, ConstU64};
107
use sp_core::H256;
118
use sp_runtime::{
129
testing::Header,
@@ -28,10 +25,6 @@ frame_support::construct_runtime!(
2825
}
2926
);
3027

31-
parameter_types! {
32-
pub BlockWeights: frame_system::limits::BlockWeights =
33-
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
34-
}
3528
impl frame_system::Config for Test {
3629
type BaseCallFilter = frame_support::traits::Everything;
3730
type BlockWeights = ();

frame/aura/src/mock.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ frame_support::construct_runtime!(
4646
}
4747
);
4848

49-
parameter_types! {
50-
pub BlockWeights: frame_system::limits::BlockWeights =
51-
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
52-
}
53-
5449
impl frame_system::Config for Test {
5550
type BaseCallFilter = frame_support::traits::Everything;
5651
type BlockWeights = ();

frame/authority-discovery/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,6 @@ mod tests {
226226
parameter_types! {
227227
pub const Period: BlockNumber = 1;
228228
pub const Offset: BlockNumber = 0;
229-
pub BlockWeights: frame_system::limits::BlockWeights =
230-
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
231229
}
232230

233231
impl frame_system::Config for Test {

frame/authorship/src/lib.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,6 @@ mod tests {
434434
use super::*;
435435
use crate as pallet_authorship;
436436
use frame_support::{
437-
parameter_types,
438437
traits::{ConstU32, ConstU64, OnFinalize, OnInitialize},
439438
ConsensusEngineId,
440439
};
@@ -459,11 +458,6 @@ mod tests {
459458
}
460459
);
461460

462-
parameter_types! {
463-
pub BlockWeights: frame_system::limits::BlockWeights =
464-
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
465-
}
466-
467461
impl frame_system::Config for Test {
468462
type BaseCallFilter = frame_support::traits::Everything;
469463
type BlockWeights = ();

frame/babe/src/mock.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,6 @@ frame_support::construct_runtime!(
6464
}
6565
);
6666

67-
parameter_types! {
68-
pub BlockWeights: frame_system::limits::BlockWeights =
69-
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
70-
}
71-
7267
impl frame_system::Config for Test {
7368
type BaseCallFilter = frame_support::traits::Everything;
7469
type BlockWeights = ();

frame/collective/src/tests.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ pub type MaxMembers = ConstU32<100>;
9191
parameter_types! {
9292
pub const MotionDuration: u64 = 3;
9393
pub const MaxProposals: u32 = 257;
94-
pub BlockWeights: frame_system::limits::BlockWeights =
95-
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
9694
}
9795
impl frame_system::Config for Test {
9896
type BaseCallFilter = frame_support::traits::Everything;

frame/conviction-voting/src/tests.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use std::collections::BTreeMap;
2222
use frame_support::{
2323
assert_noop, assert_ok, parameter_types,
2424
traits::{ConstU32, ConstU64, Contains, Polling, VoteTally},
25-
weights::Weight,
2625
};
2726
use sp_core::H256;
2827
use sp_runtime::{
@@ -56,10 +55,6 @@ impl Contains<RuntimeCall> for BaseFilter {
5655
}
5756
}
5857

59-
parameter_types! {
60-
pub BlockWeights: frame_system::limits::BlockWeights =
61-
frame_system::limits::BlockWeights::simple_max(Weight::from_ref_time(1_000_000));
62-
}
6358
impl frame_system::Config for Test {
6459
type BaseCallFilter = BaseFilter;
6560
type BlockWeights = ();

frame/examples/basic/src/tests.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ use crate::*;
2121
use frame_support::{
2222
assert_ok,
2323
dispatch::{DispatchInfo, GetDispatchInfo},
24-
parameter_types,
2524
traits::{ConstU64, OnInitialize},
2625
};
2726
use sp_core::H256;
@@ -51,10 +50,6 @@ frame_support::construct_runtime!(
5150
}
5251
);
5352

54-
parameter_types! {
55-
pub BlockWeights: frame_system::limits::BlockWeights =
56-
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
57-
}
5853
impl frame_system::Config for Test {
5954
type BaseCallFilter = frame_support::traits::Everything;
6055
type BlockWeights = ();

frame/examples/offchain-worker/src/tests.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ frame_support::construct_runtime!(
5151
}
5252
);
5353

54-
parameter_types! {
55-
pub BlockWeights: frame_system::limits::BlockWeights =
56-
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
57-
}
5854
impl frame_system::Config for Test {
5955
type BaseCallFilter = frame_support::traits::Everything;
6056
type BlockWeights = ();

0 commit comments

Comments
 (0)