Skip to content

Commit

Permalink
Add more descriptive error for merkle verification errors
Browse files Browse the repository at this point in the history
  • Loading branch information
crispymangoes committed Apr 4, 2024
1 parent 224613e commit d7a883f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/base/Roles/ManagerWithMerkleVerification.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ contract ManagerWithMerkleVerification is Auth {
error ManagerWithMerkleVerification__FlashLoanNotExecuted();
error ManagerWithMerkleVerification__FlashLoanNotInProgress();
error ManagerWithMerkleVerification__BadFlashLoanIntentHash();
error ManagerWithMerkleVerification__FailedToVerifyManageProof();
error ManagerWithMerkleVerification__FailedToVerifyManageProof(address target, bytes targetData, uint256 value);
error ManagerWithMerkleVerification__Paused();

//============================== EVENTS ===============================
Expand Down Expand Up @@ -240,7 +240,7 @@ contract ManagerWithMerkleVerification is Auth {
packedArgumentAddresses
)
) {
revert ManagerWithMerkleVerification__FailedToVerifyManageProof();
revert ManagerWithMerkleVerification__FailedToVerifyManageProof(target, targetData, value);
}
}

Expand Down
5 changes: 4 additions & 1 deletion test/ManagerWithMerkleVerification.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1524,7 +1524,10 @@ contract ManagerWithMerkleVerificationTest is Test, MainnetAddresses {

vm.expectRevert(
abi.encodeWithSelector(
ManagerWithMerkleVerification.ManagerWithMerkleVerification__FailedToVerifyManageProof.selector
ManagerWithMerkleVerification.ManagerWithMerkleVerification__FailedToVerifyManageProof.selector,
targets[0],
targetData[0],
values[0]
)
);
manager.manageVaultWithMerkleVerification(manageProofs, decodersAndSanitizers, targets, targetData, values);
Expand Down

0 comments on commit d7a883f

Please sign in to comment.