-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: add transfer recovery from lock/withdraw hash #10
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see some maintainability- and documentation-related changes to the code before merge, but the logic seems solid.
@@ -85,6 +86,93 @@ export function checkStatus (transfer) { | |||
} | |||
} | |||
|
|||
// Recover transfer from a withdraw tx hash | |||
// Track a new transfer at the completedStep = WITHDRAW so that it can be unlocked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not hooked up yet, but most other comments throughout this repo use typedoc-style notation so that we can generate great documentation, whether people are relying on inline docs in their editor or viewing it on the web.
/**
* Recover transfer from a withdraw tx hash.
* Track a new transfer at the completedStep = WITHDRAW so that it can be unlocked
* @param withdrawTxHash hash of ...
*/
export async function ...
nearOnEthClientBlockHeights: [], | ||
proofs: [] | ||
} | ||
track(transfer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be mostly copied from initiate
. How complicated would it be to extract to a separate function?
Implementation for aurora-is-near/rainbow-bridge-frontend#136
Given an eth lock hash or a near withdraw hash, recreate a transfer object which can be finalized (mint/unlock)