BlockId removal: refactor of runtime API (#6721)

* BlockId removal: refactor of runtime API

It changes the first argument of all generated runtime API calls from: `BlockId<Block>` to: `Block::Hash`

* fmt

* update lockfile for {"substrate"}

---------

Co-authored-by: parity-processbot <>
This commit is contained in:
Michal Kucharczyk
2023-02-21 00:44:20 +01:00
committed by GitHub
parent 35a0d69af8
commit d091a84a07
3 changed files with 210 additions and 214 deletions
@@ -56,9 +56,8 @@ impl InitPolkadotBlockBuilder for Client {
&self,
hash: <Block as BlockT>::Hash,
) -> BlockBuilder<Block, Client, FullBackend> {
let at = BlockId::Hash(hash);
let last_timestamp =
self.runtime_api().get_last_timestamp(&at).expect("Get last timestamp");
self.runtime_api().get_last_timestamp(hash).expect("Get last timestamp");
// `MinimumPeriod` is a storage parameter type that requires externalities to access the value.
let minimum_period = BasicExternalities::new_empty()
@@ -88,7 +87,7 @@ impl InitPolkadotBlockBuilder for Client {
};
let mut block_builder = self
.new_block_at(&at, digest, false)
.new_block_at(&BlockId::Hash(hash), digest, false)
.expect("Creates new block builder for test runtime");
let mut inherent_data = sp_inherents::InherentData::new();