feat: add async support for sendMany#243
Conversation
80bbe51 to
1fbacbe
Compare
9c87c7c to
880aee8
Compare
danielpeng1
left a comment
There was a problem hiding this comment.
nothing blocking mostly just the first comment
| function parseSignedTxFromAwmResponse( | ||
| awmResponse: BridgeJobResponse['awmResponse'], | ||
| ): SignedTransaction { | ||
| return parseAwmResponseBody(awmResponse, 'awmResponse') as SignedTransaction; |
There was a problem hiding this comment.
should we add a simple schema check on body like how you did on keygen above
if we do we can add a test (e.g. with bad awmResponse.body) for this too.
There was a problem hiding this comment.
Didn't opt to add initially since bridge just returns unknown, but on a double take - valid point. Added a basic type check!
| version: 1, | ||
| coin: COIN, | ||
| operationType: 'multisig_sign', | ||
| awmResponse: awmOk({ txHex: 'signed-tx-hex' }), |
There was a problem hiding this comment.
nit: you can update the fixture here to use the halfSigned shape from sendMany.test.ts
this i think:
halfSigned: {
txHex: 'signed-tx-hex',
txInfo: {
nP2SHInputs: 1,
nSegwitInputs: 0,
nOutputs: 2,
},
},
walletId: 'test-wallet-id',
source: 'user',
pub: 'xpub_user',
});
| awmResponse: { | ||
| status: 200, | ||
| body: { txHex: 'signed-tx-hex' }, | ||
| }, |
| const signBody = buildMultisigSignBody({ | ||
| source: req.decoded.source, | ||
| signingKeychain, | ||
| txPrebuilt, | ||
| walletPubs, | ||
| }); |
There was a problem hiding this comment.
you're building the sign payload here but the object is built the same on lines 236-241 down below
There was a problem hiding this comment.
i was refactoring and then reverted some, leftover. Thanks for catching. Fixed!
| const bridgeUrl = 'http://bridge.invalid'; | ||
| const jobId = 'test-job-id-123'; | ||
|
|
||
| sinon.restore(); |
There was a problem hiding this comment.
nit: dont need the sinon.restore()s since you got it in the afterEach
There was a problem hiding this comment.
there's another one in the TSS async test
This commit adds support for asynchronous processing of the sendMany operation in the masterBitgoExpress service. It includes the following changes: - Refactored the sendMany handler to support both synchronous and asynchronous processing. - Added utility functions for submitting and handling asynchronous jobs. - Updated tests to cover the new asynchronous functionality. - Added integ tests Ticket: WCN-887
What
This commit adds support for asynchronous processing of the sendMany operation in the masterBitgoExpress service.
It includes the following changes:
buildMultisigSignBodyTicket: WCN-887
Testing