We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d964ca1 commit 3327765Copy full SHA for 3327765
packages/hardhat-ethers/src/internal/hardhat-ethers-provider.ts
@@ -597,11 +597,13 @@ export class HardhatEthersProvider implements ethers.Provider {
597
return this.getBlockNumber().then((b) => toQuantity(b + blockTag));
598
}
599
600
- if (typeof blockTag === 'bigint') {
601
- if (Number(blockTag) >= 0) {
602
- return toQuantity(Number(blockTag));
+ if (typeof blockTag === "bigint") {
+ if (blockTag >= 0n) {
+ return toQuantity(blockTag);
603
604
- return this.getBlockNumber().then((b) => toQuantity(b + Number(blockTag)));
+ return this.getBlockNumber().then((b) =>
605
+ toQuantity(b + Number(blockTag))
606
+ );
607
608
609
throw new HardhatEthersError(`Invalid blockTag: ${blockTag}`);
0 commit comments