From f5facdf5eb98368449c0092fe201940dd73c3067 Mon Sep 17 00:00:00 2001 From: Redouane Lakrache Date: Wed, 25 May 2022 15:48:26 +0200 Subject: [PATCH] Revert "bonding: remove duplicate IBondingManager interface" This reverts commit 58c1e204409c30715642462aef92a51d1e82ead9. --- contracts/bonding/BondingManager.sol | 2 +- contracts/{interfaces => bonding}/IBondingManager.sol | 2 -- contracts/pm/mixins/interfaces/MContractRegistry.sol | 2 +- contracts/polling/PollCreator.sol | 7 ++++++- contracts/rounds/RoundsManager.sol | 2 +- contracts/token/Minter.sol | 2 +- test/unit/PollCreator.js | 2 +- 7 files changed, 11 insertions(+), 8 deletions(-) rename contracts/{interfaces => bonding}/IBondingManager.sol (97%) diff --git a/contracts/bonding/BondingManager.sol b/contracts/bonding/BondingManager.sol index dcd891af..0dee4e07 100644 --- a/contracts/bonding/BondingManager.sol +++ b/contracts/bonding/BondingManager.sol @@ -2,7 +2,7 @@ pragma solidity 0.8.9; import "../ManagerProxyTarget.sol"; -import "../interfaces/IBondingManager.sol"; +import "./IBondingManager.sol"; import "../libraries/SortedDoublyLL.sol"; import "../libraries/MathUtils.sol"; import "../libraries/PreciseMathUtils.sol"; diff --git a/contracts/interfaces/IBondingManager.sol b/contracts/bonding/IBondingManager.sol similarity index 97% rename from contracts/interfaces/IBondingManager.sol rename to contracts/bonding/IBondingManager.sol index c9fb51a7..3981e236 100644 --- a/contracts/interfaces/IBondingManager.sol +++ b/contracts/bonding/IBondingManager.sol @@ -78,6 +78,4 @@ interface IBondingManager { function isActiveTranscoder(address _transcoder) external view returns (bool); function getTotalBonded() external view returns (uint256); - - function pendingStake(address _addr, uint256 _endRound) external view returns (uint256); } diff --git a/contracts/pm/mixins/interfaces/MContractRegistry.sol b/contracts/pm/mixins/interfaces/MContractRegistry.sol index 9e9b1bc9..7dff65dc 100644 --- a/contracts/pm/mixins/interfaces/MContractRegistry.sol +++ b/contracts/pm/mixins/interfaces/MContractRegistry.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity 0.8.9; -import "../../../interfaces/IBondingManager.sol"; +import "../../../bonding/IBondingManager.sol"; import "../../../token/IMinter.sol"; import "../../../rounds/IRoundsManager.sol"; diff --git a/contracts/polling/PollCreator.sol b/contracts/polling/PollCreator.sol index 9fcc0df6..3b478b9e 100644 --- a/contracts/polling/PollCreator.sol +++ b/contracts/polling/PollCreator.sol @@ -2,7 +2,12 @@ pragma solidity 0.8.9; import "./Poll.sol"; -import "../interfaces/IBondingManager.sol"; + +interface IBondingManager { + function transcoderTotalStake(address _addr) external view returns (uint256); + + function pendingStake(address _addr, uint256 _endRound) external view returns (uint256); +} contract PollCreator { // 33.33% diff --git a/contracts/rounds/RoundsManager.sol b/contracts/rounds/RoundsManager.sol index 284a2d53..1bc8b8be 100644 --- a/contracts/rounds/RoundsManager.sol +++ b/contracts/rounds/RoundsManager.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.9; import "../ManagerProxyTarget.sol"; import "./IRoundsManager.sol"; -import "../interfaces/IBondingManager.sol"; +import "../bonding/IBondingManager.sol"; import "../token/IMinter.sol"; import "../libraries/MathUtils.sol"; diff --git a/contracts/token/Minter.sol b/contracts/token/Minter.sol index be3a4505..ce86354a 100644 --- a/contracts/token/Minter.sol +++ b/contracts/token/Minter.sol @@ -5,7 +5,7 @@ import "../Manager.sol"; import "./IMinter.sol"; import "./ILivepeerToken.sol"; import "../rounds/IRoundsManager.sol"; -import "../interfaces/IBondingManager.sol"; +import "../bonding/IBondingManager.sol"; import "../libraries/MathUtilsV2.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; diff --git a/test/unit/PollCreator.js b/test/unit/PollCreator.js index be9a9356..4b3c0a16 100644 --- a/test/unit/PollCreator.js +++ b/test/unit/PollCreator.js @@ -25,7 +25,7 @@ describe("PollCreator", () => { fixture = new Fixture(web3) bondingManagerMock = await smock.fake( - "contracts/interfaces/IBondingManager.sol:IBondingManager", + "contracts/polling/PollCreator.sol:IBondingManager", { address: mockBondingManagerEOA.address }