Skip to content

feat: raise error on no recipients eth musig rec and some refactors#51

Merged
pranavjain97 merged 2 commits intomasterfrom
WP-5185
Jul 2, 2025
Merged

feat: raise error on no recipients eth musig rec and some refactors#51
pranavjain97 merged 2 commits intomasterfrom
WP-5185

Conversation

@mtexeira-simtlix
Copy link
Copy Markdown
Contributor

Ticket: WP-5185
Description:

@mtexeira-simtlix mtexeira-simtlix force-pushed the WP-5185 branch 2 times, most recently from 0342703 to 2ba8ee7 Compare July 1, 2025 18:21
@mtexeira-simtlix
Copy link
Copy Markdown
Contributor Author

@pranavjain97 & @mohammadalfaiyazbitgo when reviewed merge the PR on this link first:
#53

as that contains a blocking issue that makes a testcase fail in master branch and then yes, proceed with this.
Thanks guys!

@mtexeira-simtlix mtexeira-simtlix marked this pull request as ready for review July 1, 2025 18:50
@mtexeira-simtlix mtexeira-simtlix dismissed mohammadalfaiyazbitgo’s stale review July 2, 2025 17:04

The merge-base changed after approval.

@mtexeira-simtlix mtexeira-simtlix dismissed mohammadalfaiyazbitgo’s stale review July 2, 2025 17:10

The merge-base changed after approval.

Comment on lines +178 to +183
if (!recipients || recipients.length === 0) {
const errorMsg = `Recovery tx for coin ${coin} must have at least one recipient.`;
logger.error(errorMsg);
throw new Error(errorMsg);
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you're taking in the coin, is there a coin method that verifies the recipients? Either way - I don't see why you need a special helper for this. This can just be done directly in the main file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The helper was added because maybe in some other coin you need to check recipients between the unsigned -> half signed but also between half signed -> full.

Plus, a helper sometimes helps to communicate intention, the error msg polutes the intention with 3 lines of code and the helper just says what's the intent.

Thanks for the reviews!

userPub,
backupPub,
apiKey,
unsignedSweepPrebuildTx: undefined,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

bit confused on why this is undefined, and then in EBE you're checking if it contains recipients? 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's not a refactor that i made, that comes from @mohammadalfaiyazbitgo previous refactor when he added the UTXO (got added here because i rebased his changes).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

But his PR is already merged; so the rebase shoudn't introduce any changes outside of your PR

Comment thread src/shared/types/index.ts Outdated
Comment on lines +17 to +24
| 'localNonSecure'
| 'mock'
| 'adminProd'
| 'adminTest'
| 'adminStaging'
| 'adminDev'
| 'custom'
| 'branch';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I thought we decided to cast? Adding all the other env's like admin.. here doesnt make sense since they dont apply to us.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, we decided to just extend it, i double checked that during the meet.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

extending why? we shoudn't have env names we dont have support for / dont apply in our case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As we talk in our quick sync (thanks for that!), i'm uploading the changes for casting instead of using the other envs.

Copy link
Copy Markdown
Contributor

@pranavjain97 pranavjain97 left a comment

Choose a reason for hiding this comment

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

Did you test if ETH/UTXO recoveries are still working E2E with these changes?

@pranavjain97 pranavjain97 merged commit ae3c69b into master Jul 2, 2025
3 checks passed
@pranavjain97 pranavjain97 deleted the WP-5185 branch July 2, 2025 18:52
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.

3 participants