BlockId removal: refactor: Finalizer (#12528)

* BlockId removal: refactor: Finalizer

It changes the arguments of methods of `Finalizer` trait from:
block: `BlockId<Block>` to: hash: `&Block::Hash`

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

* minor corrections

* failing test corrected

* minor rework
This commit is contained in:
Michal Kucharczyk
2022-10-20 08:44:04 +02:00
committed by GitHub
parent 7aadc2aa3c
commit 749bcd1949
16 changed files with 113 additions and 118 deletions
@@ -309,7 +309,8 @@ mod tests {
}
for block in to_finalize {
client.finalize_block(BlockId::Number(*block), None).unwrap();
let hash = blocks[*block as usize - 1].hash();
client.finalize_block(&hash, None).unwrap();
}
(client, backend, blocks)
}
@@ -489,7 +490,7 @@ mod tests {
let grandpa_just8 = GrandpaJustification::from_commit(&client, round, commit).unwrap();
client
.finalize_block(BlockId::Number(8), Some((ID, grandpa_just8.encode().clone())))
.finalize_block(&block8.hash(), Some((ID, grandpa_just8.encode().clone())))
.unwrap();
// Authority set change at block 8, so the justification stored there will be used in the