Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewwalsh0 committed Feb 14, 2025
1 parent 7ac23a6 commit 48cae7b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/keyring-controller/src/KeyringController.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Chain, Common, Hardfork } from '@ethereumjs/common';
import type { TypedTxData } from '@ethereumjs/tx';
import { TransactionFactory } from '@ethereumjs/tx';
import { CryptoHDKey, ETHSignature } from '@keystonehq/bc-ur-registry-eth';
import { MetaMaskKeyring as QRKeyring } from '@keystonehq/metamask-airgapped-keyring';
Expand Down Expand Up @@ -1867,10 +1868,9 @@ describe('KeyringController', () => {
it('should sign transaction', async () => {
await withController(async ({ controller, initialState }) => {
const account = initialState.keyrings[0].accounts[0];
const txParams = {
const txParams: TypedTxData = {
chainId: 5,
data: '0x1',
from: account,
gasLimit: '0x5108',
gasPrice: '0x5108',
to: '0x51253087e6f8358b5f10c0a94315d69db3357859',
Expand All @@ -1891,13 +1891,11 @@ describe('KeyringController', () => {
});

it('should not sign transaction if from account is not provided', async () => {
await withController(async ({ controller, initialState }) => {
await withController(async ({ controller }) => {
await expect(async () => {
const account = initialState.keyrings[0].accounts[0];
const txParams = {
const txParams: TypedTxData = {
chainId: 5,
data: '0x1',
from: account,
gasLimit: '0x5108',
gasPrice: '0x5108',
to: '0x51253087e6f8358b5f10c0a94315d69db3357859',
Expand Down Expand Up @@ -3877,7 +3875,7 @@ describe('KeyringController', () => {
}
});
// TODO: Either fix this lint violation or explain why it's necessary to ignore.
// eslint-disable-next-line @typescript-eslint/no-misused-promises

messenger.subscribe('KeyringController:stateChange', listener);

await controller.submitPassword(password);
Expand Down

0 comments on commit 48cae7b

Please sign in to comment.