Skip to content

Commit

Permalink
Fix lint warnings 2
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega committed Jun 21, 2022
1 parent 9f8af95 commit 6f41c80
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions pallas-traverse/src/header.rs
Expand Up @@ -2,8 +2,8 @@ use pallas_codec::minicbor;
use pallas_crypto::hash::{Hash, Hasher};
use pallas_primitives::ToHash;

use crate::{Error, MultiEraHeader};
use crate::Era::Byron;
use crate::{Error, MultiEraHeader};

impl<'b> MultiEraHeader<'b> {
pub fn decode(tag: u8, subtag: Option<u8>, cbor: &'b [u8]) -> Result<Self, Error> {
Expand Down Expand Up @@ -50,9 +50,7 @@ impl<'b> MultiEraHeader<'b> {
pub fn leader_vrf_output(&self) -> Result<Vec<u8>, Error> {
match self {
MultiEraHeader::EpochBoundary(_) => Err(Error::InvalidEra(Byron)),
MultiEraHeader::AlonzoCompatible(x) => {
Ok(x.header_body.leader_vrf.0.to_vec())
}
MultiEraHeader::AlonzoCompatible(x) => Ok(x.header_body.leader_vrf.0.to_vec()),
MultiEraHeader::Babbage(x) => {
let mut leader_tagged_vrf: Vec<u8> = vec![0x4C_u8]; /* "L" */
leader_tagged_vrf.extend(&*x.header_body.vrf_result.0);
Expand All @@ -65,9 +63,7 @@ impl<'b> MultiEraHeader<'b> {
pub fn nonce_vrf_output(&self) -> Result<Vec<u8>, Error> {
match self {
MultiEraHeader::EpochBoundary(_) => Err(Error::InvalidEra(Byron)),
MultiEraHeader::AlonzoCompatible(x) => {
Ok(x.header_body.nonce_vrf.0.to_vec())
}
MultiEraHeader::AlonzoCompatible(x) => Ok(x.header_body.nonce_vrf.0.to_vec()),
MultiEraHeader::Babbage(x) => {
let mut nonce_tagged_vrf: Vec<u8> = vec![0x4E_u8]; /* "N" */
nonce_tagged_vrf.extend(&*x.header_body.vrf_result.0);
Expand All @@ -76,4 +72,4 @@ impl<'b> MultiEraHeader<'b> {
MultiEraHeader::Byron(_) => Err(Error::InvalidEra(Byron)),
}
}
}
}

0 comments on commit 6f41c80

Please sign in to comment.