Last active
January 30, 2022 21:30
-
-
Save aindrajaya/a684e8cf56bd00651f462c842878f3b4 to your computer and use it in GitHub Desktop.
Mastering Blockchain Development part 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "@nomiclabs/hardhat-waffle"; | |
/** | |
* @type import('hardhat/config').HardhatUserConfig | |
*/ | |
module.exports = { | |
//Change the code below | |
solidity: 0.8.10; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import _ from "@nomiclabs/hardhat-waffle"; | |
import { ethers } from "hardhat"; | |
import { expect } from "chai"; | |
describe("Hello test", () => { | |
it("should be get the hello world string", async function(){ | |
//1. Setup, just call the name of your contract (contract name), not the file name. | |
const OurContract = await ethers.getContractFactory("HelloContract"); | |
//2. Deploy our contract using deploy and deployed function from nomiclabs/hardhat-ethers | |
const DeployContract = await OurContract.deploy(); | |
await DeployContract.deployed(); | |
//3. Call our functions to test | |
expect(await DeployContract.hello()).to.equal("Hello, world from Web 3"); | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment