Skip to content

Commit

Permalink
test: use bigger buffer for certificate time tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanosdev committed Jul 24, 2023
1 parent eb6be95 commit f1c93c6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/certificate-verification-js/src/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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([
{
Expand All @@ -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',
},
])(
Expand Down Expand Up @@ -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',
},
{
Expand Down

0 comments on commit f1c93c6

Please sign in to comment.