Skip to content

Commit 583bdc4

Browse files
committed
add n-suffix tests
1 parent 22bcbf5 commit 583bdc4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/hardhat-core/test/internal/core/params/argumentTypes.ts

+8
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ describe("argumentTypes", () => {
151151
);
152152
});
153153

154+
it("should work with bigint values with 'n' suffix", () => {
155+
assert.equal(types.bigint.parse("arg", "0n"), BigInt(0));
156+
});
157+
154158
it("should fail with incorrect values", () => {
155159
expectHardhatError(
156160
() => types.bigint.parse("arg", ""),
@@ -192,6 +196,10 @@ describe("argumentTypes", () => {
192196
() => types.bigint.parse("arg", "1e0"),
193197
ERRORS.ARGUMENTS.INVALID_VALUE_FOR_TYPE
194198
);
199+
expectHardhatError(
200+
() => types.bigint.parse("arg", "0x0n"),
201+
ERRORS.ARGUMENTS.INVALID_VALUE_FOR_TYPE
202+
);
195203
});
196204
});
197205

0 commit comments

Comments
 (0)