Do some cleanups (#14608)

* Do some cleanups

Found them while looking over the code.

* More

* Fix
This commit is contained in:
Bastian Köcher
2023-07-21 23:54:01 +02:00
committed by GitHub
parent 98304ee957
commit b16976053e
9 changed files with 39 additions and 45 deletions
@@ -17,7 +17,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use crate::keystore::BeefyKeystore;
use codec::{Decode, Encode};
use codec::{DecodeAll, Encode};
use sp_consensus::Error as ConsensusError;
use sp_consensus_beefy::{
crypto::{AuthorityId, Signature},
@@ -43,7 +43,7 @@ pub(crate) fn decode_and_verify_finality_proof<Block: BlockT>(
target_number: NumberFor<Block>,
validator_set: &ValidatorSet<AuthorityId>,
) -> Result<BeefyVersionedFinalityProof<Block>, (ConsensusError, u32)> {
let proof = <BeefyVersionedFinalityProof<Block>>::decode(&mut &*encoded)
let proof = <BeefyVersionedFinalityProof<Block>>::decode_all(&mut &*encoded)
.map_err(|_| (ConsensusError::InvalidJustification, 0))?;
verify_with_validator_set::<Block>(target_number, validator_set, &proof).map(|_| proof)
}