Skip to content

Commit

Permalink
remove supportsInterface mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
simplemachine92 committed Jan 7, 2025
1 parent 20079a2 commit 2012140
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 36 deletions.
10 changes: 2 additions & 8 deletions test/units/static/JBMultiTerminal/TestAccountingContextsOf.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pragma solidity 0.8.23;
import /* {*} from */ "../../../helpers/TestBaseWorkflow.sol";
import {JBMultiTerminalSetup} from "./JBMultiTerminalSetup.sol";

contract TestAccountingContextsFor_Local is JBMultiTerminalSetup {
contract TestAccountingContextsOf_Local is JBMultiTerminalSetup {
uint256 _projectId = 1;
address _usdc = makeAddr("USDC");
uint256 _usdcCurrency = uint32(uint160(_usdc));
Expand All @@ -29,8 +29,6 @@ contract TestAccountingContextsFor_Local is JBMultiTerminalSetup {
// mock call to tokens decimals()
mockExpect(_usdc, abi.encodeCall(IERC20Metadata.decimals, ()), abi.encode(6));

// mock call to rulesets currentOf returning 0 to bypass ruleset checking

// setup: return data
JBRuleset memory ruleset = JBRuleset({
cycleNumber: 1,
Expand All @@ -44,13 +42,9 @@ contract TestAccountingContextsFor_Local is JBMultiTerminalSetup {
metadata: 0
});

// mock call to rulesets currentOf returning 0 to bypass ruleset checking
mockExpect(address(rulesets), abi.encodeCall(IJBRulesets.currentOf, (_projectId)), abi.encode(ruleset));

// mock supports interface call
mockExpect(
_usdc, abi.encodeCall(IERC165.supportsInterface, (type(IERC20Metadata).interfaceId)), abi.encode(true)
);

// call params
JBAccountingContext[] memory _tokens = new JBAccountingContext[](1);
_tokens[0] = JBAccountingContext({token: _usdc, decimals: 6, currency: uint32(uint160(_usdc))});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ contract TestAddAccountingContextsFor_Local is JBMultiTerminalSetup {
// mock call to tokens decimals()
mockExpect(_usdc, abi.encodeCall(IERC20Metadata.decimals, ()), abi.encode(6));

// mock call to rulesets currentOf returning 0 to bypass ruleset checking

// setup: return data
JBRuleset memory ruleset = JBRuleset({
cycleNumber: 1,
Expand All @@ -94,13 +92,9 @@ contract TestAddAccountingContextsFor_Local is JBMultiTerminalSetup {
metadata: 0
});

// mock call to rulesets currentOf returning 0 to bypass ruleset checking
mockExpect(address(rulesets), abi.encodeCall(IJBRulesets.currentOf, (_projectId)), abi.encode(ruleset));

// mock supports interface call
mockExpect(
_usdc, abi.encodeCall(IERC165.supportsInterface, (type(IERC20Metadata).interfaceId)), abi.encode(true)
);

// call params
JBAccountingContext[] memory _tokens = new JBAccountingContext[](1);
_tokens[0] = JBAccountingContext({token: _usdc, decimals: 6, currency: uint32(uint160(_usdc))});
Expand Down Expand Up @@ -284,13 +278,6 @@ contract TestAddAccountingContextsFor_Local is JBMultiTerminalSetup {
// mock rulesets call
mockExpect(address(rulesets), abi.encodeCall(IJBRulesets.currentOf, (_projectId)), abi.encode(ruleset));

// mock token interface support call
mockExpect(
address(someToken),
abi.encodeCall(IERC165.supportsInterface, (type(IERC20Metadata).interfaceId)),
abi.encode(true)
);

// mock token call
mockExpect(address(someToken), abi.encodeCall(IERC20Metadata.decimals, ()), abi.encode(18));

Expand Down Expand Up @@ -323,13 +310,6 @@ contract TestAddAccountingContextsFor_Local is JBMultiTerminalSetup {
// mock rulesets call
mockExpect(address(rulesets), abi.encodeCall(IJBRulesets.currentOf, (_projectId)), abi.encode(ruleset));

// mock token interface support call
mockExpect(
address(someToken),
abi.encodeCall(IERC165.supportsInterface, (type(IERC20Metadata).interfaceId)),
abi.encode(true)
);

// mock token call
mockExpect(address(someToken), abi.encodeCall(IERC20Metadata.decimals, ()), abi.encode(18));

Expand Down
7 changes: 0 additions & 7 deletions test/units/static/JBMultiTerminal/TestPay.sol
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,6 @@ contract TestPay_Local is JBMultiTerminalSetup {
address(directory), abi.encodeCall(IJBDirectory.controllerOf, (_projectId)), abi.encode(address(this))
);

// mock supports interface call
mockExpect(
address(_mockToken),
abi.encodeCall(IERC165.supportsInterface, (type(IERC20Metadata).interfaceId)),
abi.encode(true)
);

// mock call to token decimals
mockExpect(address(_mockToken), abi.encodeCall(IERC20Metadata.decimals, ()), abi.encode(6));

Expand Down

0 comments on commit 2012140

Please sign in to comment.