mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 21:01:05 +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:
@@ -20,11 +20,11 @@
|
||||
|
||||
use super::*;
|
||||
use crate::mock::{Indices, new_test_ext, make_account, kill_account, TestIsDeadAccount};
|
||||
use runtime_io::with_externalities;
|
||||
use sr_primitives::set_and_run_with_externalities;
|
||||
|
||||
#[test]
|
||||
fn indexing_lookup_should_work() {
|
||||
with_externalities(
|
||||
set_and_run_with_externalities(
|
||||
&mut new_test_ext(),
|
||||
|| {
|
||||
assert_eq!(Indices::lookup_index(0), Some(1));
|
||||
@@ -38,7 +38,7 @@ fn indexing_lookup_should_work() {
|
||||
|
||||
#[test]
|
||||
fn default_indexing_on_new_accounts_should_work() {
|
||||
with_externalities(
|
||||
set_and_run_with_externalities(
|
||||
&mut new_test_ext(),
|
||||
|| {
|
||||
assert_eq!(Indices::lookup_index(4), None);
|
||||
@@ -50,7 +50,7 @@ fn default_indexing_on_new_accounts_should_work() {
|
||||
|
||||
#[test]
|
||||
fn reclaim_indexing_on_new_accounts_should_work() {
|
||||
with_externalities(
|
||||
set_and_run_with_externalities(
|
||||
&mut new_test_ext(),
|
||||
|| {
|
||||
assert_eq!(Indices::lookup_index(1), Some(2));
|
||||
@@ -66,7 +66,7 @@ fn reclaim_indexing_on_new_accounts_should_work() {
|
||||
|
||||
#[test]
|
||||
fn alive_account_should_prevent_reclaim() {
|
||||
with_externalities(
|
||||
set_and_run_with_externalities(
|
||||
&mut new_test_ext(),
|
||||
|| {
|
||||
assert!(!TestIsDeadAccount::is_dead_account(&2));
|
||||
|
||||
Reference in New Issue
Block a user