mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 12:48:00 +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:
@@ -15,20 +15,22 @@
|
||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
||||
#![recursion_limit="128"]
|
||||
|
||||
use runtime_io::with_externalities;
|
||||
use sr_primitives::{
|
||||
generic, BuildStorage, traits::{BlakeTwo256, Block as _, Verify},
|
||||
set_and_run_with_externalities,
|
||||
};
|
||||
use support::{
|
||||
Parameter, traits::Get, parameter_types,
|
||||
sr_primitives::{generic, BuildStorage, traits::{BlakeTwo256, Block as _, Verify}},
|
||||
metadata::{
|
||||
DecodeDifferent, StorageMetadata, StorageEntryModifier, StorageEntryType, DefaultByteGetter,
|
||||
StorageEntryMetadata, StorageHasher
|
||||
StorageEntryMetadata, StorageHasher,
|
||||
},
|
||||
StorageValue, StorageMap, StorageLinkedMap, StorageDoubleMap,
|
||||
};
|
||||
use inherents::{
|
||||
ProvideInherent, InherentData, InherentIdentifier, RuntimeString, MakeFatalError
|
||||
};
|
||||
use primitives::{H256, sr25519, Blake2Hasher};
|
||||
use primitives::{H256, sr25519};
|
||||
|
||||
mod system;
|
||||
|
||||
@@ -275,7 +277,7 @@ pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
||||
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
|
||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<u32, Call, Signature, ()>;
|
||||
|
||||
fn new_test_ext() -> runtime_io::TestExternalities<Blake2Hasher> {
|
||||
fn new_test_ext() -> runtime_io::TestExternalities {
|
||||
GenesisConfig{
|
||||
module1_Instance1: Some(module1::GenesisConfig {
|
||||
value: 3,
|
||||
@@ -329,7 +331,7 @@ fn storage_instance_independance() {
|
||||
|
||||
#[test]
|
||||
fn storage_with_instance_basic_operation() {
|
||||
with_externalities(&mut new_test_ext(), || {
|
||||
set_and_run_with_externalities(&mut new_test_ext(), || {
|
||||
type Value = module2::Value<Runtime, module2::Instance1>;
|
||||
type Map = module2::Map<module2::Instance1>;
|
||||
type LinkedMap = module2::LinkedMap<module2::Instance1>;
|
||||
|
||||
Reference in New Issue
Block a user