Improve and unify testing facilities (#1844)

* Improve and unify testing facilities

This improves the testing facilities by making the test client easier to
use. It also removes code that is not required for the test client.
Besides that it also moves the test service and test client under
`node/test`.

* Update Cargo.lock

* Update node/test/client/src/block_builder.rs

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

* Remove explicit lifetime annotation

* Fix warnings and add extra `BlockBuilderExt`

Co-authored-by: Andronik Ordian <write@reusable.software>
This commit is contained in:
Bastian KöcherandAndronik Ordian authored and GitHub committed 2020-10-25 14:45:30 +00:00
1 parent abb282dfd0
commit 2163988f54
14 files changed
+423 -505

No files matched your search

+13
View File
@@ -104,6 +104,13 @@ pub fn native_version() -> NativeVersion {
}
}
sp_api::decl_runtime_apis! {
pub trait GetLastTimestamp {
/// Returns the last timestamp of a runtime.
fn get_last_timestamp() -> u64;
}
}
parameter_types! {
pub const Version: RuntimeVersion = VERSION;
}
@@ -736,4 +743,10 @@ sp_api::impl_runtime_apis! {
TransactionPayment::query_info(uxt, len)
}
}
impl crate::GetLastTimestamp<Block> for Runtime {
fn get_last_timestamp() -> u64 {
Timestamp::now()
}
}
}