Skip to content
Merged
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
2 changes: 1 addition & 1 deletion apps/api/src/api/services/ramp/base.service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import QuoteTicket from "../../../models/quoteTicket.model";
import {BaseRampService} from "./base.service";

const transaction = { id: "cleanup-test-transaction" };
const expectedDeleteBatchSize = 500;
const expectedDeleteBatchSize = 5000;

type QuoteCleanupWhere = {
expiresAt?: {
Expand Down
4 changes: 2 additions & 2 deletions apps/frontend/src/contexts/rampState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const MAX_RAMP_EPHEMERALS = 50;
type RampEphemeralEntry = {
substrateEphemeral: EphemeralAccount;
evmEphemeral: EphemeralAccount;
timestamp: number;
timestamp?: number;
};
type RampEphemeralsMap = Record<string, RampEphemeralEntry>;

Expand All @@ -32,7 +32,7 @@ export function updateRampEphemeral(rampId: string, ephemerals: RampExecutionInp

const keys = Object.keys(existing);
if (keys.length > MAX_RAMP_EPHEMERALS) {
const sorted = keys.sort((a, b) => (existing[a].timestamp ?? 0) - (existing[b].timestamp ?? 0));
const sorted = keys.sort((a, b) => (existing[a]?.timestamp ?? 0) - (existing[b]?.timestamp ?? 0));
const toRemove = sorted.slice(0, sorted.length - MAX_RAMP_EPHEMERALS);
for (const key of toRemove) {
delete existing[key];
Expand Down
Loading