Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
resolves mergify merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
behzadnouri committed Mar 6, 2023
1 parent 7add127 commit 8bbb543
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
10 changes: 1 addition & 9 deletions ledger/src/shred.rs
Original file line number Diff line number Diff line change
Expand Up @@ -659,22 +659,14 @@ pub mod layout {
match get_shred_variant(shred).ok()? {
ShredVariant::LegacyCode | ShredVariant::LegacyData => {
let offsets = self::legacy::SIGNED_MESSAGE_OFFSETS;
(offsets.end <= shred.len()).then_some(offsets)
(offsets.end <= shred.len()).then(|| offsets)
}
<<<<<<< HEAD
ShredVariant::MerkleData(proof_size) => {
merkle::ShredData::get_signed_data_offsets(proof_size)?
}
};
(offsets.end <= shred.len()).then(|| offsets)
=======
// Merkle shreds sign merkle tree root which can be recovered from
// the merkle proof embedded in the payload but itself is not
// stored the payload.
ShredVariant::MerkleCode(_) => None,
ShredVariant::MerkleData(_) => None,
}
>>>>>>> cf0a149ad (removes the merkle root from shreds binary (#29427))
}

pub(crate) fn get_reference_tick(shred: &[u8]) -> Result<u8, Error> {
Expand Down
6 changes: 2 additions & 4 deletions ledger/src/shred/merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,9 +560,7 @@ where
};
(index >> 1, parent)
});
(index == 0)
.then_some(root)
.ok_or(Error::InvalidMerkleProof)
(index == 0).then(|| root).ok_or(Error::InvalidMerkleProof)
}

fn get_merkle_proof(
Expand Down Expand Up @@ -619,7 +617,7 @@ fn make_merkle_proof(
size = (size + 1) >> 1;
index >>= 1;
}
(offset + 1 == tree.len()).then_some(proof)
(offset + 1 == tree.len()).then(|| proof)
}

pub(super) fn recover(
Expand Down

0 comments on commit 8bbb543

Please sign in to comment.