Skip to content

Commit 3fa63b6

Browse files
committed
expect nonces to return bigints
1 parent 5e316f3 commit 3fa63b6

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

test/MainModule.spec.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -342,12 +342,12 @@ contract('MainModule', (accounts: string[]) => {
342342
describe('Using non-encoded nonce', () => {
343343
it('Should default to space zero', async () => {
344344
await wallet.sendTransactions([{}])
345-
expect(await wallet.mainModule.nonce()).to.equal(1)
345+
expect(await wallet.mainModule.nonce()).to.equal(1n)
346346
})
347347

348348
it('Should work with zero as initial nonce', async () => {
349349
await wallet.sendTransactions([{}])
350-
expect(await wallet.mainModule.readNonce(0)).to.equal(1)
350+
expect(await wallet.mainModule.readNonce(0)).to.equal(1n)
351351
})
352352

353353
it('Should emit NonceChange event', async () => {
@@ -388,7 +388,7 @@ contract('MainModule', (accounts: string[]) => {
388388
describe(`using ${ethers.toBeHex(space)} space`, () => {
389389
it('Should work with zero as initial nonce', async () => {
390390
await wallet.sendTransactions([{}], encodeNonce(space, 0))
391-
expect(await wallet.mainModule.readNonce(space)).to.equal(1)
391+
expect(await wallet.mainModule.readNonce(space)).to.equal(1n)
392392
})
393393

394394
it('Should emit NonceChange event', async () => {
@@ -416,7 +416,7 @@ contract('MainModule', (accounts: string[]) => {
416416
await wallet.sendTransactions([{}], encodeNonce(space, 0))
417417
await wallet.sendTransactions([{}], encodeNonce(space, 1))
418418

419-
expect(await wallet.mainModule.readNonce(space)).to.equal(2)
419+
expect(await wallet.mainModule.readNonce(space)).to.equal(2n)
420420
})
421421

422422
it('Should fail if nonce did not change', async () => {
@@ -449,18 +449,18 @@ contract('MainModule', (accounts: string[]) => {
449449
it('Should keep separated nonce counts', async () => {
450450
await wallet.sendTransactions([{}], encodeNonce(1, 0))
451451

452-
expect(await wallet.mainModule.readNonce(1)).to.equal(1)
453-
expect(await wallet.mainModule.readNonce(2)).to.equal(0)
452+
expect(await wallet.mainModule.readNonce(1)).to.equal(1n)
453+
expect(await wallet.mainModule.readNonce(2)).to.equal(0n)
454454

455455
await wallet.sendTransactions([{}], encodeNonce(2, 0))
456456

457-
expect(await wallet.mainModule.readNonce(1)).to.equal(1)
458-
expect(await wallet.mainModule.readNonce(2)).to.equal(1)
457+
expect(await wallet.mainModule.readNonce(1)).to.equal(1n)
458+
expect(await wallet.mainModule.readNonce(2)).to.equal(1n)
459459
await wallet.sendTransactions([{}], encodeNonce(2, 1))
460460
await wallet.sendTransactions([{}], encodeNonce(2, 2))
461461

462-
expect(await wallet.mainModule.readNonce(1)).to.equal(1)
463-
expect(await wallet.mainModule.readNonce(2)).to.equal(3)
462+
expect(await wallet.mainModule.readNonce(1)).to.equal(1n)
463+
expect(await wallet.mainModule.readNonce(2)).to.equal(3n)
464464
})
465465

466466
it('Should emit different events', async () => {

0 commit comments

Comments
 (0)