Skip to content

Commit 3b4e902

Browse files
committed
fix: update the sample projects
1 parent 65d8b02 commit 3b4e902

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

packages/hardhat-core/sample-projects/javascript-esm/test/Lock.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe("Lock", function () {
2424
const [owner, otherAccount] = await ethers.getSigners();
2525

2626
const { lock } = await ignition.deploy(LockModule, {
27-
parameters: { Lock: { lockedAmount, unlockTime } },
27+
parameters: { LockModule: { lockedAmount, unlockTime } },
2828
});
2929

3030
return { lock, unlockTime, lockedAmount, owner, otherAccount };

packages/hardhat-core/sample-projects/javascript/test/Lock.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe("Lock", function () {
2222
const [owner, otherAccount] = await ethers.getSigners();
2323

2424
const { lock } = await ignition.deploy(LockModule, {
25-
parameters: { Lock: { lockedAmount, unlockTime } },
25+
parameters: { LockModule: { lockedAmount, unlockTime } },
2626
});
2727

2828
return { lock, unlockTime, lockedAmount, owner, otherAccount };

packages/hardhat-core/sample-projects/typescript-viem/ignition/modules/LockModule.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { buildModule } from "@nomicfoundation/ignition/modules";
1+
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";
22
import { parseEther } from "viem";
33

44
const currentTimestampInSeconds = Math.round(

packages/hardhat-core/sample-projects/typescript-viem/test/Lock.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe("Lock", function () {
2222
const [owner, otherAccount] = await hre.viem.getWalletClients();
2323

2424
const { lock } = await hre.ignition.deploy(LockModule, {
25-
parameters: { Lock: { lockedAmount, unlockTime } },
25+
parameters: { LockModule: { lockedAmount, unlockTime } },
2626
});
2727

2828
const publicClient = await hre.viem.getPublicClient();

packages/hardhat-core/sample-projects/typescript/ignition/modules/LockModule.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { buildModule } from "@nomicfoundation/ignition/modules";
1+
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";
22

33
const currentTimestampInSeconds = Math.round(
44
new Date(2023, 0, 1).valueOf() / 1000
@@ -7,7 +7,7 @@ const TEN_YEAR_IN_SECS: number = 10 * 365 * 24 * 60 * 60;
77
const TEN_YEARS_IN_FUTURE: number =
88
currentTimestampInSeconds + TEN_YEAR_IN_SECS;
99

10-
const ONE_GWEI: bigint = BigInt(hre.ethers.parseUnits("1", "gwei").toString());
10+
const ONE_GWEI: bigint = 1_000_000_000n;
1111

1212
const LockModule = buildModule("LockModule", (m) => {
1313
const unlockTime = m.getParameter("unlockTime", TEN_YEARS_IN_FUTURE);

packages/hardhat-core/sample-projects/typescript/test/Lock.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe("Lock", function () {
1414
// and reset Hardhat Network to that snapshot in every test.
1515
async function deployOneYearLockFixture() {
1616
const ONE_YEAR_IN_SECS = 365 * 24 * 60 * 60;
17-
const ONE_GWEI = 1_000_000_000;
17+
const ONE_GWEI = 1_000_000_000n;
1818

1919
const lockedAmount = ONE_GWEI;
2020
const unlockTime = (await time.latest()) + ONE_YEAR_IN_SECS;
@@ -23,7 +23,7 @@ describe("Lock", function () {
2323
const [owner, otherAccount] = await ethers.getSigners();
2424

2525
const { lock } = await ignition.deploy(LockModule, {
26-
parameters: { Lock: { lockedAmount, unlockTime } },
26+
parameters: { LockModule: { lockedAmount, unlockTime } },
2727
});
2828

2929
return { lock, unlockTime, lockedAmount, owner, otherAccount };

0 commit comments

Comments
 (0)