`BlockId` removal: `runtime-api` refactor (#13255)
* BlockId removal: refactor of runtime API It changes the arguments of: - `ApiExt` methods: `has_api`, `has_api_with`, `api_version` - `CallApiAt` method: `runtime_version_at` from: `BlockId<Block>` to: `Block::Hash` It also changes the first argument of all generated runtime API calls from: `BlockId<Block>` to: `Block::Hash` This PR is part of BlockId::Number refactoring analysis (paritytech/substrate#11292) * BlockId removal: refactor of runtime API - tests - tests adjusted to new runtime API, - some tests migrated from block number to block hash * benchmarking-cli: BlockId(0) migrated to info().genesis_hash `runtime_api.call()` now requires the block hash instead of BlockId::Number. To access the genesis hash widely used in benchmarking engine the Client was constrained to satisfy `sp_blockchain::HeaderBackend<Block>` trait which provides `info().genesis_hash`. * trivial: api.call(BlockId) -> api.call(Hash) - Migrated all `runtime_api.calls` to use Hash - Noteworthy (?): -- `validate_transaction_blocking` in transaction pool, * CallApiAtParams::at changed to Block::Hash * missed doc updated * Apply suggestions from code review Co-authored-by:Bastian Köcher <git@kchr.de> * ".git/.scripts/commands/fmt/fmt.sh" * BlockId removal: Benchmark::consumed_weight Little refactor around `Benchmark::consumed_weight`: `BlockId` removed. * at_hash renamed * wrong merge fixed * beefy worker: merged with master * beefy: tests: missing block problem fixed * Apply review suggestion * fix --------- Co-authored-by:
Bastian Köcher <git@kchr.de> Co-authored-by: command-bot <>
Showing
- substrate/bin/node/cli/src/service.rs 1 addition, 1 deletionsubstrate/bin/node/cli/src/service.rs
- substrate/bin/node/testing/src/bench.rs 1 addition, 3 deletionssubstrate/bin/node/testing/src/bench.rs
- substrate/client/authority-discovery/src/worker.rs 2 additions, 2 deletionssubstrate/client/authority-discovery/src/worker.rs
- substrate/client/basic-authorship/src/basic_authorship.rs 1 addition, 1 deletionsubstrate/client/basic-authorship/src/basic_authorship.rs
- substrate/client/beefy/src/import.rs 2 additions, 4 deletionssubstrate/client/beefy/src/import.rs
- substrate/client/beefy/src/lib.rs 14 additions, 22 deletionssubstrate/client/beefy/src/lib.rs
- substrate/client/beefy/src/worker.rs 16 additions, 6 deletionssubstrate/client/beefy/src/worker.rs
- substrate/client/block-builder/src/lib.rs 12 additions, 12 deletionssubstrate/client/block-builder/src/lib.rs
- substrate/client/consensus/aura/src/import_queue.rs 4 additions, 8 deletionssubstrate/client/consensus/aura/src/import_queue.rs
- substrate/client/consensus/aura/src/lib.rs 6 additions, 5 deletionssubstrate/client/consensus/aura/src/lib.rs
- substrate/client/consensus/babe/rpc/src/lib.rs 2 additions, 2 deletionssubstrate/client/consensus/babe/rpc/src/lib.rs
- substrate/client/consensus/babe/src/lib.rs 20 additions, 21 deletionssubstrate/client/consensus/babe/src/lib.rs
- substrate/client/consensus/babe/src/tests.rs 1 addition, 1 deletionsubstrate/client/consensus/babe/src/tests.rs
- substrate/client/consensus/pow/src/lib.rs 3 additions, 3 deletionssubstrate/client/consensus/pow/src/lib.rs
- substrate/client/finality-grandpa/src/environment.rs 3 additions, 6 deletionssubstrate/client/finality-grandpa/src/environment.rs
- substrate/client/finality-grandpa/src/import.rs 4 additions, 5 deletionssubstrate/client/finality-grandpa/src/import.rs
- substrate/client/merkle-mountain-range/rpc/src/lib.rs 7 additions, 12 deletionssubstrate/client/merkle-mountain-range/rpc/src/lib.rs
- substrate/client/merkle-mountain-range/src/lib.rs 7 additions, 9 deletionssubstrate/client/merkle-mountain-range/src/lib.rs
- substrate/client/offchain/src/lib.rs 11 additions, 13 deletionssubstrate/client/offchain/src/lib.rs
- substrate/client/rpc-spec-v2/src/chain_head/chain_head.rs 8 additions, 20 deletionssubstrate/client/rpc-spec-v2/src/chain_head/chain_head.rs
Please register or sign in to comment