-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
155 additions
and
126 deletions.
There are no files selected for viewing
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
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
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
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
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
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 |
---|---|---|
@@ -1,48 +1,41 @@ | ||
// SPDX-License-Identifier: APACHE | ||
pragma solidity ^0.8.0; | ||
|
||
import { | ||
IERC20, IQWComponent, IQWManager, IQWRegistry, Ownable, QWManager, QWRegistry | ||
} from '../../src/contracts/QWManager.sol'; | ||
import {IERC20, IQWComponent, IQWManager, IQWRegistry, Ownable, QWManager, QWRegistry} from '../../src/contracts/QWManager.sol'; | ||
import {Test} from 'forge-std/Test.sol'; | ||
|
||
contract MockQWManager is QWManager, Test { | ||
constructor() QWManager() {} | ||
constructor() QWManager() {} | ||
|
||
function mock_call_execute( | ||
address[] memory _targetQwChild, | ||
bytes[] memory _callData, | ||
address _tokenAddress, | ||
uint256 _amount | ||
) public { | ||
vm.mockCall( | ||
address(this), | ||
abi.encodeWithSignature( | ||
'execute(address[],bytes[],address,uint256)', _targetQwChild, _callData, _tokenAddress, _amount | ||
), | ||
abi.encode() | ||
); | ||
} | ||
function mock_call_open(OpenBatch[] memory batches) public { | ||
vm.mockCall( | ||
address(this), | ||
abi.encodeWithSignature('open((address,uint256)[])', batches), | ||
abi.encode() | ||
); | ||
} | ||
|
||
function mock_call_close(address[] memory _targetQwChild, bytes[] memory _callData) public { | ||
vm.mockCall( | ||
address(this), abi.encodeWithSignature('close(address[],bytes[])', _targetQwChild, _callData), abi.encode() | ||
); | ||
} | ||
function mock_call_close(CloseBatch[] memory batches) public { | ||
vm.mockCall( | ||
address(this), | ||
abi.encodeWithSignature('close((address,uint256)[])', batches), | ||
abi.encode() | ||
); | ||
} | ||
|
||
function mock_call_withdraw(address user, address _tokenAddress, uint256 _amount) public { | ||
vm.mockCall( | ||
address(this), | ||
abi.encodeWithSignature('withdraw(address,address,uint256)', user, _tokenAddress, _amount), | ||
abi.encode() | ||
); | ||
} | ||
function mock_call_withdraw(address user, address _tokenAddress, uint256 _amount) public { | ||
vm.mockCall( | ||
address(this), | ||
abi.encodeWithSignature('withdraw(address,address,uint256)', user, _tokenAddress, _amount), | ||
abi.encode() | ||
); | ||
} | ||
|
||
function mock_call_receiveFunds(address user, address _tokenAddress, uint256 _amount) public { | ||
vm.mockCall( | ||
address(this), | ||
abi.encodeWithSignature('receiveFunds(address,address,uint256)', user, _tokenAddress, _amount), | ||
abi.encode() | ||
); | ||
} | ||
function mock_call_receiveFunds(address user, address _tokenAddress, uint256 _amount) public { | ||
vm.mockCall( | ||
address(this), | ||
abi.encodeWithSignature('receiveFunds(address,address,uint256)', user, _tokenAddress, _amount), | ||
abi.encode() | ||
); | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.