Skip to content

Commit 18a6358

Browse files
committed
test: remove accounts.test.ts
1 parent 6a1d472 commit 18a6358

File tree

4 files changed

+4
-64
lines changed

4 files changed

+4
-64
lines changed

packages/multichain-account-service/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,12 @@
6464
"@metamask/providers": "^22.1.0",
6565
"@metamask/snaps-controllers": "^14.0.1",
6666
"@types/jest": "^27.4.1",
67-
"@types/uuid": "^8.3.0",
6867
"deepmerge": "^4.2.2",
6968
"jest": "^27.5.1",
7069
"ts-jest": "^27.1.4",
7170
"typedoc": "^0.24.8",
7271
"typedoc-plugin-missing-exports": "^2.0.0",
7372
"typescript": "~5.2.2",
74-
"uuid": "^8.3.2",
7573
"webextension-polyfill": "^0.12.0"
7674
},
7775
"peerDependencies": {

packages/multichain-account-service/src/tests/accounts.test.ts

Lines changed: 0 additions & 41 deletions
This file was deleted.

packages/multichain-account-service/src/tests/accounts.ts

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
} from '@metamask/keyring-api';
1111
import { KeyringTypes } from '@metamask/keyring-controller';
1212
import type { InternalAccount } from '@metamask/keyring-internal-api';
13-
import { v4 as uuid } from 'uuid';
1413

1514
import { isBip44Account } from '../providers/BaseAccountProvider';
1615

@@ -171,31 +170,17 @@ export class MockAccountBuilder {
171170
return new MockAccountBuilder(account);
172171
}
173172

174-
withUuid() {
175-
this.#account.id = uuid();
176-
return this;
177-
}
178-
179-
withAddressSuffix(suffix: string) {
180-
this.#account.address += suffix;
181-
return this;
182-
}
183-
184173
withEntropySource(entropySource: EntropySourceId) {
185-
if (!isBip44Account(this.#account)) {
186-
throw new Error('Invalid BIP-44 account');
174+
if (isBip44Account(this.#account)) {
175+
this.#account.options.entropy.id = entropySource;
187176
}
188-
189-
this.#account.options.entropy.id = entropySource;
190177
return this;
191178
}
192179

193180
withGroupIndex(groupIndex: number) {
194-
if (!isBip44Account(this.#account)) {
195-
throw new Error('Invalid BIP-44 account');
181+
if (isBip44Account(this.#account)) {
182+
this.#account.options.entropy.groupIndex = groupIndex;
196183
}
197-
198-
this.#account.options.entropy.groupIndex = groupIndex;
199184
return this;
200185
}
201186

yarn.lock

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3826,14 +3826,12 @@ __metadata:
38263826
"@metamask/snaps-utils": "npm:^11.0.0"
38273827
"@metamask/superstruct": "npm:^3.1.0"
38283828
"@types/jest": "npm:^27.4.1"
3829-
"@types/uuid": "npm:^8.3.0"
38303829
deepmerge: "npm:^4.2.2"
38313830
jest: "npm:^27.5.1"
38323831
ts-jest: "npm:^27.1.4"
38333832
typedoc: "npm:^0.24.8"
38343833
typedoc-plugin-missing-exports: "npm:^2.0.0"
38353834
typescript: "npm:~5.2.2"
3836-
uuid: "npm:^8.3.2"
38373835
webextension-polyfill: "npm:^0.12.0"
38383836
peerDependencies:
38393837
"@metamask/accounts-controller": ^31.0.0

0 commit comments

Comments
 (0)