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: adding overrides for coredao for non-bitgo recovery support through wrw #5372

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

parasgarg-bitgo
Copy link
Contributor

Ticket: WIN-4290

Copy link
Contributor

@mohammadalfaiyazbitgo mohammadalfaiyazbitgo left a comment

Choose a reason for hiding this comment

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

some code nits, but you are missing tests.

Comment on lines 44 to 46
if (!result || !result.result || isNaN(<number>result.result)) {
throw new Error(`Could not obtain address balance for ${address} from the explorer, got: ${result.result}`);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (!result || !result.result || isNaN(<number>result.result)) {
throw new Error(`Could not obtain address balance for ${address} from the explorer, got: ${result.result}`);
}
if (!result?.result || isNaN(Number(result.result))) {
throw new Error(`Could not obtain address balance for ${address} from the explorer, got: ${result.result}`);
}

Comment on lines 48 to 50
if (typeof result.result !== 'string') {
result.result = result.result.toString();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (typeof result.result !== 'string') {
result.result = result.result.toString();
}
result.result = result.result.toString();

you could just unconditionally do this.

Comment on lines 72 to 70
const outgoingTxs = backupKeyTxList.filter((tx) => tx.from === address);
nonce = Math.max(...outgoingTxs.map((tx) => tx.nonce as number)) + 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest

Suggested change
const outgoingTxs = backupKeyTxList.filter((tx) => tx.from === address);
nonce = Math.max(...outgoingTxs.map((tx) => tx.nonce as number)) + 1;
nonce = Math.max(...backupKeyTxList
.filter((tx) => tx.from === address)
.map((tx) => tx.nonce as number)
) + 1;

@DinshawKothari DinshawKothari merged commit 0bde625 into master Feb 3, 2025
8 checks passed
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.

6 participants