Skip to content

Commit 266518f

Browse files
authored
Update substrate. (#339)
1 parent a148d88 commit 266518f

File tree

11 files changed

+49
-115
lines changed

11 files changed

+49
-115
lines changed

Cargo.dev.toml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@ members = [
1515
]
1616

1717
[patch.crates-io]
18-
frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", rev = "f884296f7436916909025f8b43c4bbf3e60e4c60" }
19-
frame-support = { git = "https://github.com/paritytech/substrate.git", rev = "f884296f7436916909025f8b43c4bbf3e60e4c60" }
20-
frame-system = { git = "https://github.com/paritytech/substrate.git", rev = "f884296f7436916909025f8b43c4bbf3e60e4c60" }
21-
pallet-balances = { git = "https://github.com/paritytech/substrate.git", rev = "f884296f7436916909025f8b43c4bbf3e60e4c60" }
22-
pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate.git", rev = "f884296f7436916909025f8b43c4bbf3e60e4c60" }
23-
pallet-scheduler = { git = "https://github.com/paritytech/substrate.git", rev = "f884296f7436916909025f8b43c4bbf3e60e4c60" }
24-
pallet-treasury = { git = "https://github.com/paritytech/substrate.git", rev = "f884296f7436916909025f8b43c4bbf3e60e4c60" }
25-
sp-api = { git = "https://github.com/paritytech/substrate.git", rev = "f884296f7436916909025f8b43c4bbf3e60e4c60" }
26-
sp-application-crypto = { git = "https://github.com/paritytech/substrate.git", rev = "f884296f7436916909025f8b43c4bbf3e60e4c60" }
27-
sp-arithmetic = { git = "https://github.com/paritytech/substrate.git", rev = "f884296f7436916909025f8b43c4bbf3e60e4c60" }
28-
sp-core = { git = "https://github.com/paritytech/substrate.git", rev = "f884296f7436916909025f8b43c4bbf3e60e4c60" }
29-
sp-inherents = { git = "https://github.com/paritytech/substrate.git", rev = "f884296f7436916909025f8b43c4bbf3e60e4c60" }
30-
sp-io = { git = "https://github.com/paritytech/substrate.git", rev = "f884296f7436916909025f8b43c4bbf3e60e4c60" }
31-
sp-runtime = { git = "https://github.com/paritytech/substrate.git", rev = "f884296f7436916909025f8b43c4bbf3e60e4c60" }
32-
sp-runtime-interface = { git = "https://github.com/paritytech/substrate.git", rev = "f884296f7436916909025f8b43c4bbf3e60e4c60" }
33-
sp-std = { git = "https://github.com/paritytech/substrate.git", rev = "f884296f7436916909025f8b43c4bbf3e60e4c60" }
34-
sp-trie = { git = "https://github.com/paritytech/substrate.git", rev = "f884296f7436916909025f8b43c4bbf3e60e4c60" }
35-
sp-version = { git = "https://github.com/paritytech/substrate.git", rev = "f884296f7436916909025f8b43c4bbf3e60e4c60" }
18+
frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", rev = "6b600cdeb4043e512bc5f342eb02a5a17d26797a" }
19+
frame-support = { git = "https://github.com/paritytech/substrate.git", rev = "6b600cdeb4043e512bc5f342eb02a5a17d26797a" }
20+
frame-system = { git = "https://github.com/paritytech/substrate.git", rev = "6b600cdeb4043e512bc5f342eb02a5a17d26797a" }
21+
pallet-balances = { git = "https://github.com/paritytech/substrate.git", rev = "6b600cdeb4043e512bc5f342eb02a5a17d26797a" }
22+
pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate.git", rev = "6b600cdeb4043e512bc5f342eb02a5a17d26797a" }
23+
pallet-scheduler = { git = "https://github.com/paritytech/substrate.git", rev = "6b600cdeb4043e512bc5f342eb02a5a17d26797a" }
24+
pallet-treasury = { git = "https://github.com/paritytech/substrate.git", rev = "6b600cdeb4043e512bc5f342eb02a5a17d26797a" }
25+
sp-api = { git = "https://github.com/paritytech/substrate.git", rev = "6b600cdeb4043e512bc5f342eb02a5a17d26797a" }
26+
sp-application-crypto = { git = "https://github.com/paritytech/substrate.git", rev = "6b600cdeb4043e512bc5f342eb02a5a17d26797a" }
27+
sp-arithmetic = { git = "https://github.com/paritytech/substrate.git", rev = "6b600cdeb4043e512bc5f342eb02a5a17d26797a" }
28+
sp-core = { git = "https://github.com/paritytech/substrate.git", rev = "6b600cdeb4043e512bc5f342eb02a5a17d26797a" }
29+
sp-inherents = { git = "https://github.com/paritytech/substrate.git", rev = "6b600cdeb4043e512bc5f342eb02a5a17d26797a" }
30+
sp-io = { git = "https://github.com/paritytech/substrate.git", rev = "6b600cdeb4043e512bc5f342eb02a5a17d26797a" }
31+
sp-runtime = { git = "https://github.com/paritytech/substrate.git", rev = "6b600cdeb4043e512bc5f342eb02a5a17d26797a" }
32+
sp-runtime-interface = { git = "https://github.com/paritytech/substrate.git", rev = "6b600cdeb4043e512bc5f342eb02a5a17d26797a" }
33+
sp-std = { git = "https://github.com/paritytech/substrate.git", rev = "6b600cdeb4043e512bc5f342eb02a5a17d26797a" }
34+
sp-trie = { git = "https://github.com/paritytech/substrate.git", rev = "6b600cdeb4043e512bc5f342eb02a5a17d26797a" }
35+
sp-version = { git = "https://github.com/paritytech/substrate.git", rev = "6b600cdeb4043e512bc5f342eb02a5a17d26797a" }

auction/src/mock.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use super::*;
66
use frame_support::{impl_outer_event, impl_outer_origin, parameter_types};
77
use orml_traits::OnNewBidResult;
88
use sp_core::H256;
9-
use sp_runtime::{testing::Header, traits::IdentityLookup, Perbill};
9+
use sp_runtime::{testing::Header, traits::IdentityLookup};
1010

1111
impl_outer_origin! {
1212
pub enum Origin for Runtime {}
@@ -28,9 +28,6 @@ impl_outer_event! {
2828
pub struct Runtime;
2929
parameter_types! {
3030
pub const BlockHashCount: u64 = 250;
31-
pub const MaximumBlockWeight: u32 = 1024;
32-
pub const MaximumBlockLength: u32 = 2 * 1024;
33-
pub const AvailableBlockRatio: Perbill = Perbill::one();
3431
}
3532

3633
pub type AccountId = u128;
@@ -50,18 +47,14 @@ impl frame_system::Config for Runtime {
5047
type Header = Header;
5148
type Event = TestEvent;
5249
type BlockHashCount = BlockHashCount;
53-
type MaximumBlockWeight = MaximumBlockWeight;
54-
type MaximumBlockLength = MaximumBlockLength;
55-
type AvailableBlockRatio = AvailableBlockRatio;
50+
type BlockWeights = ();
51+
type BlockLength = ();
5652
type Version = ();
5753
type PalletInfo = ();
5854
type AccountData = ();
5955
type OnNewAccount = ();
6056
type OnKilledAccount = ();
6157
type DbWeight = ();
62-
type BlockExecutionWeight = ();
63-
type ExtrinsicBaseWeight = ();
64-
type MaximumExtrinsicWeight = ();
6558
type BaseCallFilter = ();
6659
type SystemWeightInfo = ();
6760
}

authority/src/mock.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ pub type BlockNumber = u64;
2222

2323
parameter_types! {
2424
pub const BlockHashCount: u64 = 250;
25-
pub const MaximumBlockWeight: u32 = 1024;
26-
pub const MaximumBlockLength: u32 = 2 * 1024;
27-
pub const AvailableBlockRatio: Perbill = Perbill::one();
25+
pub BlockWeights: frame_system::limits::BlockWeights =
26+
frame_system::limits::BlockWeights::simple_max(2_000_000_000_000);
2827
}
2928

3029
impl frame_system::Config for Runtime {
@@ -39,24 +38,20 @@ impl frame_system::Config for Runtime {
3938
type Header = Header;
4039
type Event = Event;
4140
type BlockHashCount = BlockHashCount;
42-
type MaximumBlockWeight = MaximumBlockWeight;
43-
type MaximumBlockLength = MaximumBlockLength;
44-
type AvailableBlockRatio = AvailableBlockRatio;
41+
type BlockWeights = ();
42+
type BlockLength = ();
4543
type Version = ();
4644
type PalletInfo = ();
4745
type AccountData = ();
4846
type OnNewAccount = ();
4947
type OnKilledAccount = ();
5048
type DbWeight = ();
51-
type BlockExecutionWeight = ();
52-
type ExtrinsicBaseWeight = ();
53-
type MaximumExtrinsicWeight = ();
5449
type BaseCallFilter = ();
5550
type SystemWeightInfo = ();
5651
}
5752

5853
parameter_types! {
59-
pub MaximumSchedulerWeight: u32 = Perbill::from_percent(80) * MaximumBlockWeight::get();
54+
pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) * BlockWeights::get().max_block;
6055
}
6156
impl pallet_scheduler::Config for Runtime {
6257
type Event = Event;

benchmarking/src/tests.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,14 @@ impl frame_system::Config for Test {
6363
type Header = Header;
6464
type Event = ();
6565
type BlockHashCount = ();
66-
type MaximumBlockWeight = ();
6766
type DbWeight = ();
68-
type BlockExecutionWeight = ();
69-
type ExtrinsicBaseWeight = ();
70-
type MaximumBlockLength = ();
71-
type AvailableBlockRatio = ();
67+
type BlockWeights = ();
68+
type BlockLength = ();
7269
type Version = ();
7370
type PalletInfo = ();
7471
type AccountData = ();
7572
type OnNewAccount = ();
7673
type OnKilledAccount = ();
77-
type MaximumExtrinsicWeight = ();
7874
type BaseCallFilter = ();
7975
type SystemWeightInfo = ();
8076
}

currencies/src/mock.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use sp_core::H256;
99
use sp_runtime::{
1010
testing::Header,
1111
traits::{AccountIdConversion, IdentityLookup},
12-
AccountId32, ModuleId, Perbill,
12+
AccountId32, ModuleId,
1313
};
1414

1515
use super::*;
@@ -36,9 +36,6 @@ impl_outer_origin! {
3636
pub struct Runtime;
3737
parameter_types! {
3838
pub const BlockHashCount: u64 = 250;
39-
pub const MaximumBlockWeight: u32 = 1024;
40-
pub const MaximumBlockLength: u32 = 2 * 1024;
41-
pub const AvailableBlockRatio: Perbill = Perbill::one();
4239
}
4340

4441
pub type AccountId = AccountId32;
@@ -54,18 +51,14 @@ impl frame_system::Config for Runtime {
5451
type Header = Header;
5552
type Event = TestEvent;
5653
type BlockHashCount = BlockHashCount;
57-
type MaximumBlockWeight = MaximumBlockWeight;
58-
type MaximumBlockLength = MaximumBlockLength;
59-
type AvailableBlockRatio = AvailableBlockRatio;
54+
type BlockWeights = ();
55+
type BlockLength = ();
6056
type Version = ();
6157
type PalletInfo = ();
6258
type AccountData = pallet_balances::AccountData<u64>;
6359
type OnNewAccount = ();
6460
type OnKilledAccount = ();
6561
type DbWeight = ();
66-
type BlockExecutionWeight = ();
67-
type ExtrinsicBaseWeight = ();
68-
type MaximumExtrinsicWeight = ();
6962
type BaseCallFilter = ();
7063
type SystemWeightInfo = ();
7164
}

gradually-update/src/mock.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use frame_support::{impl_outer_event, impl_outer_origin, parameter_types};
66
use frame_system as system;
77
use sp_core::H256;
8-
use sp_runtime::{testing::Header, traits::IdentityLookup, Perbill};
8+
use sp_runtime::{testing::Header, traits::IdentityLookup};
99

1010
use super::*;
1111

@@ -29,9 +29,6 @@ impl_outer_event! {
2929
pub struct Runtime;
3030
parameter_types! {
3131
pub const BlockHashCount: u64 = 250;
32-
pub const MaximumBlockWeight: u32 = 1024;
33-
pub const MaximumBlockLength: u32 = 2 * 1024;
34-
pub const AvailableBlockRatio: Perbill = Perbill::one();
3532
}
3633

3734
pub type AccountId = u128;
@@ -49,18 +46,14 @@ impl frame_system::Config for Runtime {
4946
type Header = Header;
5047
type Event = TestEvent;
5148
type BlockHashCount = BlockHashCount;
52-
type MaximumBlockWeight = MaximumBlockWeight;
53-
type MaximumBlockLength = MaximumBlockLength;
54-
type AvailableBlockRatio = AvailableBlockRatio;
49+
type BlockWeights = ();
50+
type BlockLength = ();
5551
type Version = ();
5652
type PalletInfo = ();
5753
type AccountData = ();
5854
type OnNewAccount = ();
5955
type OnKilledAccount = ();
6056
type DbWeight = ();
61-
type BlockExecutionWeight = ();
62-
type ExtrinsicBaseWeight = ();
63-
type MaximumExtrinsicWeight = ();
6457
type BaseCallFilter = ();
6558
type SystemWeightInfo = ();
6659
}

nft/src/mock.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use frame_support::{impl_outer_origin, parameter_types};
66
use sp_core::H256;
7-
use sp_runtime::{testing::Header, traits::IdentityLookup, Perbill};
7+
use sp_runtime::{testing::Header, traits::IdentityLookup};
88

99
use super::*;
1010

@@ -17,9 +17,6 @@ impl_outer_origin! {
1717
pub struct Runtime;
1818
parameter_types! {
1919
pub const BlockHashCount: u64 = 250;
20-
pub const MaximumBlockWeight: u32 = 1024;
21-
pub const MaximumBlockLength: u32 = 2 * 1024;
22-
pub const AvailableBlockRatio: Perbill = Perbill::one();
2320
}
2421

2522
pub type AccountId = u128;
@@ -37,18 +34,14 @@ impl frame_system::Config for Runtime {
3734
type Header = Header;
3835
type Event = ();
3936
type BlockHashCount = BlockHashCount;
40-
type MaximumBlockWeight = MaximumBlockWeight;
41-
type MaximumBlockLength = MaximumBlockLength;
42-
type AvailableBlockRatio = AvailableBlockRatio;
37+
type BlockWeights = ();
38+
type BlockLength = ();
4339
type Version = ();
4440
type PalletInfo = ();
4541
type AccountData = ();
4642
type OnNewAccount = ();
4743
type OnKilledAccount = ();
4844
type DbWeight = ();
49-
type BlockExecutionWeight = ();
50-
type ExtrinsicBaseWeight = ();
51-
type MaximumExtrinsicWeight = ();
5245
type BaseCallFilter = ();
5346
type SystemWeightInfo = ();
5447
}

oracle/src/mock.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22

33
use super::*;
44

5-
use frame_support::{impl_outer_dispatch, impl_outer_event, impl_outer_origin, parameter_types, weights::Weight};
5+
use frame_support::{impl_outer_dispatch, impl_outer_event, impl_outer_origin, parameter_types};
66
use sp_core::H256;
77
use sp_runtime::{
88
testing::Header,
99
traits::{BlakeTwo256, IdentityLookup},
10-
Perbill,
1110
};
1211

1312
use std::cell::RefCell;
@@ -44,9 +43,6 @@ type Value = u32;
4443
pub struct Test;
4544
parameter_types! {
4645
pub const BlockHashCount: u64 = 250;
47-
pub const MaximumBlockWeight: Weight = 1024;
48-
pub const MaximumBlockLength: u32 = 2 * 1024;
49-
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
5046
}
5147
impl frame_system::Config for Test {
5248
type Origin = Origin;
@@ -60,18 +56,14 @@ impl frame_system::Config for Test {
6056
type Header = Header;
6157
type Event = TestEvent;
6258
type BlockHashCount = BlockHashCount;
63-
type MaximumBlockWeight = MaximumBlockWeight;
64-
type MaximumBlockLength = MaximumBlockLength;
65-
type AvailableBlockRatio = AvailableBlockRatio;
59+
type BlockWeights = ();
60+
type BlockLength = ();
6661
type Version = ();
6762
type PalletInfo = ();
6863
type AccountData = ();
6964
type OnNewAccount = ();
7065
type OnKilledAccount = ();
7166
type DbWeight = ();
72-
type BlockExecutionWeight = ();
73-
type ExtrinsicBaseWeight = ();
74-
type MaximumExtrinsicWeight = ();
7567
type BaseCallFilter = ();
7668
type SystemWeightInfo = ();
7769
}

rewards/src/mock.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use super::*;
66
use frame_support::{impl_outer_origin, parameter_types};
77
use sp_core::H256;
8-
use sp_runtime::{testing::Header, traits::IdentityLookup, Perbill};
8+
use sp_runtime::{testing::Header, traits::IdentityLookup};
99
use sp_std::cell::RefCell;
1010
use std::collections::HashMap;
1111

@@ -33,9 +33,6 @@ pub struct Runtime;
3333

3434
parameter_types! {
3535
pub const BlockHashCount: u64 = 250;
36-
pub const MaximumBlockWeight: u32 = 1024;
37-
pub const MaximumBlockLength: u32 = 2 * 1024;
38-
pub const AvailableBlockRatio: Perbill = Perbill::one();
3936
}
4037

4138
impl frame_system::Config for Runtime {
@@ -50,18 +47,14 @@ impl frame_system::Config for Runtime {
5047
type Header = Header;
5148
type Event = ();
5249
type BlockHashCount = BlockHashCount;
53-
type MaximumBlockWeight = MaximumBlockWeight;
54-
type MaximumBlockLength = MaximumBlockLength;
55-
type AvailableBlockRatio = AvailableBlockRatio;
50+
type BlockWeights = ();
51+
type BlockLength = ();
5652
type Version = ();
5753
type PalletInfo = ();
5854
type AccountData = ();
5955
type OnNewAccount = ();
6056
type OnKilledAccount = ();
6157
type DbWeight = ();
62-
type BlockExecutionWeight = ();
63-
type ExtrinsicBaseWeight = ();
64-
type MaximumExtrinsicWeight = ();
6558
type BaseCallFilter = ();
6659
type SystemWeightInfo = ();
6760
}

tokens/src/mock.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use sp_core::H256;
1212
use sp_runtime::{
1313
testing::Header,
1414
traits::{AccountIdConversion, IdentityLookup},
15-
AccountId32, ModuleId, Perbill, Percent, Permill,
15+
AccountId32, ModuleId, Percent, Permill,
1616
};
1717
use sp_std::cell::RefCell;
1818

@@ -53,9 +53,6 @@ impl_outer_event! {
5353
pub struct Runtime;
5454
parameter_types! {
5555
pub const BlockHashCount: u64 = 250;
56-
pub const MaximumBlockWeight: u32 = 1024;
57-
pub const MaximumBlockLength: u32 = 2 * 1024;
58-
pub const AvailableBlockRatio: Perbill = Perbill::one();
5956
}
6057

6158
impl frame_system::Config for Runtime {
@@ -70,18 +67,14 @@ impl frame_system::Config for Runtime {
7067
type Header = Header;
7168
type Event = TestEvent;
7269
type BlockHashCount = BlockHashCount;
73-
type MaximumBlockWeight = MaximumBlockWeight;
74-
type MaximumBlockLength = MaximumBlockLength;
75-
type AvailableBlockRatio = AvailableBlockRatio;
70+
type BlockWeights = ();
71+
type BlockLength = ();
7672
type Version = ();
7773
type PalletInfo = ();
7874
type AccountData = ();
7975
type OnNewAccount = ();
8076
type OnKilledAccount = ();
8177
type DbWeight = ();
82-
type BlockExecutionWeight = ();
83-
type ExtrinsicBaseWeight = ();
84-
type MaximumExtrinsicWeight = ();
8578
type BaseCallFilter = ();
8679
type SystemWeightInfo = ();
8780
}

0 commit comments

Comments
 (0)