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

Commit fd0b3b3

Browse files
committed
Merge branch 'master' of https://github.com/paritytech/substrate into wiz-field-names-to-pallet-events
2 parents 510d053 + 9e8c7b8 commit fd0b3b3

File tree

171 files changed

+609
-17877
lines changed

Some content is hidden

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

171 files changed

+609
-17877
lines changed

Cargo.lock

Lines changed: 6 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ members = [
4242
"client/finality-grandpa",
4343
"client/informant",
4444
"client/keystore",
45-
"client/light",
4645
"client/network",
4746
"client/network-gossip",
4847
"client/network/test",

bin/node-template/node/src/chain_spec.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ fn testnet_genesis(
134134
system: SystemConfig {
135135
// Add Wasm runtime to storage.
136136
code: wasm_binary.to_vec(),
137-
changes_trie_config: Default::default(),
138137
},
139138
balances: BalancesConfig {
140139
// Configure endowed accounts with initial balance of 1 << 60.

bin/node-template/node/src/service.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
194194
transaction_pool: transaction_pool.clone(),
195195
spawn_handle: task_manager.spawn_handle(),
196196
import_queue,
197-
on_demand: None,
198197
block_announce_validator_builder: None,
199198
warp_sync: Some(warp_sync),
200199
})?;
@@ -234,8 +233,6 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
234233
task_manager: &mut task_manager,
235234
transaction_pool: transaction_pool.clone(),
236235
rpc_extensions_builder,
237-
on_demand: None,
238-
remote_blockchain: None,
239236
backend,
240237
system_rpc_tx,
241238
config,

bin/node/cli/src/chain_spec.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,7 @@ pub fn testnet_genesis(
295295
const STASH: Balance = ENDOWMENT / 1000;
296296

297297
GenesisConfig {
298-
system: SystemConfig {
299-
code: wasm_binary_unwrap().to_vec(),
300-
changes_trie_config: Default::default(),
301-
},
298+
system: SystemConfig { code: wasm_binary_unwrap().to_vec() },
302299
balances: BalancesConfig {
303300
balances: endowed_accounts.iter().cloned().map(|x| (x, ENDOWMENT)).collect(),
304301
},

bin/node/cli/src/service.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,6 @@ pub fn new_full_base(
338338
transaction_pool: transaction_pool.clone(),
339339
spawn_handle: task_manager.spawn_handle(),
340340
import_queue,
341-
on_demand: None,
342341
block_announce_validator_builder: None,
343342
warp_sync: Some(warp_sync),
344343
})?;
@@ -369,8 +368,6 @@ pub fn new_full_base(
369368
rpc_extensions_builder: Box::new(rpc_extensions_builder),
370369
transaction_pool: transaction_pool.clone(),
371370
task_manager: &mut task_manager,
372-
on_demand: None,
373-
remote_blockchain: None,
374371
system_rpc_tx,
375372
telemetry: telemetry.as_mut(),
376373
})?;
@@ -542,7 +539,7 @@ mod tests {
542539
use sc_service_test::TestNetNode;
543540
use sc_transaction_pool_api::{ChainEvent, MaintainedTransactionPool};
544541
use sp_consensus::{BlockOrigin, Environment, Proposer};
545-
use sp_core::{crypto::Pair as CryptoPair, Public, H256};
542+
use sp_core::{crypto::Pair as CryptoPair, Public};
546543
use sp_inherents::InherentDataProvider;
547544
use sp_keyring::AccountKeyring;
548545
use sp_keystore::{SyncCryptoStore, SyncCryptoStorePtr};
@@ -621,7 +618,7 @@ mod tests {
621618
None,
622619
);
623620

624-
let mut digest = Digest::<H256>::default();
621+
let mut digest = Digest::default();
625622

626623
// even though there's only one authority some slots might be empty,
627624
// so we must keep trying the next slots until we can claim one.

bin/node/executor/benches/bench.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const SPEC_VERSION: u32 = node_runtime::VERSION.spec_version;
5353

5454
const HEAP_PAGES: u64 = 20;
5555

56-
type TestExternalities<H> = CoreTestExternalities<H, u64>;
56+
type TestExternalities<H> = CoreTestExternalities<H>;
5757

5858
#[derive(Debug)]
5959
enum ExecutionMethod {
@@ -188,7 +188,7 @@ fn bench_execute_block(c: &mut Criterion) {
188188

189189
for strategy in execution_methods {
190190
group.bench_function(format!("{:?}", strategy), |b| {
191-
let genesis_config = node_testing::genesis::config(false, Some(compact_code_unwrap()));
191+
let genesis_config = node_testing::genesis::config(Some(compact_code_unwrap()));
192192
let (use_native, wasm_method) = match strategy {
193193
ExecutionMethod::Native => (true, WasmExecutionMethod::Interpreted),
194194
ExecutionMethod::Wasm(wasm_method) => (false, wasm_method),

bin/node/executor/tests/basic.rs

Lines changed: 17 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use sp_runtime::{
2929
use node_primitives::{Balance, Hash};
3030
use node_runtime::{
3131
constants::{currency::*, time::SLOT_DURATION},
32-
Balances, Block, Call, CheckedExtrinsic, Event, Header, Runtime, System, TransactionPayment,
32+
Balances, Call, CheckedExtrinsic, Event, Header, Runtime, System, TransactionPayment,
3333
UncheckedExtrinsic,
3434
};
3535
use node_testing::keyring::*;
@@ -78,7 +78,7 @@ fn set_heap_pages<E: Externalities>(ext: &mut E, heap_pages: u64) {
7878
fn changes_trie_block() -> (Vec<u8>, Hash) {
7979
let time = 42 * 1000;
8080
construct_block(
81-
&mut new_test_ext(compact_code_unwrap(), true),
81+
&mut new_test_ext(compact_code_unwrap()),
8282
1,
8383
GENESIS_HASH.into(),
8484
vec![
@@ -102,7 +102,7 @@ fn changes_trie_block() -> (Vec<u8>, Hash) {
102102
/// are not guaranteed to be deterministic) and to ensure that the correct state is propagated
103103
/// from block1's execution to block2 to derive the correct storage_root.
104104
fn blocks() -> ((Vec<u8>, Hash), (Vec<u8>, Hash)) {
105-
let mut t = new_test_ext(compact_code_unwrap(), false);
105+
let mut t = new_test_ext(compact_code_unwrap());
106106
let time1 = 42 * 1000;
107107
let block1 = construct_block(
108108
&mut t,
@@ -160,7 +160,7 @@ fn blocks() -> ((Vec<u8>, Hash), (Vec<u8>, Hash)) {
160160

161161
fn block_with_size(time: u64, nonce: u32, size: usize) -> (Vec<u8>, Hash) {
162162
construct_block(
163-
&mut new_test_ext(compact_code_unwrap(), false),
163+
&mut new_test_ext(compact_code_unwrap()),
164164
1,
165165
GENESIS_HASH.into(),
166166
vec![
@@ -179,7 +179,7 @@ fn block_with_size(time: u64, nonce: u32, size: usize) -> (Vec<u8>, Hash) {
179179

180180
#[test]
181181
fn panic_execution_with_foreign_code_gives_error() {
182-
let mut t = new_test_ext(bloaty_code_unwrap(), false);
182+
let mut t = new_test_ext(bloaty_code_unwrap());
183183
t.insert(
184184
<frame_system::Account<Runtime>>::hashed_key_for(alice()),
185185
(69u128, 0u32, 0u128, 0u128, 0u128).encode(),
@@ -211,7 +211,7 @@ fn panic_execution_with_foreign_code_gives_error() {
211211

212212
#[test]
213213
fn bad_extrinsic_with_native_equivalent_code_gives_error() {
214-
let mut t = new_test_ext(compact_code_unwrap(), false);
214+
let mut t = new_test_ext(compact_code_unwrap());
215215
t.insert(
216216
<frame_system::Account<Runtime>>::hashed_key_for(alice()),
217217
(0u32, 0u32, 0u32, 69u128, 0u128, 0u128, 0u128).encode(),
@@ -243,7 +243,7 @@ fn bad_extrinsic_with_native_equivalent_code_gives_error() {
243243

244244
#[test]
245245
fn successful_execution_with_native_equivalent_code_gives_ok() {
246-
let mut t = new_test_ext(compact_code_unwrap(), false);
246+
let mut t = new_test_ext(compact_code_unwrap());
247247
t.insert(
248248
<frame_system::Account<Runtime>>::hashed_key_for(alice()),
249249
AccountInfo::<<Runtime as frame_system::Config>::Index, _> {
@@ -296,7 +296,7 @@ fn successful_execution_with_native_equivalent_code_gives_ok() {
296296

297297
#[test]
298298
fn successful_execution_with_foreign_code_gives_ok() {
299-
let mut t = new_test_ext(bloaty_code_unwrap(), false);
299+
let mut t = new_test_ext(bloaty_code_unwrap());
300300
t.insert(
301301
<frame_system::Account<Runtime>>::hashed_key_for(alice()),
302302
AccountInfo::<<Runtime as frame_system::Config>::Index, _> {
@@ -349,7 +349,7 @@ fn successful_execution_with_foreign_code_gives_ok() {
349349

350350
#[test]
351351
fn full_native_block_import_works() {
352-
let mut t = new_test_ext(compact_code_unwrap(), false);
352+
let mut t = new_test_ext(compact_code_unwrap());
353353

354354
let (block1, block2) = blocks();
355355

@@ -538,7 +538,7 @@ fn full_native_block_import_works() {
538538

539539
#[test]
540540
fn full_wasm_block_import_works() {
541-
let mut t = new_test_ext(compact_code_unwrap(), false);
541+
let mut t = new_test_ext(compact_code_unwrap());
542542

543543
let (block1, block2) = blocks();
544544

@@ -688,7 +688,7 @@ fn deploying_wasm_contract_should_work() {
688688

689689
let time = 42 * 1000;
690690
let b = construct_block(
691-
&mut new_test_ext(compact_code_unwrap(), false),
691+
&mut new_test_ext(compact_code_unwrap()),
692692
1,
693693
GENESIS_HASH.into(),
694694
vec![
@@ -721,7 +721,7 @@ fn deploying_wasm_contract_should_work() {
721721
(time / SLOT_DURATION).into(),
722722
);
723723

724-
let mut t = new_test_ext(compact_code_unwrap(), false);
724+
let mut t = new_test_ext(compact_code_unwrap());
725725

726726
executor_call::<NeverNativeValue, fn() -> _>(&mut t, "Core_execute_block", &b.0, false, None)
727727
.0
@@ -736,7 +736,7 @@ fn deploying_wasm_contract_should_work() {
736736

737737
#[test]
738738
fn wasm_big_block_import_fails() {
739-
let mut t = new_test_ext(compact_code_unwrap(), false);
739+
let mut t = new_test_ext(compact_code_unwrap());
740740

741741
set_heap_pages(&mut t.ext(), 4);
742742

@@ -753,7 +753,7 @@ fn wasm_big_block_import_fails() {
753753

754754
#[test]
755755
fn native_big_block_import_succeeds() {
756-
let mut t = new_test_ext(compact_code_unwrap(), false);
756+
let mut t = new_test_ext(compact_code_unwrap());
757757

758758
executor_call::<NeverNativeValue, fn() -> _>(
759759
&mut t,
@@ -768,7 +768,7 @@ fn native_big_block_import_succeeds() {
768768

769769
#[test]
770770
fn native_big_block_import_fails_on_fallback() {
771-
let mut t = new_test_ext(compact_code_unwrap(), false);
771+
let mut t = new_test_ext(compact_code_unwrap());
772772

773773
// We set the heap pages to 8 because we know that should give an OOM in WASM with the given
774774
// block.
@@ -787,7 +787,7 @@ fn native_big_block_import_fails_on_fallback() {
787787

788788
#[test]
789789
fn panic_execution_gives_error() {
790-
let mut t = new_test_ext(bloaty_code_unwrap(), false);
790+
let mut t = new_test_ext(bloaty_code_unwrap());
791791
t.insert(
792792
<frame_system::Account<Runtime>>::hashed_key_for(alice()),
793793
AccountInfo::<<Runtime as frame_system::Config>::Index, _> {
@@ -824,7 +824,7 @@ fn panic_execution_gives_error() {
824824

825825
#[test]
826826
fn successful_execution_gives_ok() {
827-
let mut t = new_test_ext(compact_code_unwrap(), false);
827+
let mut t = new_test_ext(compact_code_unwrap());
828828
t.insert(
829829
<frame_system::Account<Runtime>>::hashed_key_for(alice()),
830830
AccountInfo::<<Runtime as frame_system::Config>::Index, _> {
@@ -883,44 +883,6 @@ fn successful_execution_gives_ok() {
883883
});
884884
}
885885

886-
#[test]
887-
fn full_native_block_import_works_with_changes_trie() {
888-
let block1 = changes_trie_block();
889-
let block_data = block1.0;
890-
let block = Block::decode(&mut &block_data[..]).unwrap();
891-
892-
let mut t = new_test_ext(compact_code_unwrap(), true);
893-
executor_call::<NeverNativeValue, fn() -> _>(
894-
&mut t,
895-
"Core_execute_block",
896-
&block.encode(),
897-
true,
898-
None,
899-
)
900-
.0
901-
.unwrap();
902-
903-
assert!(t.ext().storage_changes_root(&GENESIS_HASH).unwrap().is_some());
904-
}
905-
906-
#[test]
907-
fn full_wasm_block_import_works_with_changes_trie() {
908-
let block1 = changes_trie_block();
909-
910-
let mut t = new_test_ext(compact_code_unwrap(), true);
911-
executor_call::<NeverNativeValue, fn() -> _>(
912-
&mut t,
913-
"Core_execute_block",
914-
&block1.0,
915-
false,
916-
None,
917-
)
918-
.0
919-
.unwrap();
920-
921-
assert!(t.ext().storage_changes_root(&GENESIS_HASH).unwrap().is_some());
922-
}
923-
924886
#[test]
925887
fn should_import_block_with_test_client() {
926888
use node_testing::client::{

0 commit comments

Comments
 (0)