Skip to content

Commit

Permalink
feat: add label in userOp revert
Browse files Browse the repository at this point in the history
  • Loading branch information
kopy-kat committed Aug 23, 2024
1 parent a945dac commit d9930b9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/test/utils/ERC4337Helpers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ library ERC4337Helpers {
using Simulator for PackedUserOperation;

error UserOperationReverted(
bytes32 userOpHash, address sender, uint256 nonce, bytes revertReason
bytes32 userOpHash, address sender, string senderLabel, uint256 nonce, bytes revertReason
);
error InvalidRevertMessage(bytes4 expected, bytes4 reason);
error InvalidRevertMessageBytes(bytes expected, bytes reason);
Expand Down Expand Up @@ -76,8 +76,9 @@ library ERC4337Helpers {
bytes32 userOpHash = logs[i].topics[1];
if (isExpectRevert == 0) {
bytes memory revertReason = getUserOpRevertReason(logs, userOpHash);
address account = address(bytes20(logs[i].topics[2]));
revert UserOperationReverted(
userOpHash, address(bytes20(logs[i].topics[2])), nonce, revertReason
userOpHash, account, getLabel(account), nonce, revertReason
);
} else {
if (isExpectRevert == 2) {
Expand Down

0 comments on commit d9930b9

Please sign in to comment.