Skip to content

Commit

Permalink
Merge pull request #226 from VenusProtocol/remove-unnecessary-scenarios
Browse files Browse the repository at this point in the history
refactor: remove unnecessary scenarios
  • Loading branch information
coreyar authored Sep 19, 2024
2 parents 7bdc00a + e1c96ae commit e5612b7
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 23 deletions.
6 changes: 0 additions & 6 deletions contracts/test/AccessControlManager.sol

This file was deleted.

7 changes: 0 additions & 7 deletions contracts/test/VAI.sol

This file was deleted.

8 changes: 4 additions & 4 deletions deploy/1-deploy-oracles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ const func: DeployFunction = async function ({

let accessControlManager;
if (!network.live) {
await deploy("AccessControlManagerScenario", {
await deploy("AccessControlManager", {
from: deployer,
args: [],
log: true,
autoMine: true,
});

accessControlManager = await hre.ethers.getContract("AccessControlManagerScenario");
accessControlManager = await hre.ethers.getContract("AccessControlManager");
}

let vai;
if (!network.live) {
await deploy("VAIScenario", {
await deploy("VAI", {
from: deployer,
log: true,
autoMine: true,
args: [await getChainId()],
});

vai = await hre.ethers.getContract("VAIScenario");
vai = await hre.ethers.getContract("VAI");
}
const accessControlManagerAddress = network.live ? ADDRESSES[network.name].acm : accessControlManager?.address;
const proxyOwnerAddress = network.live ? ADDRESSES[network.name].timelock : deployer;
Expand Down
10 changes: 10 additions & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,16 @@ const config: HardhatUserConfig = {
pages: "files",
templates: "./docgen-templates",
},
external: {
contracts: [
{
artifacts: "node_modules/@venusprotocol/venus-protocol/artifacts",
},
{
artifacts: "node_modules/@venusprotocol/governance-contracts/artifacts",
},
],
},
};

export default config;
2 changes: 1 addition & 1 deletion test/BinanceOracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe("Binance Oracle unit tests", () => {
sidRegistry.resolver.returns(publicResolver.address);
publicResolver.addr.returns(this.mockBinanceFeedRegistry.address);

const fakeAccessControlManager = await smock.fake<AccessControlManager>("AccessControlManagerScenario");
const fakeAccessControlManager = await smock.fake<AccessControlManager>("AccessControlManager");
fakeAccessControlManager.isAllowedToCall.returns(true);
this.fakeAccessControlManager = fakeAccessControlManager;

Expand Down
2 changes: 1 addition & 1 deletion test/BoundValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const EXP_SCALE = BigNumber.from(10).pow(18);
const getBoundValidator = async (account: SignerWithAddress) => {
const boundValidator = await ethers.getContractFactory("BoundValidator", account);

const fakeAccessControlManager = await smock.fake<AccessControlManager>("AccessControlManagerScenario");
const fakeAccessControlManager = await smock.fake<AccessControlManager>("AccessControlManager");
fakeAccessControlManager.isAllowedToCall.returns(true);

return <BoundValidator>await upgrades.deployProxy(boundValidator, [fakeAccessControlManager.address], {
Expand Down
2 changes: 1 addition & 1 deletion test/ChainlinkOracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe("Oracle unit tests", () => {
this.daiFeed = await makeChainlinkOracle(8, 100000000);

const chainlinkOracle = await ethers.getContractFactory("ChainlinkOracle", admin);
const fakeAccessControlManager = await smock.fake<AccessControlManager>("AccessControlManagerScenario");
const fakeAccessControlManager = await smock.fake<AccessControlManager>("AccessControlManager");
fakeAccessControlManager.isAllowedToCall.returns(true);

const instance = <ChainlinkOracle>await upgrades.deployProxy(chainlinkOracle, [fakeAccessControlManager.address], {
Expand Down
2 changes: 1 addition & 1 deletion test/PivotPythOracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const getPythOracle = deployments.createFixture(async ({ getNamedAccounts }) =>
});

const pythOracle = await ethers.getContractFactory("PythOracle", deployer);
const fakeAccessControlManager = await smock.fake<AccessControlManager>("AccessControlManagerScenario");
const fakeAccessControlManager = await smock.fake<AccessControlManager>("AccessControlManager");
fakeAccessControlManager.isAllowedToCall.returns(true);

const instance = <PythOracle>await upgrades.deployProxy(
Expand Down
2 changes: 1 addition & 1 deletion test/ResilientOracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("Oracle plugin frame unit tests", () => {
});

beforeEach(async function () {
const fakeAccessControlManager = await smock.fake<AccessControlManager>("AccessControlManagerScenario");
const fakeAccessControlManager = await smock.fake<AccessControlManager>("AccessControlManager");
fakeAccessControlManager.isAllowedToCall.returns(true);

const resilientOracle = await ethers.getContractFactory("ResilientOracle", this.admin);
Expand Down
2 changes: 1 addition & 1 deletion test/SFrxETHOracle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe("SFrxETHOracle unit tests", () => {

SFrxETHOracleFactory = await ethers.getContractFactory("SFrxETHOracle");

fakeAccessControlManager = await smock.fake<AccessControlManager>("AccessControlManagerScenario");
fakeAccessControlManager = await smock.fake<AccessControlManager>("AccessControlManager");
fakeAccessControlManager.isAllowedToCall.returns(true);
});

Expand Down

0 comments on commit e5612b7

Please sign in to comment.