Skip to content

feat: implement async mode for generateWallet#231

Merged
pranishnepal merged 1 commit into
masterfrom
WCN-886
Jun 11, 2026
Merged

feat: implement async mode for generateWallet#231
pranishnepal merged 1 commit into
masterfrom
WCN-886

Conversation

@pranishnepal

Copy link
Copy Markdown
Contributor

What

When asyncModeConfig.enabled, handleGenerateOnChainWallet submits directly to the bridge and returns { jobId, status: 'pending' } (202) without touching AWM or BitGo; we're only supporting multi-sig wallets for now.

Ticket: WCN-886

Testing

  • Unit Test
  • Integ Test

@linear-code

linear-code Bot commented Jun 10, 2026

Copy link
Copy Markdown

WCN-886

When asyncModeConfig.enabled, handleGenerateOnChainWallet submits
directly to the bridge and returns { jobId, status: 'pending' } (202)
without touching AWM or BitGo.

We're only supporting multisig wallets for now.

Ticket: WCN-886
@pranishnepal pranishnepal had a problem deploying to breaking-changes-override June 10, 2026 21:45 — with GitHub Actions Failure
@pranishnepal pranishnepal marked this pull request as ready for review June 10, 2026 22:31
@pranishnepal pranishnepal requested review from a team as code owners June 10, 2026 22:31

@danielpeng1 danielpeng1 left a comment

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.

feel free to address all these in a followup/next PR

Comment on lines +45 to +50
const asyncResult = await submitJobViaBridgeClient(req, {
path: `/api/${req.params.coin}/key/independent`,
body: req.decoded,
sources: [KeySource.USER, KeySource.BACKUP],
operationType: 'multisig_keygen',
});

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.

Is req.decoded the correct bridge body (not some other trimmed/transformed payload)?

@pranishnepal pranishnepal Jun 11, 2026

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.

we're supposed to send the request as is - believe the typing is unknown 🤔

const asyncApp = expressApp(asyncConfig);
const asyncAgent = request.agent(asyncApp);

const bridgeNock = nock(bridgeUrl).post(`/api/${coin}/key/independent`).reply(202, { jobId });

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.

assert async tests for bridge contract (header and body) as we just have jobId and status here now.

Comment on lines +159 to +162
if (req.config.asyncModeConfig.enabled) {
throw new BadRequestError('Async mode is not yet supported for TSS wallet generation');
}

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.

add unit tests for async guards

@pranishnepal pranishnepal merged commit 59c3c4f into master Jun 11, 2026
25 of 28 checks passed
@pranishnepal pranishnepal deleted the WCN-886 branch June 11, 2026 16:05
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.

2 participants