Open History to see the last commit
1// Fixtures shared by the KeyScheduler oracle and its ordinary unit tests in
2// KeyScheduler-lifecycle.test.ts. They build transactions and a fixed clock.
3import type { OfflineTransaction } from '../src/types'
4
5export const BASE_TIME = Date.parse(`2026-01-01T00:00:00.000Z`)
6
7export function createTransaction(
8 id: string,
9 createdAt: number,
10 nextAttemptAt: number,
11 payload: number,
12): OfflineTransaction {
13 return {
14 id,
15 mutationFnName: `syncData`,
16 mutations: [],
17 keys: [],
18 idempotencyKey: `idempotency-${id}`,
19 createdAt: new Date(createdAt),
20 retryCount: 0,
21 nextAttemptAt,
22 metadata: { payload },
23 version: 1,
24 }
25}