Skip to content

Commit

Permalink
update remaining web3 package references
Browse files Browse the repository at this point in the history
  • Loading branch information
andrepatta committed Nov 6, 2023
1 parent 487d911 commit 0af1561
Show file tree
Hide file tree
Showing 89 changed files with 107 additions and 107 deletions.
4 changes: 2 additions & 2 deletions packages/web3-core/test/unit/formatters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import {
import * as formatters from '../../src/formatters';

/* eslint-disable deprecation/deprecation */
jest.mock('web3-eth-iban');
jest.mock('web3-utils');
jest.mock('@etn-sc/web3-eth-iban');
jest.mock('@etn-sc/web3-utils');

describe('formatters', () => {
const toNumberResult = 12345;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import {
type Resolve = (value?: unknown) => void;
const MAX_32_SIGNED_INTEGER = 2147483647;

jest.mock('web3-eth', () => {
const original = jest.requireActual('web3-eth');
jest.mock('@etn-sc/web3-eth', () => {
const original = jest.requireActual('@etn-sc/web3-eth');
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return {
...original,
Expand Down
6 changes: 3 additions & 3 deletions packages/web3-eth-contract/test/unit/contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import { erc721Abi } from '../fixtures/erc721';
import { ERC20TokenAbi } from '../shared_fixtures/build/ERC20Token';
import { processAsync } from '../shared_fixtures/utils';

jest.mock('web3-eth', () => {
const allAutoMocked = jest.createMockFromModule('web3-eth');
const actual = jest.requireActual('web3-eth');
jest.mock('@etn-sc/web3-eth', () => {
const allAutoMocked = jest.createMockFromModule('@etn-sc/web3-eth');
const actual = jest.requireActual('@etn-sc/web3-eth');
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return {
__esModules: true,
Expand Down
8 changes: 4 additions & 4 deletions packages/web3-eth-ens/test/unit/ens.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ import { ENS } from '../../src/ens';

jest.useFakeTimers().setSystemTime(new Date('2020-01-01'));

jest.mock('web3-eth', () => ({
jest.mock('@etn-sc/web3-eth', () => ({
__esModule: true,
isSyncing: jest.fn(),
}));

// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
const { isSyncing } = require('web3-eth');
const { isSyncing } = require('@etn-sc/web3-eth');

const expectedNetworkId = '0x1';
jest.mock('web3-net', () => ({
jest.mock('@etn-sc/web3-net', () => ({
getId: jest.fn(),
}));
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
const { getId } = require('web3-net');
const { getId } = require('@etn-sc/web3-net');

describe('ens', () => {
let object: Web3ContextObject;
Expand Down
6 changes: 3 additions & 3 deletions packages/web3-eth-personal/test/unit/eth_personal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import * as eth from '@etn-sc/web3-eth';
import * as validator from '@etn-sc/web3-validator';
import { Personal } from '../../src/index';

jest.mock('web3-utils');
jest.mock('web3-eth');
jest.mock('web3-validator');
jest.mock('@etn-sc/web3-utils');
jest.mock('@etn-sc/web3-eth');
jest.mock('@etn-sc/web3-validator');
describe('Personal', () => {
let personal: Personal;
let sendSpy: jest.SpyInstance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ import {
} from '@etn-sc/web3-errors';
import { defaultTransactionBuilder } from '../../src/utils/transaction_builder';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');
const expectedNetworkId = '0x4';
jest.mock('web3-net', () => ({
jest.mock('@etn-sc/web3-net', () => ({
getId: jest.fn().mockImplementation(() => expectedNetworkId),
}));

Expand Down
2 changes: 1 addition & 1 deletion packages/web3-eth/test/unit/format_rpc_methods.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import * as rpcMethodWrappers from '../../src/rpc_method_wrappers';
import { getPastLogsValidFormatData } from '../fixtures/web3_eth_methods_with_parameters';
import Web3Eth from '../../src/index';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');
describe('web3_eth_methods formatting', () => {
let web3Eth: Web3Eth;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { call } from '../../../src/rpc_method_wrappers';
import { mockRpcResponse, testData } from './fixtures/call';
import { formatTransaction } from '../../../src';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('call', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { createAccessList } from '../../../src/rpc_method_wrappers';
import { mockRpcResponse, testData } from './fixtures/createAccessList';
import { formatTransaction } from '../../../src';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('createAccessList', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { estimateGas } from '../../../src/rpc_method_wrappers';
import { mockRpcResponse, testData } from './fixtures/estimate_gas';
import { formatTransaction } from '../../../src';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('call', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { ethRpcMethods } from '@etn-sc/web3-rpc-methods';
import { getBalance } from '../../../src/rpc_method_wrappers';
import { mockRpcResponse, testData } from './fixtures/get_balance';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('getBalance', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { getBlock } from '../../../src/rpc_method_wrappers';
import { mockRpcResponse, mockRpcResponseHydrated, testData } from './fixtures/get_block';
import { blockSchema } from '../../../src/schemas';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('getBlock', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { ethRpcMethods } from '@etn-sc/web3-rpc-methods';

import { getBlockNumber } from '../../../src/rpc_method_wrappers';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('getBlockNumber', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { ethRpcMethods } from '@etn-sc/web3-rpc-methods';
import { getBlockTransactionCount } from '../../../src/rpc_method_wrappers';
import { mockRpcResponse, testData } from './fixtures/get_block_transaction_count';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('getBlockTransactionCount', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { ethRpcMethods } from '@etn-sc/web3-rpc-methods';
import { getBlockUncleCount } from '../../../src/rpc_method_wrappers';
import { mockRpcResponse, testData } from './fixtures/get_block_uncle_count';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('getBlockUncleCount', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { ethRpcMethods } from '@etn-sc/web3-rpc-methods';

import { getChainId } from '../../../src/rpc_method_wrappers';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('getChainId', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { ethRpcMethods } from '@etn-sc/web3-rpc-methods';
import { getCode } from '../../../src/rpc_method_wrappers';
import { mockRpcResponse, testData } from './fixtures/get_code';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('getCode', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { ethRpcMethods } from '@etn-sc/web3-rpc-methods';

import { getCoinbase } from '../../../src/rpc_method_wrappers';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('getCoinbase', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { mockRpcResponse, testData } from './fixtures/get_fee_history';
import { feeHistorySchema } from '../../../src/schemas';
import { NUMBER_DATA_FORMAT } from '../../../src/constants';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('getFeeHistory', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { ethRpcMethods } from '@etn-sc/web3-rpc-methods';

import { getGasPrice } from '../../../src/rpc_method_wrappers';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('getGasPrice', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { ethRpcMethods } from '@etn-sc/web3-rpc-methods';

import { getHashRate } from '../../../src/rpc_method_wrappers';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('getHashRate', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { getLogs } from '../../../src/rpc_method_wrappers';
import { mockRpcResponse, testData } from './fixtures/get_logs';
import { logSchema } from '../../../src/schemas';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('getLogs', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { getPendingTransactions } from '../../../src/rpc_method_wrappers';
import { formatTransaction } from '../../../src';
import { mockRpcResponse } from './fixtures/get_pending_transactions';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('getPendingTransactions', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { getProof } from '../../../src/rpc_method_wrappers';
import { mockRpcResponse, testData } from './fixtures/get_proof';
import { accountSchema } from '../../../src/schemas';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('getProof', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { ethRpcMethods } from '@etn-sc/web3-rpc-methods';

import { getProtocolVersion } from '../../../src/rpc_method_wrappers';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('getProtocolVersion', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { ethRpcMethods } from '@etn-sc/web3-rpc-methods';
import { getStorageAt } from '../../../src/rpc_method_wrappers';
import { mockRpcResponse, testData } from './fixtures/get_storage_at';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('getStorageAt', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { getTransaction } from '../../../src/rpc_method_wrappers';
import { mockRpcResponse, testData } from './fixtures/get_transaction';
import { formatTransaction, transactionInfoSchema } from '../../../src';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('getTransaction', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { ethRpcMethods } from '@etn-sc/web3-rpc-methods';
import { getTransactionCount } from '../../../src/rpc_method_wrappers';
import { mockRpcResponse, testData } from './fixtures/get_transaction_count';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('getTransactionCount', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { getTransactionFromBlock } from '../../../src/rpc_method_wrappers';
import { mockRpcResponse, testData } from './fixtures/get_transaction_from_block';
import { formatTransaction, transactionInfoSchema } from '../../../src';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('getTransactionFromBlock', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { getTransactionReceipt } from '../../../src/rpc_method_wrappers';
import { mockRpcResponse, testData } from './fixtures/get_transaction_receipt';
import { transactionReceiptSchema } from '../../../src/schemas';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('getTransactionReceipt', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { getUncle } from '../../../src/rpc_method_wrappers';
import { mockRpcResponse, testData } from './fixtures/get_uncle';
import { blockSchema } from '../../../src/schemas';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('getUncle', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { ethRpcMethods } from '@etn-sc/web3-rpc-methods';

import { isMining } from '../../../src/rpc_method_wrappers';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('isMining', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { ethRpcMethods } from '@etn-sc/web3-rpc-methods';

import { isSyncing } from '../../../src/rpc_method_wrappers';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('isSyncing', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
import { transactionReceiptSchema } from '../../../src/schemas';
import { SendTxHelper } from '../../../src/utils/send_tx_helper';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');
jest.mock('../../../src/utils/wait_for_transaction_receipt');
jest.mock('../../../src/utils/watch_transaction_for_confirmations');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
} from './fixtures/send_transaction';
import { transactionReceiptSchema } from '../../../src/schemas';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');
jest.mock('../../../src/utils/wait_for_transaction_receipt');
jest.mock('../../../src/utils/watch_transaction_for_confirmations');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { mockRpcResponse, testData, walletTestData } from './fixtures/sign';
import { createAccountProvider } from '../../fixtures/system_test_utils';
import { SignatureObjectSchema } from '../../../src/schemas';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('sign', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { signTransaction } from '../../../src/rpc_method_wrappers';
import { returnFormat, testData } from './fixtures/sign_transaction';
import { formatTransaction } from '../../../src';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('signTransaction', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { format } from '@etn-sc/web3-utils';
import { signTypedData } from '../../../src/rpc_method_wrappers';
import { testData, mockRpcResponse } from './fixtures/sign_typed_data';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('signTypedData', () => {
let web3Context: Web3Context<Web3EthExecutionAPI>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
import { transactionReceiptSchema } from '../../../src/schemas';
import { sleep } from '../../shared_fixtures/utils';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');
jest.mock('../../../src/utils/wait_for_transaction_receipt');

const mockBlockData = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
import { transactionReceiptSchema } from '../../../src/schemas';
import { SendSignedTransactionEvents } from '../../../src/types';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');
jest.mock('../../../src/utils/wait_for_transaction_receipt');
jest.mock('../../../src/utils/watch_transaction_by_pooling');
jest.mock('../../../src/utils/watch_transaction_by_subscription');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { ethRpcMethods } from '@etn-sc/web3-rpc-methods';

import Web3Eth from '../../src/index';

jest.mock('web3-rpc-methods');
jest.mock('@etn-sc/web3-rpc-methods');

describe('web3_eth_methods_no_parameters', () => {
let web3Eth: Web3Eth;
Expand Down
Loading

0 comments on commit 0af1561

Please sign in to comment.