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

feat: add transfer recovery from lock/withdraw hash #10

Merged
merged 9 commits into from Mar 19, 2021
Merged

Conversation

paouvrard
Copy link
Member

@paouvrard paouvrard commented Mar 11, 2021

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)

@paouvrard paouvrard changed the title feat: add eth lock tx recovery from deposit hash feat: add transfer recovery from lock/withdraw hash Mar 14, 2021
@paouvrard paouvrard marked this pull request as ready for review March 14, 2021 10:53
Copy link
Contributor

@chadoh chadoh left a 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
Copy link
Contributor

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)
Copy link
Contributor

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?

@paouvrard paouvrard merged commit 465f2af into main Mar 19, 2021
@paouvrard paouvrard deleted the tx_recovery branch August 30, 2021 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants