Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

BlockId removal: refactor: StorageProvider #6160

Merged
merged 4 commits into from
Oct 18, 2022

Conversation

michalkucharczyk
Copy link
Contributor

@michalkucharczyk michalkucharczyk commented Oct 17, 2022

It changes the arguments of Backend::StorageProvider trait from:
block: BlockId<Block> to: hash: &Block::Hash

Companion for: paritytech/substrate#12510
cumulus companion: paritytech/cumulus#1770

It changes the arguments of `Backend::StorageProvider` trait from:
block: `BlockId<Block>` to: hash: `&Block::Hash`
@michalkucharczyk michalkucharczyk added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit. labels Oct 17, 2022
@michalkucharczyk michalkucharczyk requested a review from a team October 17, 2022 12:21
fn storage(
&self,
id: &BlockId<Block>,
hash: &<Block as BlockT>::Hash,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
hash: &<Block as BlockT>::Hash,
hash: &Block::Hash,

You don't need to fully qualify the trait.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't compile:

   --> node/client/src/lib.rs:427:10
    |
427 |         hash: &Block::Hash,
    |                ^^^^^^^^^^^ help: use fully-qualified syntax: `<sp_runtime::generic::Block<sp_runtime::generic::Header<u32, BlakeTwo256>, OpaqueExtrinsic> as Trait>::Hash`

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh yeah, I thought Block is a generic type here. However, it is the actual type. So, this doesn't work. Sorry!

node/client/src/lib.rs Outdated Show resolved Hide resolved
fn storage(
&self,
id: &BlockId<Block>,
hash: &<Block as BlockT>::Hash,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh yeah, I thought Block is a generic type here. However, it is the actual type. So, this doesn't work. Sorry!

@paritytech-processbot
Copy link

Waiting for commit status.

@paritytech-processbot paritytech-processbot bot merged commit 6e1baff into master Oct 18, 2022
@paritytech-processbot paritytech-processbot bot deleted the mku-blockid-storage branch October 18, 2022 14:01
ordian added a commit that referenced this pull request Oct 21, 2022
* master: (21 commits)
  try and fix build (#6170)
  Companion for EPM duplicate submissions (#6115)
  Bump docker/setup-buildx-action from 2.0.0 to 2.1.0 (#6141)
  companion for #12212 (#6162)
  Bump substrate (#6164)
  BlockId removal: refactor: StorageProvider (#6160)
  availability-recovery: use `IfDisconnected::TryConnect` for chunks (#6081)
  Update clap to version 4 (#6128)
  Add `force_open_hrmp_channel` Call (#6155)
  Fix fuzzing builds xcm-fuzz and erasure-coding fuzzer (#6153)
  BlockId removal refactor: Backend::state_at (#6149)
  First round of implementers guide fixes (#6146)
  bump zombienet version (#6142)
  lingua.dic is not managed by CI team (#6148)
  pallet-mmr: RPC and Runtime APIs work with block numbers (#6072)
  Separate preparation timeouts for PVF prechecking and execution (#6139)
  Malus: add disputed block percentage (#6100)
  refactor grid topology to expose more info to subsystems (#6140)
  Manual Para Lock (#5451)
  Expose node subcommands in Malus CLI (#6135)
  ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit.
Projects
Status: done
Development

Successfully merging this pull request may close these issues.

5 participants