Skip to content

Commit a98ce5e

Browse files
refactor: cast to env name on bitgo env
1 parent f38a933 commit a98ce5e

File tree

3 files changed

+7
-19
lines changed

3 files changed

+7
-19
lines changed

src/api/enclaved/handlers/recoveryMultisigTransaction.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { SignFinalOptions } from '@bitgo/abstract-eth';
22
import { AbstractUtxoCoin } from '@bitgo/abstract-utxo';
33
import { HalfSignedUtxoTransaction, MethodNotImplementedError, TransactionRecipient } from 'bitgo';
44
import { EnclavedApiSpecRouteRequest } from '../../../enclavedBitgoExpress/routers/enclavedApiSpec';
5+
import { EnvironmentName } from '../../../initConfig';
56
import logger from '../../../logger';
67
import {
78
isEthLikeCoin,
@@ -65,7 +66,7 @@ export async function recoveryMultisigTransaction(
6566
maxPriorityFeePerGas,
6667
},
6768
replayProtectionOptions: getReplayProtectionOptions(
68-
bitgo.env,
69+
bitgo.env as EnvironmentName,
6970
unsignedSweepPrebuildTx.replayProtectionOptions,
7071
),
7172
txPrebuild: {
@@ -77,15 +78,15 @@ export async function recoveryMultisigTransaction(
7778
maxPriorityFeePerGas,
7879
},
7980
replayProtectionOptions: getReplayProtectionOptions(
80-
bitgo.env,
81+
bitgo.env as EnvironmentName,
8182
unsignedSweepPrebuildTx.replayProtectionOptions,
8283
),
8384
},
8485
walletContractAddress,
8586
});
8687

8788
const halfSignedTx = addEthLikeRecoveryExtras({
88-
env: bitgo.env,
89+
env: bitgo.env as EnvironmentName,
8990
signedTx: halfSignedTxBase as SignedEthLikeRecoveryTx,
9091
transaction: unsignedSweepPrebuildTx,
9192
isLastSignature: false,
@@ -115,7 +116,7 @@ export async function recoveryMultisigTransaction(
115116
maxPriorityFeePerGas,
116117
},
117118
replayProtectionOptions: getReplayProtectionOptions(
118-
bitgo.env,
119+
bitgo.env as EnvironmentName,
119120
halfSignedTx?.replayProtectionOptions,
120121
),
121122
} as unknown as SignFinalOptions,

src/api/master/handlers/recoveryWallet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export async function handleRecoveryWalletOnPrem(
146146
coinSpecificParams: undefined,
147147
walletContractAddress,
148148
},
149-
bitgo.env,
149+
bitgo.env as EnvironmentName,
150150
);
151151
}
152152
if (!bitgoPub) {

src/shared/types/index.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,7 @@ export enum AppMode {
88
MASTER_EXPRESS = 'master-express',
99
}
1010

11-
export type EnvironmentName =
12-
| 'prod'
13-
| 'staging'
14-
| 'test'
15-
| 'dev'
16-
| 'local'
17-
| 'localNonSecure'
18-
| 'mock'
19-
| 'adminProd'
20-
| 'adminTest'
21-
| 'adminStaging'
22-
| 'adminDev'
23-
| 'custom'
24-
| 'branch';
11+
export type EnvironmentName = 'prod' | 'test' | 'staging' | 'dev' | 'local';
2512

2613
// Common base configuration shared by both modes
2714
interface BaseConfig {

0 commit comments

Comments
 (0)