From f1c93c69ccbc067682eb9fba54e3d910accf217a Mon Sep 17 00:00:00 2001 From: NathanosDev Date: Mon, 24 Jul 2023 17:30:19 +0200 Subject: [PATCH] test: use bigger buffer for certificate time tests --- .../src/index.spec.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/certificate-verification-js/src/index.spec.ts b/packages/certificate-verification-js/src/index.spec.ts index 9aaa8c35..01fb93d5 100644 --- a/packages/certificate-verification-js/src/index.spec.ts +++ b/packages/certificate-verification-js/src/index.spec.ts @@ -27,7 +27,7 @@ describe('verifyCertification', async () => { new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1]), ); const time = BigInt(Date.now()); - const MAX_CERT_TIME_OFFSET_MS = 5000; + const MAX_CERT_TIME_OFFSET_MS = 300_000; it.each([ { @@ -38,21 +38,21 @@ describe('verifyCertification', async () => { scenario: 'with a delegation', }, { - timeOverride: BigInt(Date.now() - 1000), + timeOverride: BigInt(Date.now() - 10_000), scenario: 'with a time in the past', }, { withDelegation: true, - timeOverride: BigInt(Date.now() - 1000), + timeOverride: BigInt(Date.now() - 10_000), scenario: 'with a delegation and a time in the past', }, { - timeOverride: BigInt(Date.now() + 1000), + timeOverride: BigInt(Date.now() + 10_000), scenario: 'with a time in the future', }, { withDelegation: true, - timeOverride: BigInt(Date.now() + 1000), + timeOverride: BigInt(Date.now() + 10_000), scenario: 'with a delegation and a time in the future', }, ])( @@ -93,21 +93,21 @@ describe('verifyCertification', async () => { scenario: 'with a delegation and an invalid signature', }, { - timeOverride: BigInt(Date.now() - MAX_CERT_TIME_OFFSET_MS - 1000), + timeOverride: BigInt(Date.now() - MAX_CERT_TIME_OFFSET_MS - 10_000), scenario: 'with a time too far in the past', }, { withDelegation: true, - timeOverride: BigInt(Date.now() - MAX_CERT_TIME_OFFSET_MS - 1000), + timeOverride: BigInt(Date.now() - MAX_CERT_TIME_OFFSET_MS - 10_000), scenario: 'with a delegation a time too far in the past', }, { - timeOverride: BigInt(Date.now() + MAX_CERT_TIME_OFFSET_MS + 1000), + timeOverride: BigInt(Date.now() + MAX_CERT_TIME_OFFSET_MS + 10_000), scenario: 'with a time too far in the future', }, { withDelegation: true, - timeOverride: BigInt(Date.now() + MAX_CERT_TIME_OFFSET_MS + 1000), + timeOverride: BigInt(Date.now() + MAX_CERT_TIME_OFFSET_MS + 10_000), scenario: 'with a delegation a time too far in the future', }, {