Skip to content

Commit

Permalink
Merge pull request #765 from rndquu/refactor/rmv-mock-incentive
Browse files Browse the repository at this point in the history
refactor: remove `MockIncentive`
  • Loading branch information
0x4007 authored Aug 17, 2023
2 parents 5db0d8e + e445b85 commit d47ba67
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 30 deletions.
21 changes: 0 additions & 21 deletions packages/contracts/src/dollar/mocks/MockIncentive.sol

This file was deleted.

4 changes: 0 additions & 4 deletions packages/contracts/test/diamond/DiamondTestSetup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {DollarMintExcessFacet} from "../../src/dollar/facets/DollarMintExcessFac
import {Diamond, DiamondArgs} from "../../src/dollar/Diamond.sol";
import {DiamondInit} from "../../src/dollar/upgradeInitializers/DiamondInit.sol";
import {DiamondTestHelper} from "../helpers/DiamondTestHelper.sol";
import {MockIncentive} from "../../src/dollar/mocks/MockIncentive.sol";
import {UbiquityDollarToken} from "../../src/dollar/core/UbiquityDollarToken.sol";
import {ERC1155Ubiquity} from "../../src/dollar/core/ERC1155Ubiquity.sol";
import {StakingShare} from "../../src/dollar/core/StakingShare.sol";
Expand Down Expand Up @@ -89,8 +88,6 @@ abstract contract DiamondSetup is DiamondTestHelper {
// adding governance token
UbiquityGovernanceToken IGovToken;

address incentive_addr;

string[] facetNames;
address[] facetAddressList;

Expand Down Expand Up @@ -124,7 +121,6 @@ abstract contract DiamondSetup is DiamondTestHelper {

// deploys diamond and connects facets
function setUp() public virtual {
incentive_addr = address(new MockIncentive());
owner = generateAddress("Owner", false, 10 ether);
admin = generateAddress("Admin", false, 10 ether);
tokenManager = generateAddress("TokenManager", false, 10 ether);
Expand Down
19 changes: 14 additions & 5 deletions packages/contracts/test/dollar/core/UbiquityDollarToken.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,21 @@
pragma solidity ^0.8.19;

import {UbiquityDollarToken} from "../../../src/dollar/core/UbiquityDollarToken.sol";
import {MockIncentive} from "../../../src/dollar/mocks/MockIncentive.sol";
import {IIncentive} from "../../../src/dollar/interfaces/IIncentive.sol";

import "../../helpers/LocalTestHelper.sol";

contract Incentive is IIncentive {
function incentivize(
address sender,
address recipient,
address operator,
uint256 amount
) public {}
}

contract UbiquityDollarTokenTest is LocalTestHelper {
// address incentive_addr;
address incentive_addr;
address dollar_addr;
address dollar_manager_address;

Expand All @@ -21,7 +30,7 @@ contract UbiquityDollarTokenTest is LocalTestHelper {
);

function setUp() public override {
incentive_addr = address(new MockIncentive());
incentive_addr = address(new Incentive());
super.setUp();
vm.startPrank(admin);
dollar_addr = address(IDollar);
Expand Down Expand Up @@ -76,7 +85,7 @@ contract UbiquityDollarTokenTest is LocalTestHelper {
vm.expectCall(
incentive_addr,
abi.encodeWithSelector(
MockIncentive.incentivize.selector,
Incentive.incentivize.selector,
mock_sender,
userB,
mock_sender,
Expand All @@ -89,7 +98,7 @@ contract UbiquityDollarTokenTest is LocalTestHelper {
vm.expectCall(
incentive_addr,
abi.encodeWithSelector(
MockIncentive.incentivize.selector,
Incentive.incentivize.selector,
userA,
mock_recipient,
userA,
Expand Down

1 comment on commit d47ba67

@ubiquibot
Copy link

@ubiquibot ubiquibot bot commented on d47ba67 Aug 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.