diff --git a/ledger/src/shred.rs b/ledger/src/shred.rs index 96b53e200a4804..2b6f6f136784c2 100644 --- a/ledger/src/shred.rs +++ b/ledger/src/shred.rs @@ -310,6 +310,7 @@ impl ErasureSetId { macro_rules! dispatch { ($vis:vis fn $name:ident(&self $(, $arg:ident : $ty:ty)?) $(-> $out:ty)?) => { #[inline] + #[allow(dead_code)] $vis fn $name(&self $(, $arg:$ty)?) $(-> $out)? { match self { Self::ShredCode(shred) => shred.$name($($arg, )?), @@ -334,16 +335,6 @@ macro_rules! dispatch { Self::ShredData(shred) => shred.$name($($arg, )?), } } - }; - (allow_dead $vis:vis fn $name:ident(&self $(, $arg:ident : $ty:ty)?) $(-> $out:ty)?) => { - #[allow(dead_code)] - #[inline] - $vis fn $name(&self $(, $arg:$ty)?) $(-> $out)? { - match self { - Self::ShredCode(shred) => shred.$name($($arg, )?), - Self::ShredData(shred) => shred.$name($($arg, )?), - } - } } } @@ -354,7 +345,7 @@ impl Shred { dispatch!(fn set_signature(&mut self, signature: Signature)); dispatch!(fn signed_data(&self) -> Result); - dispatch!(allow_dead pub(crate) fn chained_merkle_root(&self) -> Result); + dispatch!(pub(crate) fn chained_merkle_root(&self) -> Result); // Returns the portion of the shred's payload which is erasure coded. dispatch!(pub(crate) fn erasure_shard(self) -> Result, Error>); // Like Shred::erasure_shard but returning a slice. @@ -751,7 +742,16 @@ pub mod layout { chained: true, resigned, } => merkle::ShredData::get_chained_merkle_root_offset(proof_size, resigned).ok(), - _ => None, + ShredVariant::MerkleCode { + proof_size: _, + chained: false, + resigned: _, + } => None, + ShredVariant::MerkleData { + proof_size: _, + chained: false, + resigned: _, + } => None, }?; shred .get(offset..offset + SIZE_OF_MERKLE_ROOT) diff --git a/ledger/src/shred/merkle.rs b/ledger/src/shred/merkle.rs index c8da794a5cb1ef..a7cc134824cf31 100644 --- a/ledger/src/shred/merkle.rs +++ b/ledger/src/shred/merkle.rs @@ -193,7 +193,7 @@ impl ShredData { Self::get_chained_merkle_root_offset(proof_size, resigned) } - pub(crate) fn get_chained_merkle_root_offset( + pub(super) fn get_chained_merkle_root_offset( proof_size: u8, resigned: bool, ) -> Result { @@ -379,7 +379,7 @@ impl ShredCode { Self::get_chained_merkle_root_offset(proof_size, resigned) } - pub(crate) fn get_chained_merkle_root_offset( + pub(super) fn get_chained_merkle_root_offset( proof_size: u8, resigned: bool, ) -> Result {