mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 08:47:57 +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:
@@ -133,7 +133,7 @@ where
|
||||
&executor,
|
||||
"TryRuntime_execute_block",
|
||||
&payload,
|
||||
full_extensions(),
|
||||
full_extensions(executor.clone()),
|
||||
shared.export_proof,
|
||||
)?;
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ async fn dry_run<T: Decode, Block: BlockT, HostFns: HostFunctions>(
|
||||
executor,
|
||||
method,
|
||||
data,
|
||||
full_extensions(),
|
||||
full_extensions(executor.clone()),
|
||||
)?;
|
||||
|
||||
Ok(<T>::decode(&mut &*result)?)
|
||||
@@ -121,7 +121,7 @@ async fn run<Block: BlockT, HostFns: HostFunctions>(
|
||||
executor,
|
||||
method,
|
||||
data,
|
||||
full_extensions(),
|
||||
full_extensions(executor.clone()),
|
||||
)?;
|
||||
|
||||
let storage_changes = changes.drain_storage_changes(
|
||||
|
||||
@@ -149,7 +149,7 @@ where
|
||||
&executor,
|
||||
"TryRuntime_execute_block",
|
||||
(block, command.state_root_check, command.try_state.clone()).encode().as_ref(),
|
||||
full_extensions(),
|
||||
full_extensions(executor.clone()),
|
||||
shared
|
||||
.export_proof
|
||||
.as_ref()
|
||||
|
||||
@@ -97,7 +97,7 @@ where
|
||||
&executor,
|
||||
"OffchainWorkerApi_offchain_worker",
|
||||
&payload,
|
||||
full_extensions(),
|
||||
full_extensions(executor.clone()),
|
||||
)?;
|
||||
|
||||
Ok(())
|
||||
|
||||
@@ -377,7 +377,7 @@ use sp_core::{
|
||||
OffchainDbExt, OffchainWorkerExt, TransactionPoolExt,
|
||||
},
|
||||
storage::well_known_keys,
|
||||
traits::{CallContext, ReadRuntimeVersion},
|
||||
traits::{CallContext, ReadRuntimeVersion, ReadRuntimeVersionExt},
|
||||
twox_128, H256,
|
||||
};
|
||||
use sp_externalities::Extensions;
|
||||
@@ -810,7 +810,7 @@ where
|
||||
}
|
||||
|
||||
/// Build all extensions that we typically use.
|
||||
pub(crate) fn full_extensions() -> Extensions {
|
||||
pub(crate) fn full_extensions<H: HostFunctions>(wasm_executor: WasmExecutor<H>) -> Extensions {
|
||||
let mut extensions = Extensions::default();
|
||||
let (offchain, _offchain_state) = TestOffchainExt::new();
|
||||
let (pool, _pool_state) = TestTransactionPoolExt::new();
|
||||
@@ -819,6 +819,7 @@ pub(crate) fn full_extensions() -> Extensions {
|
||||
extensions.register(OffchainWorkerExt::new(offchain));
|
||||
extensions.register(KeystoreExt::new(keystore));
|
||||
extensions.register(TransactionPoolExt::new(pool));
|
||||
extensions.register(ReadRuntimeVersionExt::new(wasm_executor));
|
||||
|
||||
extensions
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user