Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/app/api/commitments/[id]/early-exit/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,12 @@
import { EarlyExitRequestBodySchema } from '@/lib/schemas/apiContracts';
import { earlyExitCommitmentOnChain, getCommitmentFromChain } from '@/lib/backend/services/contracts';
import {
earlyExitCommitmentOnChain,
getCommitmentFromChain,
} from '@/lib/backend/services/contracts';
import type { TransactionMetadata, TransactionType } from '@/lib/transaction/transactionTypes';
import { TRANSACTION_BOUNDS, createTransactionError } from '@/lib/transaction/transactionTypes';
import { TransactionStateMachine } from '@/lib/transaction/transactionStateMachine';
import { validateTransactionMetadata } from '@/lib/transaction/transactionStateMachine';
verifyOwnership,
verifySessionConsistency,
verifyCanEarlyExit,
validateTransactionResponse,
} from '@/lib/backend/transactionValidation';
import { randomUUID } from 'crypto';

const COMMITMENT_EARLY_EXIT_CORS_POLICY = {
POST: { access: 'first-party' },
Expand Down Expand Up @@ -255,9 +254,9 @@
}
throw error;
}
},

Check failure on line 257 in src/app/api/commitments/[id]/early-exit/route.ts

View workflow job for this annotation

GitHub Actions / tsc --noEmit

'catch' or 'finally' expected.
{ cors: COMMITMENT_EARLY_EXIT_CORS_POLICY },

Check failure on line 258 in src/app/api/commitments/[id]/early-exit/route.ts

View workflow job for this annotation

GitHub Actions / tsc --noEmit

Declaration or statement expected.
);

Check failure on line 259 in src/app/api/commitments/[id]/early-exit/route.ts

View workflow job for this annotation

GitHub Actions / tsc --noEmit

Declaration or statement expected.

const { reason, callerAddress } = parseResult.data;
const commitmentId = params.id;
Expand Down Expand Up @@ -359,7 +358,7 @@
);

return ok(responseData, undefined, 200, correlationId);
} catch (error) {

Check failure on line 361 in src/app/api/commitments/[id]/early-exit/route.ts

View workflow job for this annotation

GitHub Actions / tsc --noEmit

'try' expected.

Check failure on line 361 in src/app/api/commitments/[id]/early-exit/route.ts

View workflow job for this annotation

GitHub Actions / tsc --noEmit

Declaration or statement expected.
// Clean up idempotency record on failure to allow retry
const idempotencyKey = req.headers.get('idempotency-key');
if (idempotencyKey) {
Expand All @@ -375,7 +374,7 @@

throw error;
}
}, { cors: COMMITMENT_EARLY_EXIT_CORS_POLICY });

Check failure on line 377 in src/app/api/commitments/[id]/early-exit/route.ts

View workflow job for this annotation

GitHub Actions / tsc --noEmit

Declaration or statement expected.

Check failure on line 377 in src/app/api/commitments/[id]/early-exit/route.ts

View workflow job for this annotation

GitHub Actions / tsc --noEmit

Declaration or statement expected.

Check failure on line 377 in src/app/api/commitments/[id]/early-exit/route.ts

View workflow job for this annotation

GitHub Actions / tsc --noEmit

Declaration or statement expected.

const _405 = methodNotAllowed(["POST"]);
export { _405 as GET, _405 as PUT, _405 as PATCH, _405 as DELETE };
Loading
Loading