Skip to content

Commit 7ebf2ce

Browse files
authored
Merge pull request #45 from everclearorg/fix/destinations
fix: cap destination length
2 parents e2a8c15 + d6876a2 commit 7ebf2ce

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/poller/src/invoice/processInvoices.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ interface ProcessInvoicesParams {
3232
config: MarkConfiguration;
3333
}
3434

35+
const MAX_DESTINATIONS = 10; // enforced onchain
36+
3537
export async function processInvoices({
3638
invoices,
3739
everclear,
@@ -234,7 +236,8 @@ export async function processInvoices({
234236
origin: destination,
235237
destinations: config.supportedSettlementDomains
236238
.filter((domain) => domain.toString() !== destination)
237-
.map((s) => s.toString()),
239+
.map((s) => s.toString())
240+
.slice(0, MAX_DESTINATIONS),
238241
to: config.ownAddress,
239242
inputAsset,
240243
amount: convertHubAmountToLocalDecimals(BigInt(minAmount), inputAsset, destination, config).toString(),

0 commit comments

Comments
 (0)