Skip to content

Commit

Permalink
Monorepo: adjust removal of default exports in test files
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrocheleau committed Jul 7, 2022
1 parent 49682a0 commit 3c4c031
Show file tree
Hide file tree
Showing 118 changed files with 209 additions and 207 deletions.
6 changes: 3 additions & 3 deletions packages/block/test/block.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as tape from 'tape'
import { NestedUint8Array, toBuffer, zeros } from '@ethereumjs/util'
import RLP from 'rlp'
import Common, { Chain, Hardfork } from '@ethereumjs/common'
import { RLP } from 'rlp'
import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { Block, BlockBuffer } from '../src'
import blockFromRpc from '../src/from-rpc'
import { blockFromRpc } from '../src/from-rpc'
import * as testnetMerge from './testdata/testnetMerge.json'
import * as testDataPreLondon from './testdata/testdata_pre-london.json'
import * as testDataPreLondon2 from './testdata/testdata_pre-london-2.json'
Expand Down
2 changes: 1 addition & 1 deletion packages/block/test/clique.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as tape from 'tape'
import Common, { Chain, Hardfork } from '@ethereumjs/common'
import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { BlockHeader } from '../src/header'
import { Address } from '@ethereumjs/util'

Expand Down
2 changes: 1 addition & 1 deletion packages/block/test/difficulty.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as tape from 'tape'
import Common, { Chain } from '@ethereumjs/common'
import { Chain, Common } from '@ethereumjs/common'
import { bufferToInt } from '@ethereumjs/util'
import { Block } from '../src'

Expand Down
2 changes: 1 addition & 1 deletion packages/block/test/eip1559block.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as tape from 'tape'
import Common, { Chain, Hardfork } from '@ethereumjs/common'
import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { BlockHeader } from '../src/header'
import { Block } from '../src/block'
import { FeeMarketEIP1559Transaction } from '@ethereumjs/tx'
Expand Down
6 changes: 3 additions & 3 deletions packages/block/test/from-rpc.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as tape from 'tape'
import Common, { Chain, Hardfork } from '@ethereumjs/common'
import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { Transaction } from '@ethereumjs/tx'
import blockFromRpc from '../src/from-rpc'
import blockHeaderFromRpc from '../src/header-from-rpc'
import { blockFromRpc } from '../src/from-rpc'
import { blockHeaderFromRpc } from '../src/header-from-rpc'
import * as blockData from './testdata/testdata-from-rpc.json'
import * as blockDataDifficultyAsInteger from './testdata/testdata-from-rpc-difficulty-as-integer.json'
import * as blockDataWithUncles from './testdata/testdata-from-rpc-with-uncles.json'
Expand Down
4 changes: 2 additions & 2 deletions packages/block/test/header.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as tape from 'tape'
import { Address, toBuffer, zeros, KECCAK256_RLP, KECCAK256_RLP_ARRAY } from '@ethereumjs/util'
import RLP from 'rlp'
import Common, { Chain, CliqueConfig, Hardfork } from '@ethereumjs/common'
import { RLP } from 'rlp'
import { Chain, Common, CliqueConfig, Hardfork } from '@ethereumjs/common'
import { BlockHeader } from '../src/header'
import { Block } from '../src'
const blocksMainnet = require('./testdata/blocks_mainnet.json')
Expand Down
2 changes: 1 addition & 1 deletion packages/block/test/mergeBlock.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as tape from 'tape'
import Common, { Chain, Hardfork } from '@ethereumjs/common'
import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { BlockHeader } from '../src/header'
import { Address, KECCAK256_RLP, KECCAK256_RLP_ARRAY, zeros } from '@ethereumjs/util'
import { Block } from '../src/block'
Expand Down
6 changes: 3 additions & 3 deletions packages/blockchain/test/blockValidation.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Block, BlockHeader } from '@ethereumjs/block'
import Common, { Chain, Hardfork } from '@ethereumjs/common'
import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { bufArrToArr } from '@ethereumjs/util'
import { keccak256 } from 'ethereum-cryptography/keccak'
import { bytesToHex } from 'ethereum-cryptography/utils'
import RLP from 'rlp'
import { RLP } from 'rlp'
import * as tape from 'tape'

import Blockchain from '../src'
import { Blockchain } from '../src'
import { createBlock } from './util'

tape('[Blockchain]: Block validation tests', (t) => {
Expand Down
5 changes: 3 additions & 2 deletions packages/blockchain/test/clique.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Block } from '@ethereumjs/block'
import Common, {
import {
Common,
Chain,
CliqueConfig,
ConsensusAlgorithm,
Expand All @@ -8,7 +9,7 @@ import Common, {
} from '@ethereumjs/common'
import { Address } from '@ethereumjs/util'
import * as tape from 'tape'
import Blockchain from '../src'
import { Blockchain } from '../src'
import { CliqueConsensus, CLIQUE_NONCE_AUTH, CLIQUE_NONCE_DROP } from '../src/consensus/clique'

tape('Clique: Initialization', (t) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/blockchain/test/customConsensus.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Block, BlockHeader } from '@ethereumjs/block'
import * as tape from 'tape'
import Blockchain, { Consensus, EthashConsensus } from '../src'
import Common, { Hardfork } from '@ethereumjs/common'
import { Blockchain, Consensus, EthashConsensus } from '../src'
import { Common, Hardfork } from '@ethereumjs/common'

class fibonacciConsensus implements Consensus {
algorithm: string
Expand Down
4 changes: 2 additions & 2 deletions packages/blockchain/test/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Common, { Chain, Hardfork } from '@ethereumjs/common'
import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { Block, BlockHeader, BlockOptions } from '@ethereumjs/block'
import * as tape from 'tape'
import Blockchain from '../src'
import { Blockchain } from '../src'
import { generateBlockchain, generateBlocks, isConsecutive, createTestDB } from './util'
import * as testDataPreLondon from './testdata/testdata_pre-london.json'
import * as blocksData from './testdata/blocks_mainnet.json'
Expand Down
4 changes: 2 additions & 2 deletions packages/blockchain/test/pos.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as tape from 'tape'
import { Block } from '@ethereumjs/block'
import Common, { Hardfork } from '@ethereumjs/common'
import Blockchain from '../src'
import { Common, Hardfork } from '@ethereumjs/common'
import { Blockchain } from '../src'
import * as testnet from './testdata/testnet.json'

const buildChain = async (blockchain: Blockchain, common: Common, height: number) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/blockchain/test/reorg.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Common, { Chain, Hardfork } from '@ethereumjs/common'
import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { Block } from '@ethereumjs/block'
import { Address } from '@ethereumjs/util'
import * as tape from 'tape'
import Blockchain from '../src'
import { Blockchain } from '../src'
import { CliqueConsensus, CLIQUE_NONCE_AUTH } from '../src/consensus/clique'
import { generateConsecutiveBlock } from './util'

Expand Down
2 changes: 1 addition & 1 deletion packages/client/test/blockchain/chain.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as tape from 'tape'
import { Block, BlockData, HeaderData } from '@ethereumjs/block'
import Blockchain from '@ethereumjs/blockchain'
import { Blockchain } from '@ethereumjs/blockchain'
import { Chain } from '../../lib/blockchain'
import { Config } from '../../lib/config'

Expand Down
2 changes: 1 addition & 1 deletion packages/client/test/client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ tape('[EthereumClient]', async (t) => {
td.when(Server.prototype.stop()).thenResolve()
td.when(Server.prototype.bootstrap()).thenResolve()

const { default: EthereumClient } = await import('../lib/client')
const { EthereumClient } = await import('../lib/client')

t.test('should initialize correctly', (t) => {
const config = new Config({ transports: [] })
Expand Down
2 changes: 1 addition & 1 deletion packages/client/test/config.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as tape from 'tape'
import { Config, DataDirectory } from '../lib/config'
import Common, { Chain } from '@ethereumjs/common'
import { Chain, Common } from '@ethereumjs/common'

tape('[Config]', (t) => {
t.test('Initialization with default parameters', (t) => {
Expand Down
6 changes: 3 additions & 3 deletions packages/client/test/execution/vmexecution.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as tape from 'tape'
import Blockchain from '@ethereumjs/blockchain'
import Common, { Chain as ChainEnum, Hardfork } from '@ethereumjs/common'
import VM from '@ethereumjs/vm'
import { Blockchain } from '@ethereumjs/blockchain'
import { Chain as ChainEnum, Common, Hardfork } from '@ethereumjs/common'
import { VM } from '@ethereumjs/vm'
import { Config } from '../../lib/config'
import { Chain } from '../../lib/blockchain'
import { VMExecution } from '../../lib/execution'
Expand Down
2 changes: 1 addition & 1 deletion packages/client/test/integration/beaconsync.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as tape from 'tape'
import Common from '@ethereumjs/common'
import { Common } from '@ethereumjs/common'
import { Event } from '../../lib/types'
import * as genesisJSON from '../testdata/geth-genesis/post-merge.json'
import { parseCustomParams } from '../../lib/util'
Expand Down
4 changes: 2 additions & 2 deletions packages/client/test/integration/client.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as tape from 'tape'
import { Config, SyncMode } from '../../lib/config'
import EthereumClient from '../../lib/client'
import { EthereumClient } from '../../lib/client'
import { Event } from '../../lib/types'
import MockServer from './mocks/mockserver'
import { MockServer } from './mocks/mockserver'

tape('[Integration:EthereumClient]', (t) => {
const serverConfig = new Config()
Expand Down
6 changes: 3 additions & 3 deletions packages/client/test/integration/fullethereumservice.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as tape from 'tape'
import Blockchain from '@ethereumjs/blockchain'
import { Blockchain } from '@ethereumjs/blockchain'
import { FeeMarketEIP1559Transaction } from '@ethereumjs/tx'
import { Block } from '@ethereumjs/block'
import { Account, toBuffer } from '@ethereumjs/util'
import { Config } from '../../lib/config'
import { FullEthereumService } from '../../lib/service'
import { Event } from '../../lib/types'
import MockServer from './mocks/mockserver'
import MockChain from './mocks/mockchain'
import { MockServer } from './mocks/mockserver'
import { MockChain } from './mocks/mockchain'
import { destroy } from './util'

const config = new Config()
Expand Down
7 changes: 4 additions & 3 deletions packages/client/test/integration/merge.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as tape from 'tape'
import Blockchain, { CliqueConsensus } from '@ethereumjs/blockchain'
import Common, {
import { Blockchain, CliqueConsensus } from '@ethereumjs/blockchain'
import {
Common,
Chain as ChainCommon,
ConsensusType,
ConsensusAlgorithm,
Expand All @@ -11,7 +12,7 @@ import { Config } from '../../lib/config'
import { Chain } from '../../lib/blockchain'
import { FullEthereumService } from '../../lib/service'
import { Event } from '../../lib/types'
import MockServer from './mocks/mockserver'
import { MockServer } from './mocks/mockserver'
import { setup, destroy } from './util'
import { BlockHeader } from '@ethereumjs/block'

Expand Down
7 changes: 4 additions & 3 deletions packages/client/test/integration/miner.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as tape from 'tape'
import Blockchain, { CliqueConsensus } from '@ethereumjs/blockchain'
import Common, {
import { Blockchain, CliqueConsensus } from '@ethereumjs/blockchain'
import {
Common,
Chain as ChainCommon,
ConsensusType,
ConsensusAlgorithm,
Expand All @@ -11,7 +12,7 @@ import { Config } from '../../lib/config'
import { Chain } from '../../lib/blockchain'
import { FullEthereumService } from '../../lib/service'
import { Event } from '../../lib/types'
import MockServer from './mocks/mockserver'
import { MockServer } from './mocks/mockserver'
import { setup, destroy } from './util'

tape('[Integration:Miner]', async (t) => {
Expand Down
6 changes: 3 additions & 3 deletions packages/client/test/integration/peerpool.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as tape from 'tape'
import Blockchain from '@ethereumjs/blockchain'
import { Blockchain } from '@ethereumjs/blockchain'
import { Config } from '../../lib/config'
import { Event } from '../../lib/types'
import { EthProtocol } from '../../lib/net/protocol'
import { PeerPool } from '../../lib/net/peerpool'
import MockServer from './mocks/mockserver'
import MockChain from './mocks/mockchain'
import { MockServer } from './mocks/mockserver'
import { MockChain } from './mocks/mockchain'
import { wait } from './util'

tape('[Integration:PeerPool]', async (t) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/client/test/miner/miner.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as tape from 'tape'
import * as td from 'testdouble'
import Common, { Chain as CommonChain, Hardfork } from '@ethereumjs/common'
import { Chain as CommonChain, Common, Hardfork } from '@ethereumjs/common'
import { FeeMarketEIP1559Transaction, Transaction } from '@ethereumjs/tx'
import { Block, BlockHeader } from '@ethereumjs/block'
import { Address } from '@ethereumjs/util'
import { keccak256 } from 'ethereum-cryptography/keccak'
import { CliqueConsensus } from '@ethereumjs/blockchain'
import VM from '@ethereumjs/vm'
import { VM } from '@ethereumjs/vm'
import { VmState } from '@ethereumjs/vm/dist/eei/vmState'

import { Config } from '../../lib/config'
Expand Down
4 changes: 2 additions & 2 deletions packages/client/test/miner/pendingBlock.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as tape from 'tape'
import * as td from 'testdouble'
import Common, { Chain as CommonChain, Hardfork } from '@ethereumjs/common'
import { Chain as CommonChain, Common, Hardfork } from '@ethereumjs/common'
import { Transaction } from '@ethereumjs/tx'
import { BlockHeader } from '@ethereumjs/block'
import VM from '@ethereumjs/vm'
import { VM } from '@ethereumjs/vm'
import { Address, Account } from '@ethereumjs/util'
import { Config } from '../../lib/config'
import { TxPool } from '../../lib/service/txpool'
Expand Down
2 changes: 1 addition & 1 deletion packages/client/test/net/peerpool.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { EventEmitter } from 'events'
import { Config } from '../../lib/config'
import { RlpxServer } from '../../lib/net/server'
import { Event } from '../../lib/types'
import MockPeer from '../integration/mocks/mockpeer'
import { MockPeer } from '../integration/mocks/mockpeer'

tape('[PeerPool]', async (t) => {
const Peer = td.replace('../../lib/net/peer/peer', function (this: any, id: string) {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/test/net/protocol/ethprotocol.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as tape from 'tape'
import { Block } from '@ethereumjs/block'
import Common, { Hardfork } from '@ethereumjs/common'
import { Common, Hardfork } from '@ethereumjs/common'
import { FeeMarketEIP1559Transaction } from '@ethereumjs/tx'
import { Chain } from '../../../lib/blockchain/chain'
import { Config } from '../../../lib/config'
Expand Down
4 changes: 2 additions & 2 deletions packages/client/test/rpc/eth/call.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as tape from 'tape'
import { Block } from '@ethereumjs/block'
import Blockchain from '@ethereumjs/blockchain'
import Common, { Chain, Hardfork } from '@ethereumjs/common'
import { Blockchain } from '@ethereumjs/blockchain'
import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { Transaction } from '@ethereumjs/tx'
import { Address, bigIntToHex, bufferToHex } from '@ethereumjs/util'
import { INVALID_PARAMS } from '../../../lib/rpc/error-code'
Expand Down
2 changes: 1 addition & 1 deletion packages/client/test/rpc/eth/chainId.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as tape from 'tape'
import Common, { Chain } from '@ethereumjs/common'
import { Chain, Common } from '@ethereumjs/common'
import { baseSetup, params, baseRequest, createClient, createManager, startRPC } from '../helpers'
import { BlockHeader } from '@ethereumjs/block'
import * as td from 'testdouble'
Expand Down
4 changes: 2 additions & 2 deletions packages/client/test/rpc/eth/estimateGas.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as tape from 'tape'
import { Block } from '@ethereumjs/block'
import Blockchain from '@ethereumjs/blockchain'
import Common, { Chain, Hardfork } from '@ethereumjs/common'
import { Blockchain } from '@ethereumjs/blockchain'
import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { Transaction } from '@ethereumjs/tx'
import { Address, bigIntToHex } from '@ethereumjs/util'
import { INVALID_PARAMS } from '../../../lib/rpc/error-code'
Expand Down
4 changes: 2 additions & 2 deletions packages/client/test/rpc/eth/getBalance.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as tape from 'tape'
import { Block } from '@ethereumjs/block'
import Blockchain from '@ethereumjs/blockchain'
import Common, { Chain, Hardfork } from '@ethereumjs/common'
import { Blockchain } from '@ethereumjs/blockchain'
import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { Transaction } from '@ethereumjs/tx'
import { Address, bigIntToHex } from '@ethereumjs/util'
import { INVALID_PARAMS } from '../../../lib/rpc/error-code'
Expand Down
4 changes: 2 additions & 2 deletions packages/client/test/rpc/eth/getCode.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as tape from 'tape'
import { Block } from '@ethereumjs/block'
import Blockchain from '@ethereumjs/blockchain'
import Common, { Chain, Hardfork } from '@ethereumjs/common'
import { Blockchain } from '@ethereumjs/blockchain'
import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { Transaction } from '@ethereumjs/tx'
import { Address } from '@ethereumjs/util'
import { INVALID_PARAMS } from '../../../lib/rpc/error-code'
Expand Down
4 changes: 2 additions & 2 deletions packages/client/test/rpc/eth/getProof.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as tape from 'tape'
import { Block } from '@ethereumjs/block'
import Blockchain from '@ethereumjs/blockchain'
import Common, { Chain, Hardfork } from '@ethereumjs/common'
import { Blockchain } from '@ethereumjs/blockchain'
import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { Transaction } from '@ethereumjs/tx'
import { Address, bigIntToHex } from '@ethereumjs/util'
import { startRPC, createManager, createClient, params, baseRequest } from '../helpers'
Expand Down
4 changes: 2 additions & 2 deletions packages/client/test/rpc/eth/getStorageAt.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as tape from 'tape'
import { Block } from '@ethereumjs/block'
import Blockchain from '@ethereumjs/blockchain'
import Common, { Chain, Hardfork } from '@ethereumjs/common'
import { Blockchain } from '@ethereumjs/blockchain'
import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { Transaction } from '@ethereumjs/tx'
import { keccak256 } from 'ethereum-cryptography/keccak'
import { Address, bigIntToHex, bufferToHex, toBuffer } from '@ethereumjs/util'
Expand Down
4 changes: 2 additions & 2 deletions packages/client/test/rpc/eth/getTransactionCount.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as tape from 'tape'
import { Block } from '@ethereumjs/block'
import Blockchain from '@ethereumjs/blockchain'
import Common, { Chain, Hardfork } from '@ethereumjs/common'
import { Blockchain } from '@ethereumjs/blockchain'
import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { Transaction } from '@ethereumjs/tx'
import { Address } from '@ethereumjs/util'
import { INVALID_PARAMS } from '../../../lib/rpc/error-code'
Expand Down
2 changes: 1 addition & 1 deletion packages/client/test/rpc/eth/sendRawTransaction.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as tape from 'tape'
import { FeeMarketEIP1559Transaction, Transaction } from '@ethereumjs/tx'
import Common, { Chain, Hardfork } from '@ethereumjs/common'
import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { toBuffer } from '@ethereumjs/util'
import { INTERNAL_ERROR, INVALID_PARAMS, PARSE_ERROR } from '../../../lib/rpc/error-code'
import { baseSetup, params, baseRequest } from '../helpers'
Expand Down
Loading

0 comments on commit 3c4c031

Please sign in to comment.