Skip to content

Commit

Permalink
fix(bridge-ui): fix claim eth message processed (#13656)
Browse files Browse the repository at this point in the history
  • Loading branch information
jscriptcoder authored Apr 26, 2023
1 parent 89439bb commit 57f06cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/bridge-ui/src/bridge/ERC20Bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ export class ERC20Bridge implements Bridge {
messageStatus === MessageStatus.Done ||
messageStatus === MessageStatus.Failed
) {
// TODO: should be throw a different error when status is Failed?
throw Error('message already processed');
}

Expand Down
6 changes: 6 additions & 0 deletions packages/bridge-ui/src/bridge/ETHBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,18 @@ export class ETHBridge implements Bridge {
throw Error('message already processed');
}

if (messageStatus === MessageStatus.Failed) {
throw Error('user can not process this, message has failed');
}

const signerAddress = await opts.signer.getAddress();

if (opts.message.owner.toLowerCase() !== signerAddress.toLowerCase()) {
throw Error('user can not process this, it is not their message');
}

// TODO: up to here we share same logic as ERC20Bridge

if (messageStatus === MessageStatus.New) {
const proofOpts = {
srcChain: opts.message.srcChainId,
Expand Down

0 comments on commit 57f06cb

Please sign in to comment.