Skip to content

Commit

Permalink
frontend: relay; finalize message tx check
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmota committed Jul 10, 2024
1 parent e3c0057 commit 92b1fb2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/frontend/src/pages/Relay/Relay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export const Relay: FC = () => {
console.log('receipt', receipt)
} catch (err: any) {
console.error(err)
throw new Error(`Failed to relay commit transfer tx on ${l1Network.slug}. Error: ${err.message}`)
throw new Error(`Failed to relay commit transfer tx on ${l1Network.slug}. Error: ${err.message}. You may need to wait a few more hours to relay this transfer.`)
}
setLoading(false)
resolve(null)
Expand Down
4 changes: 4 additions & 0 deletions packages/frontend/src/pages/Relay/relayer/OptimismRelayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ export class OptimismRelayer extends Relayer<CrossChainMessage, MessageStatus> {

async sendRelayTx (message: CrossChainMessage, messageDirection: MessageDirection): Promise<providers.TransactionResponse> {
if (messageDirection === MessageDirection.L2_TO_L1) {
const messageStatus = await this.getMessageStatus(message)
if (messageStatus === MessageStatus.READY_FOR_RELAY) {
return this.#csm.finalizeMessage(message)
}
return this.#csm.proveMessage(message)
}

Expand Down

0 comments on commit 92b1fb2

Please sign in to comment.