Skip to content

Commit

Permalink
fix: merkleize typo
Browse files Browse the repository at this point in the history
  • Loading branch information
call-by committed Jul 22, 2024
1 parent 59a2350 commit 113c4cb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/core/ExoCapsule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ contract ExoCapsule is ReentrancyGuardUpgradeable, ExoCapsuleStorage, IExoCapsul
view
{
bytes32 beaconBlockRoot = getBeaconBlockRoot(proof.beaconBlockTimestamp);
bytes32 validatorContainerRoot = validatorContainer.merklelizeValidatorContainer();
bytes32 validatorContainerRoot = validatorContainer.merkleizeValidatorContainer();
bool valid = validatorContainerRoot.isValidValidatorContainerRoot(
proof.validatorContainerRootProof,
proof.validatorIndex,
Expand All @@ -285,7 +285,7 @@ contract ExoCapsule is ReentrancyGuardUpgradeable, ExoCapsuleStorage, IExoCapsul
BeaconChainProofs.WithdrawalProof calldata proof
) internal view {
// To-do check withdrawalContainer length is valid
bytes32 withdrawalContainerRoot = withdrawalContainer.merklelizeWithdrawalContainer();
bytes32 withdrawalContainerRoot = withdrawalContainer.merkleizeWithdrawalContainer();
bool valid = withdrawalContainerRoot.isValidWithdrawalContainerRoot(proof);
if (!valid) {
revert InvalidWithdrawalContainer(withdrawalContainer.getValidatorIndex());
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/ValidatorContainer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ library ValidatorContainer {
return validatorContainer[7].fromLittleEndianUint64();
}

function merklelizeValidatorContainer(bytes32[] calldata validatorContainer) internal pure returns (bytes32) {
function merkleizeValidatorContainer(bytes32[] calldata validatorContainer) internal pure returns (bytes32) {
bytes32[] memory leaves = validatorContainer;
for (uint256 i; i < MERKLE_TREE_HEIGHT; i++) {
bytes32[] memory roots = new bytes32[](leaves.length / 2);
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/WithdrawalContainer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ library WithdrawalContainer {
return withdrawalContainer[3].fromLittleEndianUint64();
}

function merklelizeWithdrawalContainer(bytes32[] calldata withdrawalContainer) internal pure returns (bytes32) {
function merkleizeWithdrawalContainer(bytes32[] calldata withdrawalContainer) internal pure returns (bytes32) {
bytes32[] memory leaves = withdrawalContainer;
for (uint256 i; i < MERKLE_TREE_HEIGHT; i++) {
bytes32[] memory roots = new bytes32[](leaves.length / 2);
Expand Down

0 comments on commit 113c4cb

Please sign in to comment.