Skip to content

Commit

Permalink
lint:fix
Browse files Browse the repository at this point in the history
  • Loading branch information
legobeat committed Sep 29, 2023
1 parent 8826e02 commit 0c70e96
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ import {
import { PreferencesController } from '@metamask/preferences-controller';
import HttpProvider from 'ethjs-provider-http';

import { mockNetwork } from '../../../tests/mock-network';
import {
AssetsContractController,
MISSING_PROVIDER_ERROR,
} from './AssetsContractController';
import { SupportedTokenDetectionNetworks } from './assetsUtil';
import { mockNetwork } from '../../../tests/mock-network';

Check failure on line 24 in packages/assets-controllers/src/AssetsContractController.test.ts

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (20.x)

`../../../tests/mock-network` import should occur before import of `./AssetsContractController`

const ERC20_UNI_ADDRESS = '0x1f9840a85d5af5bf1d1762f925bdaddc4201f984';
const ERC20_SAI_ADDRESS = '0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { GWEI } from '@metamask/controller-utils';
import { BN } from 'ethereumjs-util';
import { fromWei } from 'ethjs-unit';

import medianOf from './medianOf';

Check failure on line 5 in packages/gas-fee-controller/src/fetchGasEstimatesViaEthFeeHistory/calculateGasFeeEstimatesForPriorityLevels.ts

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (20.x)

`./medianOf` import should occur after import of `../GasFeeController`
import type { FeeHistoryBlock } from '../fetchBlockFeeHistory';
import type { Eip1559GasFee, GasFeeEstimates } from '../GasFeeController';
import medianOf from './medianOf';

export type PriorityLevel = (typeof PRIORITY_LEVELS)[number];
export type Percentile = (typeof PRIORITY_LEVEL_PERCENTILES)[number];
Expand Down
4 changes: 2 additions & 2 deletions packages/keyring-controller/src/KeyringController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import { bufferToHex } from 'ethereumjs-util';
import * as sinon from 'sinon';
import * as uuid from 'uuid';

import MockEncryptor, { mockKey } from '../tests/mocks/mockEncryptor';
import MockShallowGetAccountsKeyring from '../tests/mocks/mockShallowGetAccountsKeyring';
import type {
KeyringControllerEvents,
KeyringControllerMessenger,
Expand All @@ -36,6 +34,8 @@ import {
KeyringController,
KeyringTypes,
} from './KeyringController';
import MockEncryptor, { mockKey } from '../tests/mocks/mockEncryptor';

Check failure on line 37 in packages/keyring-controller/src/KeyringController.test.ts

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (20.x)

`../tests/mocks/mockEncryptor` import should occur before import of `./KeyringController`
import MockShallowGetAccountsKeyring from '../tests/mocks/mockShallowGetAccountsKeyring';

Check failure on line 38 in packages/keyring-controller/src/KeyringController.test.ts

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (20.x)

`../tests/mocks/mockShallowGetAccountsKeyring` import should occur before import of `./KeyringController`

jest.mock('uuid', () => {
return {
Expand Down
2 changes: 1 addition & 1 deletion packages/name-controller/src/providers/ens.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NameType } from '../types';
import { ENSNameProvider } from './ens';
import { NameType } from '../types';

Check failure on line 2 in packages/name-controller/src/providers/ens.test.ts

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (20.x)

`../types` import should occur before import of `./ens`

jest.mock('../util');

Expand Down
2 changes: 1 addition & 1 deletion packages/name-controller/src/providers/etherscan.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { EtherscanNameProvider } from './etherscan';

Check failure on line 1 in packages/name-controller/src/providers/etherscan.test.ts

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (20.x)

`./etherscan` import should occur after import of `../util`
import { CHAIN_IDS } from '../constants';
import { NameType } from '../types';
import { handleFetch } from '../util';
import { EtherscanNameProvider } from './etherscan';

jest.mock('../util');

Expand Down
2 changes: 1 addition & 1 deletion packages/name-controller/src/providers/lens.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { LensNameProvider } from './lens';

Check failure on line 1 in packages/name-controller/src/providers/lens.test.ts

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (20.x)

`./lens` import should occur after import of `../util`
import { NameType } from '../types';
import { graphQL } from '../util';
import { LensNameProvider } from './lens';

jest.mock('../util');

Expand Down
2 changes: 1 addition & 1 deletion packages/name-controller/src/providers/token.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TokenNameProvider } from './token';

Check failure on line 1 in packages/name-controller/src/providers/token.test.ts

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (20.x)

`./token` import should occur after import of `../util`
import { NameType } from '../types';
import { handleFetch } from '../util';
import { TokenNameProvider } from './token';

jest.mock('../util');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { BUILT_IN_NETWORKS, NetworkType } from '@metamask/controller-utils';
import { promisify } from 'util';

import { mockNetwork } from '../../../tests/mock-network';
import { createAutoManagedNetworkClient } from './create-auto-managed-network-client';
import * as createNetworkClientModule from './create-network-client';
import type {
CustomNetworkClientConfiguration,
InfuraNetworkClientConfiguration,
} from './types';
import { NetworkClientType } from './types';
import { mockNetwork } from '../../../tests/mock-network';

Check failure on line 11 in packages/network-controller/src/create-auto-managed-network-client.test.ts

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (20.x)

`../../../tests/mock-network` import should occur before import of `./create-auto-managed-network-client`

describe('createAutoManagedNetworkClient', () => {
const networkClientConfigurations: [
Expand Down
4 changes: 2 additions & 2 deletions packages/network-controller/tests/NetworkController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import { when, resetAllWhenMocks } from 'jest-when';
import { inspect, isDeepStrictEqual, promisify } from 'util';
import { v4 } from 'uuid';

import { FakeProvider } from './fake-provider';

Check failure on line 17 in packages/network-controller/tests/NetworkController.test.ts

View workflow job for this annotation

GitHub Actions / Lint, build, and test / Lint (20.x)

`./fake-provider` import should occur after import of `../src/types`
import type { FakeProviderStub } from './fake-provider';
import { FakeBlockTracker } from '../../../tests/fake-block-tracker';
import { NetworkStatus } from '../src/constants';
import type { NetworkClient } from '../src/create-network-client';
Expand All @@ -29,8 +31,6 @@ import type {
import { NetworkController } from '../src/NetworkController';
import type { Provider } from '../src/types';
import { NetworkClientType } from '../src/types';
import { FakeProvider } from './fake-provider';
import type { FakeProviderStub } from './fake-provider';

jest.mock('../src/create-network-client');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NetworkClientType } from '../src/types';
import { testsForProviderType } from './provider-api-tests/shared-tests';
import { NetworkClientType } from '../src/types';

for (const clientType of Object.values(NetworkClientType)) {
describe(`createNetworkClient - ${clientType}`, () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { defaultState as networkControllerDefaultState } from '@metamask/network-controller';

import type { SelectedNetworkControllerOptions } from '../src/SelectedNetworkController';
import { SelectedNetworkController } from '../src/SelectedNetworkController';
import {
buildSelectedNetworkControllerMessenger,
buildMessenger,
} from './utils';
import type { SelectedNetworkControllerOptions } from '../src/SelectedNetworkController';
import { SelectedNetworkController } from '../src/SelectedNetworkController';

describe('SelectedNetworkController', () => {
it('can be instantiated with default values', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/* eslint-disable jest/expect-expect */
import type {
AcceptResultCallbacks,
AddResult,
} from '@metamask/approval-controller';
import {
ChainId,
NetworkType,
Expand All @@ -17,12 +21,6 @@ import { errorCodes } from '@metamask/rpc-errors';
import HttpProvider from 'ethjs-provider-http';
import NonceTracker from 'nonce-tracker';

import { FakeBlockTracker } from '../../../tests/fake-block-tracker';
import { mockNetwork } from '../../../tests/mock-network';
import type {
AcceptResultCallbacks,
AddResult,
} from '@metamask/approval-controller';
import { IncomingTransactionHelper } from './IncomingTransactionHelper';
import type {
TransactionControllerMessenger,
Expand All @@ -32,6 +30,8 @@ import { TransactionController } from './TransactionController';
import type { TransactionMeta, DappSuggestedGasFees } from './types';
import { WalletDevice, TransactionStatus, TransactionType } from './types';
import { ESTIMATE_GAS_ERROR } from './utils';
import { FakeBlockTracker } from '../../../tests/fake-block-tracker';
import { mockNetwork } from '../../../tests/mock-network';

const v1Stub = jest
.fn()
Expand Down

0 comments on commit 0c70e96

Please sign in to comment.