Skip to content

Commit f843ac0

Browse files
committed
Address PR feedback
1 parent 1e5d699 commit f843ac0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

v-next/hardhat/templates/01-node-test-runner-viem/test/Counter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ describe("Counter", async function () {
7171
});
7272

7373
it("The sum of the Increment events should match the current value", async function () {
74-
const startBlockNumber = await publicClient.getBlockNumber();
7574
const counter = await viem.deployContract("Counter");
75+
const deploymentBlockNumber = await publicClient.getBlockNumber();
7676

7777
// run a series of increments
7878
for (let i = 1n; i <= 10n; i++) {
@@ -83,7 +83,7 @@ describe("Counter", async function () {
8383
address: counter.address,
8484
abi: counter.abi,
8585
eventName: "Increment",
86-
fromBlock: startBlockNumber,
86+
fromBlock: deploymentBlockNumber,
8787
strict: true,
8888
});
8989

v-next/hardhat/templates/02-mocha-ethers/test/Counter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ describe("Counter", function () {
5252
});
5353

5454
it("The sum of the Increment events should match the current value", async function () {
55-
const startBlockNumber = await ethers.provider.getBlockNumber();
5655
const counter = await ethers.deployContract("Counter");
56+
const deploymentBlockNumber = await ethers.provider.getBlockNumber();
5757

5858
// run a series of increments
5959
for (let i = 1; i <= 10; i++) {
@@ -62,7 +62,7 @@ describe("Counter", function () {
6262

6363
const events = await counter.queryFilter(
6464
counter.filters.Increment(),
65-
startBlockNumber,
65+
deploymentBlockNumber,
6666
"latest",
6767
);
6868

0 commit comments

Comments
 (0)