Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bridge-ui): fix claim eth message processed #13656

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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