BlockId removal: BlockBuilderProvider::new_block_at (#13401)

* `BlockId` removal: `BlockBuilderProvider::new_block_at`

It changes the arguments of `BlockBuilderProvider::new_block_at` from:
`BlockId<Block>` to: `Block::Hash`

* fmt

* fix

* more fixes
This commit is contained in:
Michal Kucharczyk
2023-02-21 19:36:00 +01:00
committed by GitHub
parent cd299d2b45
commit 5ef88dd398
15 changed files with 175 additions and 196 deletions
@@ -16,10 +16,7 @@
// limitations under the License.
use sp_api::{Core, ProvideRuntimeApi};
use sp_runtime::{
generic::BlockId,
traits::{HashFor, Header as HeaderT},
};
use sp_runtime::traits::{HashFor, Header as HeaderT};
use sp_state_machine::{
create_proof_check_backend, execution_proof_check_on_trie_backend, ExecutionStrategy,
};
@@ -166,10 +163,9 @@ fn record_proof_works() {
}
.into_signed_tx();
let block_id = BlockId::Hash(client.chain_info().best_hash);
// Build the block and record proof
let mut builder = client
.new_block_at(&block_id, Default::default(), true)
.new_block_at(client.chain_info().best_hash, Default::default(), true)
.expect("Creates block builder");
builder.push(transaction.clone()).unwrap();
let (block, _, proof) = builder.build().expect("Bake block").into_inner();