mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 16:47:57 +00:00
BlockId removal: refactor: CallExecutor trait (#13173)
* BlockId removal: refactor: CallExecutor trait It changes the arguments of CallExecutor methods: - `call`, 'contextual_call', 'runtime_version', 'prove_execution' from: `BlockId<Block>` to: `Block::Hash` This PR is part of BlockId::Number refactoring analysis (paritytech/substrate#11292) * Apply suggestions from code review Co-authored-by: Bastian Köcher <git@kchr.de> * ".git/.scripts/commands/fmt/fmt.sh" Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: command-bot <>
This commit is contained in:
committed by
GitHub
parent
d2fcebef40
commit
025f9d9ba3
@@ -48,7 +48,7 @@ pub use sp_runtime::{create_runtime_str, StateVersion};
|
||||
pub use sp_std;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use sp_runtime::{generic::BlockId, traits::Block as BlockT};
|
||||
use sp_runtime::traits::Block as BlockT;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
pub mod embed;
|
||||
@@ -370,14 +370,14 @@ pub trait GetNativeVersion {
|
||||
#[cfg(feature = "std")]
|
||||
pub trait GetRuntimeVersionAt<Block: BlockT> {
|
||||
/// Returns the version of runtime at the given block.
|
||||
fn runtime_version(&self, at: &BlockId<Block>) -> Result<RuntimeVersion, String>;
|
||||
fn runtime_version(&self, at: <Block as BlockT>::Hash) -> Result<RuntimeVersion, String>;
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
impl<T: GetRuntimeVersionAt<Block>, Block: BlockT> GetRuntimeVersionAt<Block>
|
||||
for std::sync::Arc<T>
|
||||
{
|
||||
fn runtime_version(&self, at: &BlockId<Block>) -> Result<RuntimeVersion, String> {
|
||||
fn runtime_version(&self, at: <Block as BlockT>::Hash) -> Result<RuntimeVersion, String> {
|
||||
(&**self).runtime_version(at)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user