Skip to content

Commit a6aef0d

Browse files
committed
fix: improve UT code
1 parent 4886358 commit a6aef0d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/keyring-eth-simple/src/simple-keyring-v2.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ describe('SimpleKeyringV2', () => {
126126
legacyKeyring: newInner,
127127
});
128128

129-
await newInner.deserialize([TEST_PRIVATE_KEY_1, TEST_PRIVATE_KEY_2]);
129+
await newWrapper.deserialize([TEST_PRIVATE_KEY_1, TEST_PRIVATE_KEY_2]);
130130

131-
const accounts = await newWrapper.getAccounts();
131+
const accounts = await newInner.getAccounts();
132132
expect(accounts).toHaveLength(2);
133133
});
134134

@@ -227,7 +227,8 @@ describe('SimpleKeyringV2', () => {
227227
it('throws error for unsupported account creation type', async () => {
228228
await expect(
229229
wrapper.createAccounts({
230-
type: 'private-key:generate' as any,
230+
// @ts-expect-error Testing invalid type
231+
type: 'private-key:generate',
231232
accountType: EthAccountType.Eoa,
232233
encoding: PrivateKeyEncoding.Hexadecimal,
233234
privateKey: TEST_PRIVATE_KEY_1,
@@ -613,7 +614,7 @@ describe('SimpleKeyringV2', () => {
613614
await expect(
614615
wrapper.exportAccount(accountId, {
615616
type: 'private-key',
616-
encoding: 'base58' as any,
617+
encoding: PrivateKeyEncoding.Base58,
617618
}),
618619
).rejects.toThrow('Unsupported encoding for SimpleKeyring: base58. Only');
619620
});

0 commit comments

Comments
 (0)