Skip to content

Commit 7e037dc

Browse files
committed
fix: improve multichain scope import
1 parent 5f45182 commit 7e037dc

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

test/jest/mocks.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import {
55
BtcAccountType,
66
isEvmAccountType,
77
EthScope,
8-
BtcScope,
98
SolAccountType,
10-
SolScope,
119
SolMethod,
1210
} from '@metamask/keyring-api';
1311
import { InternalAccount } from '@metamask/keyring-internal-api';
@@ -23,6 +21,7 @@ import {
2321
import { MetaMaskReduxState } from '../../ui/store/store';
2422
import mockState from '../data/mock-state.json';
2523
import { isBtcMainnetAddress } from '../../shared/lib/multichain/accounts';
24+
import { MultichainNetworks } from '../../shared/constants/multichain/networks';
2625

2726
export type MockState = typeof mockState;
2827

@@ -241,12 +240,20 @@ export function createMockInternalAccount({
241240
// If no address is given, we fallback to testnet
242241
const isMainnet = Boolean(address) && isBtcMainnetAddress(address);
243242

244-
scopes = [isMainnet ? BtcScope.Mainnet : BtcScope.Testnet];
243+
scopes = [
244+
isMainnet
245+
? MultichainNetworks.BITCOIN
246+
: MultichainNetworks.BITCOIN_TESTNET,
247+
];
245248
methods = Object.values(BtcMethod);
246249
break;
247250
}
248251
case SolAccountType.DataAccount:
249-
scopes = [SolScope.Mainnet, SolScope.Testnet, SolScope.Devnet];
252+
scopes = [
253+
MultichainNetworks.SOLANA,
254+
MultichainNetworks.SOLANA_TESTNET,
255+
MultichainNetworks.SOLANA_DEVNET,
256+
];
250257
methods = [SolMethod.SendAndConfirmTransaction];
251258
break;
252259
default:

0 commit comments

Comments
 (0)