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
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion packages/bridge-ui/src/bridge/ETHBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class ETHBridge implements Bridge {
opts.msgHash,
);

if (messageStatus === MessageStatus.Done) {
if ([MessageStatus.Done, MessageStatus.Failed].includes(messageStatus)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If not mistaken when MessageStatus.Failed is the status, then it is not processed yet. There need to be a 'releaseEther()'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If Claimed called after releaseEther it's fine i guess - donno when / how automatized it is on the relayer side.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should then throw a different error message here?, In the UI when the status is Failed we show the Release button, claiming will no longer be available, so theoretically the user shouldn't be able to call this function when messageStatus is Failed... Let me make that change

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, yes, so basically its kinda not possible for regular users, so then has not too much effect anyways.

Copy link
Contributor Author

@jscriptcoder jscriptcoder Apr 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a change to throw different error when the message has failed. One could argue though that the message has failed and therefore already processed, but I might be wrong here. @cyberhorsey, what do you think?

In V2 I'd like to use error codes instead of messages

throw Error('message already processed');
}

Expand Down