mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-06 00:58:02 +00:00
Move registration of ReadRuntimeVersionExt to ExecutionExtension (#13820)
Instead of registering `ReadRuntimeVersionExt` in `sp-state-machine` it is moved to `ExecutionExtension` which provides the default extensions.
This commit is contained in:
@@ -157,6 +157,16 @@ pub trait ReadRuntimeVersion: Send + Sync {
|
||||
) -> Result<Vec<u8>, String>;
|
||||
}
|
||||
|
||||
impl ReadRuntimeVersion for std::sync::Arc<dyn ReadRuntimeVersion> {
|
||||
fn read_runtime_version(
|
||||
&self,
|
||||
wasm_code: &[u8],
|
||||
ext: &mut dyn Externalities,
|
||||
) -> Result<Vec<u8>, String> {
|
||||
(**self).read_runtime_version(wasm_code, ext)
|
||||
}
|
||||
}
|
||||
|
||||
sp_externalities::decl_extension! {
|
||||
/// An extension that provides functionality to read version information from a given wasm blob.
|
||||
pub struct ReadRuntimeVersionExt(Box<dyn ReadRuntimeVersion>);
|
||||
|
||||
Reference in New Issue
Block a user