BlockId removal: refactor: Backend::block_indexed_body (#12609)

* BlockId removal: refactor: Backend::block_indexed_body

It changes the arguments of `Backend::block_indexed_body` method from: `BlockId<Block>` to: `&Block::Hash`

This PR is part of BlockId::Number refactoring analysis (paritytech/substrate#11292)

* trigger CI job
This commit is contained in:
Michal Kucharczyk authored and GitHub committed 2022-11-03 16:57:10 +00:00
1 parent 153399431b
commit 11b6409c12
6 files changed
+25 -12

No files matched your search

+13 -3
View File
@@ -1980,9 +1980,9 @@ where
fn block_indexed_body(
&self,
id: &BlockId<Block>,
hash: &Block::Hash,
) -> sp_blockchain::Result<Option<Vec<Vec<u8>>>> {
self.backend.blockchain().block_indexed_body(*id)
self.backend.blockchain().block_indexed_body(hash)
}
fn requires_full_sync(&self) -> bool {
@@ -2073,9 +2073,19 @@ where
&self,
number: NumberFor<B>,
) -> Result<Option<Vec<Vec<u8>>>, sp_transaction_storage_proof::Error> {
let hash = match self
.backend
.blockchain()
.block_hash_from_id(&BlockId::Number(number))
.map_err(|e| sp_transaction_storage_proof::Error::Application(Box::new(e)))?
{
Some(hash) => hash,
None => return Ok(None),
};
self.backend
.blockchain()
.block_indexed_body(BlockId::number(number))
.block_indexed_body(&hash)
.map_err(|e| sp_transaction_storage_proof::Error::Application(Box::new(e)))
}