mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 15:07:59 +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:
@@ -69,12 +69,12 @@ decl_event!(
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
use runtime_io::with_externalities;
|
||||
use primitives::{H256, Blake2Hasher};
|
||||
use primitives::H256;
|
||||
use support::{impl_outer_origin, assert_ok, parameter_types};
|
||||
use sr_primitives::{traits::{BlakeTwo256, IdentityLookup}, testing::Header};
|
||||
use sr_primitives::weights::Weight;
|
||||
use sr_primitives::Perbill;
|
||||
use sr_primitives::{
|
||||
set_and_run_with_externalities, traits::{BlakeTwo256, IdentityLookup}, testing::Header,
|
||||
weights::Weight, Perbill,
|
||||
};
|
||||
|
||||
impl_outer_origin! {
|
||||
pub enum Origin for Test {}
|
||||
@@ -116,13 +116,13 @@ mod tests {
|
||||
|
||||
// This function basically just builds a genesis storage key/value store according to
|
||||
// our desired mockup.
|
||||
fn new_test_ext() -> runtime_io::TestExternalities<Blake2Hasher> {
|
||||
fn new_test_ext() -> runtime_io::TestExternalities {
|
||||
system::GenesisConfig::default().build_storage::<Test>().unwrap().into()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn it_works_for_default_value() {
|
||||
with_externalities(&mut new_test_ext(), || {
|
||||
set_and_run_with_externalities(&mut new_test_ext(), || {
|
||||
// Just a dummy test for the dummy funtion `do_something`
|
||||
// calling the `do_something` function with a value 42
|
||||
assert_ok!(TemplateModule::do_something(Origin::signed(1), 42));
|
||||
|
||||
Reference in New Issue
Block a user