Update test-runner api (#9302)

* better apis

* ....

* ...

* Genensis -> UnimportedGenesis

* adds rpc for runtime upgrades

* simplify test-runner

* clean up test-runner api

* remove unused imports

* fix doc-test

* fix line width

* correct Node::clean

* correct Node::clean

* add deny rules

* remove unused extern crates

* remove mutex from node

* Update test-utils/test-runner/Cargo.toml

Co-authored-by: Andronik Ordian <write@reusable.software>

* adds docs, removes Node::clean

Co-authored-by: Andronik Ordian <write@reusable.software>
Co-authored-by: Seun Lanlege <seun@parity.io>
This commit is contained in:
Seun Lanlege
2021-07-12 16:56:12 +01:00
committed by GitHub
parent 47b7edde68
commit 2f31602896
11 changed files with 550 additions and 539 deletions
+5 -45
View File
@@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#![deny(missing_docs, unused_extern_crates)]
//! Test runner
//! # Substrate Test Runner
@@ -226,16 +227,14 @@
//! }
//! ```
use manual_seal::consensus::ConsensusDataProvider;
use sc_executor::NativeExecutionDispatch;
use sc_service::{Configuration, TFullBackend, TFullClient, TaskManager, TaskExecutor};
use sc_service::TFullClient;
use sp_api::{ConstructRuntimeApi, TransactionFor};
use sp_consensus::{BlockImport, SelectChain};
use sp_inherents::{CreateInherentDataProviders, InherentDataProvider};
use sp_keystore::SyncCryptoStorePtr;
use sp_inherents::InherentDataProvider;
use sp_runtime::traits::{Block as BlockT, SignedExtension};
use std::sync::Arc;
mod client;
mod node;
mod utils;
mod host_functions;
@@ -243,6 +242,7 @@ mod host_functions;
pub use host_functions::*;
pub use node::*;
pub use utils::*;
pub use client::*;
/// Wrapper trait for concrete type required by this testing framework.
pub trait ChainInfo: Sized {
@@ -282,44 +282,4 @@ pub trait ChainInfo: Sized {
/// Signed extras, this function is caled in an externalities provided environment.
fn signed_extras(from: <Self::Runtime as frame_system::Config>::AccountId) -> Self::SignedExtras;
/// config factory
fn config(task_executor: TaskExecutor) -> Configuration;
/// Attempt to create client parts, including block import,
/// select chain strategy and consensus data provider.
fn create_client_parts(
config: &Configuration,
) -> Result<
(
Arc<TFullClient<Self::Block, Self::RuntimeApi, Self::Executor>>,
Arc<TFullBackend<Self::Block>>,
SyncCryptoStorePtr,
TaskManager,
Box<
dyn CreateInherentDataProviders<
Self::Block,
(),
InherentDataProviders = Self::InherentDataProviders
>
>,
Option<
Box<
dyn ConsensusDataProvider<
Self::Block,
Transaction = TransactionFor<
TFullClient<Self::Block, Self::RuntimeApi, Self::Executor>,
Self::Block,
>,
>,
>,
>,
Self::SelectChain,
Self::BlockImport,
),
sc_service::Error,
>;
/// Given a call and a handle to the node, execute the call with root privileges.
fn dispatch_with_root(call: <Self::Runtime as frame_system::Config>::Call, node: &mut Node<Self>);
}