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:
Bastian Köcher
2019-10-09 15:50:30 +02:00
committed by GitHub
parent 984c6ac839
commit 8a39be474e
95 changed files with 1600 additions and 1420 deletions
+3 -3
View File
@@ -25,7 +25,7 @@ use sr_primitives::{
testing::Header,
traits::{BlakeTwo256, IdentityLookup},
};
use primitives::{Blake2Hasher, H256};
use primitives::H256;
use support::{parameter_types, impl_outer_event, impl_outer_origin};
use super::*;
@@ -118,7 +118,7 @@ impl ExtBuilder {
}
// builds genesis config
pub fn build(self) -> runtime_io::TestExternalities<Blake2Hasher> {
pub fn build(self) -> runtime_io::TestExternalities {
let mut t = system::GenesisConfig::default().build_storage::<Test>().unwrap();
GenesisConfig::<Test> {
@@ -137,7 +137,7 @@ impl ExtBuilder {
// This function basically just builds a genesis storage key/value store according to
// our desired mockup.
pub fn new_test_ext() -> runtime_io::TestExternalities<Blake2Hasher> {
pub fn new_test_ext() -> runtime_io::TestExternalities {
system::GenesisConfig::default()
.build_storage::<Test>()
.unwrap()