@@ -35,7 +35,9 @@ export class TopupDeliveryError extends Error {
|
||||
}
|
||||
}
|
||||
|
||||
export async function claimTopupDelivery(claim: () => Promise<{ count: number }>): Promise<void> {
|
||||
export async function claimTopupDelivery(
|
||||
claim: () => Promise<{ count: number }>,
|
||||
): Promise<void> {
|
||||
const result = await claim();
|
||||
if (result.count !== 1) throw new TopupDeliveryError();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user