The home for Hyperlane core contracts, sdk packages, and other infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hyperlane-monorepo/solidity/contracts/test/TestMerkle.sol

31 lines
754 B

// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.8.0;
import "../MerkleTreeManager.sol";
contract TestMerkle is MerkleTreeManager {
using MerkleLib for MerkleLib.Tree;
// solhint-disable-next-line no-empty-blocks
constructor() MerkleTreeManager() {}
function insert(bytes32 _node) external {
tree.insert(_node);
}
function branchRoot(
bytes32 _leaf,
bytes32[32] calldata _proof,
uint256 _index
) external pure returns (bytes32 _node) {
return MerkleLib.branchRoot(_leaf, _proof, _index);
}
/**
* @notice Returns the number of inserted leaves in the tree
*/
function count() public view returns (uint256) {
return tree.count;
}
}