Skip to content

Commit 1fba742

Browse files
feat(mbe): fix comments
1 parent 6be6567 commit 1fba742

File tree

3 files changed

+6
-16
lines changed

3 files changed

+6
-16
lines changed

src/api/master/handlers/handleAccelerate.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,6 @@ export async function handleAccelerate(
2222
KeyIndices,
2323
});
2424

25-
if (!wallet) {
26-
throw new Error(`Wallet ${walletId} not found`);
27-
}
28-
29-
if (!signingKeychain || !signingKeychain.pub) {
30-
throw new Error(`Signing keychain for ${params.source} not found`);
31-
}
32-
33-
if (params.pubkey && params.pubkey !== signingKeychain.pub) {
34-
throw new Error(`Pub provided does not match the keychain on wallet for ${params.source}`);
35-
}
36-
3725
try {
3826
// Create custom signing function that delegates to EBE
3927
const customSigningFunction = makeCustomSigningFunction({

src/api/master/handlers/handleConsolidate.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ export async function handleConsolidate(
3232
throw new Error('consolidateAddresses must be an array of addresses');
3333
}
3434

35-
if (params.pubkey && params.pubkey !== signingKeychain.pub) {
36-
throw new Error(`Pub provided does not match the keychain on wallet for ${params.source}`);
37-
}
38-
3935
try {
4036
// Create custom signing function that delegates to EBE
4137
const customSigningFunction = makeCustomSigningFunction({

src/shared/coinUtils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,20 +84,26 @@ export async function getWalletAndSigningKeychain({
8484
KeyIndices: { USER: number; BACKUP: number; BITGO: number };
8585
}) {
8686
const baseCoin = bitgo.coin(coin);
87+
8788
const wallet = await baseCoin.wallets().get({ id: walletId, reqId });
89+
8890
if (!wallet) {
8991
throw new Error(`Wallet ${walletId} not found`);
9092
}
93+
9194
const keyIdIndex = params.source === 'user' ? KeyIndices.USER : KeyIndices.BACKUP;
9295
const signingKeychain = await baseCoin.keychains().get({
9396
id: wallet.keyIds()[keyIdIndex],
9497
});
98+
9599
if (!signingKeychain || !signingKeychain.pub) {
96100
throw new Error(`Signing keychain for ${params.source} not found`);
97101
}
102+
98103
if (params.pubkey && params.pubkey !== signingKeychain.pub) {
99104
throw new Error(`Pub provided does not match the keychain on wallet for ${params.source}`);
100105
}
106+
101107
return { baseCoin, wallet, signingKeychain };
102108
}
103109

0 commit comments

Comments
 (0)