mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-20 18:35:41 +00:00
Move Externalities into its own crate (#3775)
* Move `Externalities` into `substrate-externalities` - `Externalities` now support generic extensions - Split of `primtives-storage` for storage primitive types * Move the externalities scoping into `substrate-externalities` * Fix compilation * Review feedback * Adds macro for declaring extensions * Fix benchmarks * Introduce `ExtensionStore` trait * Last review comments * Implement it for `ExtensionStore`
This commit is contained in:
@@ -17,9 +17,10 @@
|
||||
use criterion::{Criterion, criterion_group, criterion_main, black_box};
|
||||
use srml_system as system;
|
||||
use support::{decl_module, decl_event, impl_outer_origin, impl_outer_event};
|
||||
use runtime_io::with_externalities;
|
||||
use primitives::{H256, Blake2Hasher};
|
||||
use sr_primitives::{Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header};
|
||||
use primitives::H256;
|
||||
use sr_primitives::{
|
||||
set_and_run_with_externalities, Perbill, traits::{BlakeTwo256, IdentityLookup}, testing::Header,
|
||||
};
|
||||
|
||||
mod module {
|
||||
use super::*;
|
||||
@@ -82,13 +83,13 @@ impl module::Trait for Runtime {
|
||||
type Event = Event;
|
||||
}
|
||||
|
||||
fn new_test_ext() -> runtime_io::TestExternalities<Blake2Hasher> {
|
||||
fn new_test_ext() -> runtime_io::TestExternalities {
|
||||
system::GenesisConfig::default().build_storage::<Runtime>().unwrap().into()
|
||||
}
|
||||
|
||||
fn deposit_events(n: usize) {
|
||||
let mut t = new_test_ext();
|
||||
with_externalities(&mut t, || {
|
||||
set_and_run_with_externalities(&mut t, || {
|
||||
for _ in 0..n {
|
||||
module::Module::<Runtime>::deposit_event(
|
||||
module::Event::Complex(vec![1, 2, 3], 2, 3, 899)
|
||||
|
||||
Reference in New Issue
Block a user