Skip to content

Commit

Permalink
chore:
Browse files Browse the repository at this point in the history
- added test for WhitelistingManager contract
- downgraded chai js version (chaijs/chai#1561)
- downgraded @types/js-yalm version to 4.5.0 to allow commonjs typescript config compatibility
  • Loading branch information
mrsalitre committed Sep 17, 2024
1 parent 870705f commit 3f94c73
Show file tree
Hide file tree
Showing 4 changed files with 8,930 additions and 42 deletions.
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@
"@openzeppelin/contracts-upgradeable": "^5.0.2",
"@openzeppelin/hardhat-upgrades": "^3.2.0",
"@types/chai": "^4.3.11",
"@types/js-yaml": "^4.0.9",
"@types/mocha": "^10.0.6",
"@types/node": "^20.11.19",
"@types/react-color": "^3.0.5",
"chai": "^5.1.0",
"chai": "4.5.0",
"env-cmd": "^10.1.0",
"eth-gas-reporter": "^0.2.27",
"ethereum-waffle": "^4.0.10",
Expand All @@ -70,16 +71,16 @@
"hardhat-contract-sizer": "^2.10.0",
"hardhat-gas-reporter": "^1.0.10",
"husky": "^9.0.11",
"ts-node": "^10.9.2",
"typescript": "^5.3.3",
"js-yaml": "^4.1.0",
"@types/js-yaml": "^4.1.0"
"ts-node": "^10.9.2",
"typescript": "^5.3.3"
},
"dependencies": {
"@graphprotocol/graph-cli": "^0.68.0",
"@graphprotocol/graph-ts": "^0.32.0",
"@nomicfoundation/hardhat-network-helpers": "^1.0.11",
"@openzeppelin/contracts": "^5.0.2",
"@remix-project/remixd": "^0.6.33",
"dotenv": "^16.4.5",
"@graphprotocol/graph-cli": "^0.68.0",
"@graphprotocol/graph-ts": "^0.32.0"
"dotenv": "^16.4.5"
}
}
27 changes: 27 additions & 0 deletions test/WhitelistingManager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { ethers } from "hardhat";

const { expect } = require('chai');
const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers');

describe("WhitelistingManager", function () {
async function deployContractFixture() {
const [deployer, initialOwner] = await ethers.getSigners();
const WhitelistingManager = await ethers.getContractFactory("WhitelistingManager");
const whitelistingManager = await WhitelistingManager.deploy(initialOwner.address);
await whitelistingManager.waitForDeployment();

return { deployer, initialOwner, whitelistingManager };
}

describe("Ownership", function () {
it("should set the initial owner correctly", async function () {
const { initialOwner, whitelistingManager } = await loadFixture(deployContractFixture);
expect(await whitelistingManager.owner()).to.equal(initialOwner.address);
});

it("should not set the deployer as the owner", async function () {
const { deployer, whitelistingManager } = await loadFixture(deployContractFixture);
expect(await whitelistingManager.owner()).to.not.equal(deployer.address);
});
});
});
Loading

0 comments on commit 3f94c73

Please sign in to comment.