Skip to content
This repository has been archived by the owner on Jan 9, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:rhlsthrm/typescript-solidity-dev-…
Browse files Browse the repository at this point in the history
…starter-kit
  • Loading branch information
rhlsthrm committed Mar 8, 2021
2 parents d4bffba + 032a99a commit b67ad02
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ Create/modify network config in `hardhat.config.ts` and add API key and private

### Verify on Etherscan

Add Etherscan API key to `hardhat.config.ts`, then run:
Using the [hardhat-etherscan plugin](https://hardhat.org/plugins/nomiclabs-hardhat-etherscan.html), add Etherscan API key to `hardhat.config.ts`, then run:

`npx hardhat verify-contract --contract-name Counter --address <DEPLOYED ADDRESS>`
`npx hardhat verify --network rinkeby <DEPLOYED ADDRESS>`

PRs and feedback welcome!
18 changes: 18 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"@types/mocha": "^8.2.1",
"@types/node": "^14.14.32",
"chai": "^4.3.3",
"chai-as-promised": "^7.1.1",
"dotenv": "^8.2.0",
"ethereum-waffle": "^3.3.0",
"ethers": "^5.0.31",
Expand Down
7 changes: 4 additions & 3 deletions test/counter.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { ethers } from "hardhat";
import chai from "chai";
import chaiAsPromised from "chai-as-promised";
import { solidity } from "ethereum-waffle";
import { Counter__factory, Counter } from "../typechain";

chai.use(solidity);
chai.use(chaiAsPromised);
const { expect } = chai;

describe("Counter", () => {
Expand Down Expand Up @@ -38,9 +40,8 @@ describe("Counter", () => {

describe("count down", async () => {
// 5
it("should fail", async () => {
// this test will fail
await counter.countDown();
it("should fail due to underflow exception", () => {
return expect(counter.countDown()).to.eventually.be.rejectedWith(Error, 'Uint256 underflow');
});

it("should count down", async () => {
Expand Down

0 comments on commit b67ad02

Please sign in to comment.