mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 20:27:58 +00:00
Do not call initialize_block before any runtime api (#8953)
* Do not call `initialize_block` before any runtime api Before this change we always called `initialize_block` before calling into the runtime. There was already support with `skip_initialize` to skip the initialization. Almost no runtime_api requires that `initialize_block` is called before. Actually this only leads to higher execution times most of the time, because all runtime modules are initialized and this is especially expensive when the block contained a runtime upgrade. TLDR: Do not call `initialize_block` before calling a runtime api. * Change `validate_transaction` interface * Fix rpc test * Fixes and comments * Some docs
This commit is contained in:
@@ -94,6 +94,13 @@ fn implement_common_api_traits(
|
||||
Ok(pred(A::VERSION))
|
||||
}
|
||||
|
||||
fn api_version<A: #crate_::RuntimeApiInfo + ?Sized>(
|
||||
&self,
|
||||
_: &#crate_::BlockId<#block_type>,
|
||||
) -> std::result::Result<Option<u32>, #crate_::ApiError> where Self: Sized {
|
||||
Ok(Some(A::VERSION))
|
||||
}
|
||||
|
||||
fn record_proof(&mut self) {
|
||||
unimplemented!("`record_proof` not implemented for runtime api mocks")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user