Skip to content

Commit

Permalink
Avoid waiting on payment while sending a L2 tx (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
prathamesh0 authored Sep 20, 2023
1 parent 3cb79e6 commit d7139f0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/libp2p-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ export function createMessageToL2Handler (
const { payload, payment } = data;

// TODO: Check payment status before sending tx to l2
await handlePayment(paymentsManager, payment, payload.kind);

sendMessageToL2(signer, { contractAddress, gasLimit }, payload, consensus);
await Promise.all([
handlePayment(paymentsManager, payment, payload.kind),
sendMessageToL2(signer, { contractAddress, gasLimit }, payload, consensus)
]);
};
}

Expand Down

0 comments on commit d7139f0

Please sign in to comment.