Skip to content

Commit e96785c

Browse files
feat: behavior adjustments based on reviews
1 parent a5ff857 commit e96785c

4 files changed

Lines changed: 3 additions & 20 deletions

File tree

src/api/enclaved/recoveryMultisigTransaction.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ export async function recoveryMultisigTransaction(
2828
if (coin.isEVM()) {
2929
// Every recovery method on every coin family varies one from another so we need to ensure with a guard.
3030
if (isEthLikeCoin(coin)) {
31-
// TODO: populate coinSpecificParams with things like replayProtectionOptions
32-
// coinSpecificParams type could be "recoverOptions"
3331
try {
3432
const halfSignedTx = await coin.signTransaction({
3533
isLastSignature: false,

src/masterBitgoExpress/enclavedExpressClient.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ interface RecoveryMultisigOptions {
3939
bitgoPub?: string;
4040
ignoreAddressTypes?: string[];
4141
};
42-
// recoveryDestinationAddress: string;
4342
}
4443

4544
export class EnclavedExpressClient {
@@ -149,11 +148,11 @@ export class EnclavedExpressClient {
149148
}
150149

151150
/**
152-
* Recovery a multisig transaction
151+
* Recover a multisig transaction
153152
*/
154153
async recoveryMultisig(params: RecoveryMultisigOptions): Promise<SignedTransaction> {
155154
if (!this.coin) {
156-
throw new Error('Coin must be specified to recovery a multisig');
155+
throw new Error('Coin must be specified to recover a multisig');
157156
}
158157

159158
try {

src/masterBitgoExpress/recoveryWallet.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,13 @@
1-
import assert from 'assert';
21
import { MethodNotImplementedError } from 'bitgo';
32
import { isEthLikeCoin } from '../shared/coinUtils';
4-
import { isMasterExpressConfig } from '../types';
5-
import { createEnclavedExpressClient } from './enclavedExpressClient';
63
import { MasterApiSpecRouteRequest } from './routers/masterApiSpec';
74

85
export async function handleRecoveryWalletOnPrem(
96
req: MasterApiSpecRouteRequest<'v1.wallet.recovery', 'post'>,
107
) {
118
const bitgo = req.bitgo;
129
const coin = req.decoded.coin;
13-
assert(
14-
isMasterExpressConfig(req.config),
15-
'Expected req.config to be of type MasterExpressConfig',
16-
);
17-
const enclavedExpressClient = createEnclavedExpressClient(req.config, coin);
18-
if (!enclavedExpressClient) {
19-
throw new Error(
20-
'Enclaved express client not configured - enclaved express features will be disabled',
21-
);
22-
}
10+
const enclavedExpressClient = req.enclavedExpressClient;
2311

2412
const {
2513
userPub,
@@ -53,7 +41,6 @@ export async function handleRecoveryWalletOnPrem(
5341
unsignedSweepPrebuildTx,
5442
coinSpecificParams,
5543
walletContractAddress,
56-
// recoveryDestinationAddress,
5744
});
5845

5946
return fullSignedRecoveryTx;

src/shared/coinUtils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export function isUtxoCoin(coin: BaseCoin): coin is AbstractUtxoCoin {
3434
isFamily(coin, CoinFamily.BCH) ||
3535
isFamily(coin, CoinFamily.ZEC) ||
3636
isFamily(coin, CoinFamily.DASH) ||
37-
isFamily(coin, CoinFamily.DASH) ||
3837
isFamily(coin, CoinFamily.BTG);
3938

4039
return isBtc || isBtcLike;

0 commit comments

Comments
 (0)