-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fallbacks tests and improve coverage
- Loading branch information
1 parent
84b0b4e
commit 2b76630
Showing
2 changed files
with
83 additions
and
2 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
contracts/mocks/account/modules/ERC7579FallbackHandlerMock.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8.20; | ||
|
||
import {ERC2771Context} from "@openzeppelin/contracts/metatx/ERC2771Context.sol"; | ||
import {ERC7579ModuleMock} from "./ERC7579ModuleMock.sol"; | ||
import {MODULE_TYPE_FALLBACK} from "@openzeppelin/contracts/interfaces/draft-IERC7579.sol"; | ||
|
||
abstract contract ERC7579FallbackHandlerMock is ERC2771Context, ERC7579ModuleMock(MODULE_TYPE_FALLBACK) { | ||
event ERC7579FallbackHandlerMockCalled(address sender, uint256 value, bytes data); | ||
|
||
error ERC7579FallbackHandlerMockRevert(); | ||
|
||
function callRevert() public pure { | ||
revert ERC7579FallbackHandlerMockRevert(); | ||
} | ||
|
||
function _fallback() internal { | ||
emit ERC7579FallbackHandlerMockCalled(_msgSender(), msg.value, _msgData()); | ||
} | ||
|
||
fallback() external payable { | ||
_fallback(); | ||
} | ||
|
||
receive() external payable { | ||
_fallback(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters