Compare commits

...

2 Commits

Author SHA1 Message Date
Râu Cao
55877897be Formatting
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2022-08-23 10:42:33 +01:00
Râu Cao
59bda71f97 Add mocha, chai, and test for Contribution 2022-08-23 10:42:07 +01:00
5 changed files with 704 additions and 134 deletions

View File

@@ -1 +1,2 @@
/scripts/
/test/

811
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -39,11 +39,13 @@
},
"homepage": "https://github.com/67P/kredits-contracts#readme",
"devDependencies": {
"@nomicfoundation/hardhat-chai-matchers": "^1.0.3",
"@nomiclabs/hardhat-ethers": "^2.0.2",
"@nomiclabs/hardhat-waffle": "^2.0.1",
"@openzeppelin/contracts-upgradeable": "^4.3.2",
"@openzeppelin/hardhat-upgrades": "^1.10.0",
"async-each-series": "^1.1.0",
"chai": "^4.3.6",
"cli-table": "^0.3.1",
"colors": "^1.0.3",
"eslint": "^8.14.0",
@@ -57,6 +59,7 @@
"hardhat-deploy": "^0.11.4",
"hardhat-deploy-ethers": "^0.3.0-beta.10",
"homedir": "^0.6.0",
"mocha": "^10.0.0",
"promptly": "^3.0.3",
"solhint": "^3.3.7",
"truffle-hdwallet-provider": "^1.0.17",

View File

@@ -1,4 +1,6 @@
const { ethers, upgrades } = require("hardhat"); const path = require("path"); const fileInject = require("./helpers/file_inject.js");
const { ethers, upgrades } = require("hardhat");
const path = require("path");
const fileInject = require("./helpers/file_inject.js");
function handleError(error) {
console.error(error.message);

19
test/Contribution.js Normal file
View File

@@ -0,0 +1,19 @@
const { expect } = require("chai");
const { ethers, upgrades } = require("hardhat");
let hardhatContribution;
describe("Contribution contract", function () {
describe("Deployment", function () {
before(async function () {
// const [owner] = await ethers.getSigners();
const Contribution = await ethers.getContractFactory("Contribution");
hardhatContribution = await upgrades.deployProxy(Contribution, [40321]);
});
it("sets the veto confirmation period", async function () {
expect(await hardhatContribution.blocksToWait()).to.equal(40321);
});
});
});