mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 10:21:05 +00:00
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:
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user