mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-01 03:21:02 +00:00
grandpa: minor cleanups in communication module (#6371)
* grandpa: replace Result<(), ()> with Option<()> * grandpa: replace &Option<T> with Option<&T> * grandpa: cleanup local id and keystore usages * grandpa: return bool on check_message_signature * grandpa: fix erroneous log message on startup * grandpa: fix test
This commit is contained in:
@@ -133,14 +133,14 @@ impl<Block: BlockT> GrandpaJustification<Block> {
|
||||
let mut buf = Vec::new();
|
||||
let mut visited_hashes = HashSet::new();
|
||||
for signed in self.commit.precommits.iter() {
|
||||
if sp_finality_grandpa::check_message_signature_with_buffer(
|
||||
if !sp_finality_grandpa::check_message_signature_with_buffer(
|
||||
&finality_grandpa::Message::Precommit(signed.precommit.clone()),
|
||||
&signed.id,
|
||||
&signed.signature,
|
||||
self.round,
|
||||
set_id,
|
||||
&mut buf,
|
||||
).is_err() {
|
||||
) {
|
||||
return Err(ClientError::BadJustification(
|
||||
"invalid signature for precommit in grandpa justification".to_string()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user