nodeset-org / constellation

GNU General Public License v3.0
5 stars 0 forks source link

[Tests] Unit Test Merkle Claim #331

Closed teddy-nodeset closed 1 month ago

VVander commented 1 month ago

lgtm but we need to understand why RP is allowing claims of 0 value. It should revert afaik, so maybe it's a mocking problem?

teddy-nodeset commented 1 month ago

lgtm but we need to understand why RP is allowing claims of 0 value. It should revert afaik, so maybe it's a mocking problem?

This is the reason:

    function _claim(
        uint256[] calldata _rewardIndex,
        address _nodeAddress,
        uint256[] calldata _amountRPL,
        uint256[] calldata _amountETH,
        bytes32[][] calldata _merkleProof
    ) internal {
        if (isMocking) return;

this function returns and does no validation like it normally would

VVander commented 1 month ago

@huy-nodeset need to comment in the tests that I pointed out that we have wrong behavior due to mocks