Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove unnecessary scenarios #226

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading