Skip to content
This repository has been archived by the owner on Dec 10, 2020. It is now read-only.

Commit

Permalink
Merge pull request #152 from ethereumjs/upgrade/config-typescript
Browse files Browse the repository at this point in the history
Upgrade to @ethereumjs/config-typescript
  • Loading branch information
holgerd77 committed Oct 23, 2020
2 parents b45a1bf + 34bbec0 commit b4d885b
Show file tree
Hide file tree
Showing 50 changed files with 92 additions and 91 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"devDependencies": {
"@babel/plugin-transform-spread": "^7.10.1",
"@ethereumjs/config-coverage": "^2.0.0",
"@ethereumjs/config-tsc": "^1.1.0",
"@ethereumjs/config-typescript": "^2.0.0",
"@polkadot/ts": "^0.3.48",
"@types/node": "^14.11.5",
"@types/tape": "^4.13.0",
Expand Down
2 changes: 1 addition & 1 deletion test/blockchain/chain.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tape from 'tape'
import tape from 'tape'
const Block = require('ethereumjs-block')
const { toBuffer } = require('ethereumjs-util')
const { Chain } = require('../../lib/blockchain')
Expand Down
2 changes: 1 addition & 1 deletion test/integration/fastethereumservice.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tape from 'tape'
import tape from 'tape'
import { FastEthereumService } from '../../lib/service'
import MockServer from './mocks/mockserver'
import MockChain from './mocks/mockchain'
Expand Down
2 changes: 1 addition & 1 deletion test/integration/fastsync.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tape from 'tape'
import tape from 'tape'
import { FastEthereumService } from '../../lib/service'
import MockServer from './mocks/mockserver'
import MockChain from './mocks/mockchain'
Expand Down
2 changes: 1 addition & 1 deletion test/integration/lightethereumservice.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tape from 'tape'
import tape from 'tape'
import { LightEthereumService } from '../../lib/service'
import MockServer from './mocks/mockserver'
import MockChain from './mocks/mockchain'
Expand Down
2 changes: 1 addition & 1 deletion test/integration/lightsync.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tape from 'tape'
import tape from 'tape'
import { FastEthereumService, LightEthereumService } from '../../lib/service'
import MockServer from './mocks/mockserver'
import MockChain from './mocks/mockchain'
Expand Down
2 changes: 1 addition & 1 deletion test/integration/node.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tape from 'tape'
import tape from 'tape'
import Node from '../../lib/node'
import MockServer from './mocks/mockserver'
import { defaultLogger } from '../../lib/logging'
Expand Down
2 changes: 1 addition & 1 deletion test/integration/peerpool.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tape from 'tape'
import tape from 'tape'
import { EthProtocol } from '../../lib/net/protocol'
import { PeerPool } from '../../lib/net/peerpool'
import MockServer from './mocks/mockserver'
Expand Down
2 changes: 1 addition & 1 deletion test/logging.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tape from 'tape'
import tape from 'tape'
const { getLogger } = require('../lib/logging')

tape('[Logging]', t => {
Expand Down
2 changes: 1 addition & 1 deletion test/net/peer/libp2pnode.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tape from 'tape-catch'
import tape from 'tape-catch'
const td = require('testdouble')
// const Libp2pNode = require('../../../lib/net/peer/libp2pnode')

Expand Down
2 changes: 1 addition & 1 deletion test/net/peer/peer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tape from 'tape-catch'
import tape from 'tape-catch'
const td = require('testdouble')
import { Peer } from '../../../lib/net/peer'
import * as events from 'events'
Expand Down
4 changes: 2 additions & 2 deletions test/net/peer/rlpxpeer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tape from 'tape-catch'
import tape from 'tape-catch'
const td = require('testdouble')
import { EventEmitter } from 'events'
import { RlpxPeer } from '../../../lib/net/peer/rlpxpeer'
Expand All @@ -23,7 +23,7 @@ tape.skip('[RlpxPeer]', t => {
})

// TODO: disabled for typescript transition. Test case not reproduceable with
// necessary Protocol instantiations due to protocol type addition to RlpxPeer.capabilities()
// necessary Protocol instantiations due to protocol type addition to RlpxPeer.capabilities()
/*t.test('should compute capabilities', t => {
const protocols = [ { name: 'eth', versions: [62, 63] }, { name: 'les', versions: [2] } ]
const caps = RlpxPeer.capabilities(protocols).map(
Expand Down
2 changes: 1 addition & 1 deletion test/net/peerpool.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tape from 'tape-catch'
import tape from 'tape-catch'
const td = require('testdouble')
import { EventEmitter } from 'events'
import { defaultLogger } from '../../lib/logging'
Expand Down
2 changes: 1 addition & 1 deletion test/net/protocol/boundprotocol.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tape from 'tape-catch'
import tape from 'tape-catch'
const td = require('testdouble')
import { EventEmitter } from 'events'
import { Sender } from '../../../lib/net/protocol/sender'
Expand Down
2 changes: 1 addition & 1 deletion test/net/protocol/ethprotocol.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tape from 'tape-catch'
import tape from 'tape-catch'
import { Chain } from '../../../lib/blockchain/chain'
const { EthProtocol } = require('../../../lib/net/protocol')

Expand Down
2 changes: 1 addition & 1 deletion test/net/protocol/flowcontrol.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tape from 'tape-catch'
import tape from 'tape-catch'
const td = require('testdouble')
const timers = require('testdouble-timers').default
const { FlowControl } = require('../../../lib/net/protocol')
Expand Down
2 changes: 1 addition & 1 deletion test/net/protocol/lesprotocol.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tape from 'tape-catch'
import tape from 'tape-catch'
import { Chain } from '../../../lib/blockchain'
const { LesProtocol } = require('../../../lib/net/protocol')
const BN = require('bn.js')
Expand Down
2 changes: 1 addition & 1 deletion test/net/protocol/libp2psender.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tape from 'tape-catch'
import tape from 'tape-catch'
const pull = require('pull-stream')
const DuplexPair = require('pull-pair/duplex')
const { Libp2pSender } = require('../../../lib/net/protocol')
Expand Down
2 changes: 1 addition & 1 deletion test/net/protocol/protocol.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tape from 'tape-catch'
import tape from 'tape-catch'
const td = require('testdouble')
import { EventEmitter } from 'events'
import { Sender } from '../../../lib/net/protocol/sender'
Expand Down
2 changes: 1 addition & 1 deletion test/net/protocol/rlpxsender.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tape from 'tape-catch'
import tape from 'tape-catch'
const td = require('testdouble')
const { RlpxSender } = require('../../../lib/net/protocol')
const EventEmitter = require('events')
Expand Down
2 changes: 1 addition & 1 deletion test/net/protocol/sender.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tape from 'tape-catch'
import tape from 'tape-catch'
const { Sender } = require('../../../lib/net/protocol')

tape('[Sender]', t => {
Expand Down
2 changes: 1 addition & 1 deletion test/net/server/libp2pserver.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tape from 'tape-catch'
import tape from 'tape-catch'
const td = require('testdouble')
// const EventEmitter = require('events')
const { defaultLogger } = require('../../../lib/logging')
Expand Down
2 changes: 1 addition & 1 deletion test/net/server/rlpxserver.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tape from 'tape-catch'
import tape from 'tape-catch'
const td = require('testdouble')
const EventEmitter = require('events')
import { RlpxServer } from '../../../lib/net/server/rlpxserver'
Expand Down
2 changes: 1 addition & 1 deletion test/node.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tape from 'tape-catch'
import tape from 'tape-catch'
const td = require('testdouble')
const EventEmitter = require('events')
const { defaultLogger } = require('../lib/logging')
Expand Down
14 changes: 7 additions & 7 deletions test/rpc/eth/getBlockByHash.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as test from 'tape'
import tape from 'tape'
import { INVALID_PARAMS } from '../../../lib/rpc/error-code'
import { baseSetup, params, baseRequest } from '../helpers'
import { checkError } from '../util'

const method = 'eth_getBlockByHash'

test(`${method}: call with valid arguments`, t => {
tape(`${method}: call with valid arguments`, t => {
const server = baseSetup()

const req = params(method, [
Expand All @@ -19,7 +19,7 @@ test(`${method}: call with valid arguments`, t => {
baseRequest(t, server, req, 200, expectRes)
})

test(`${method}: call with false for second argument`, t => {
tape(`${method}: call with false for second argument`, t => {
const server = baseSetup()

const req = params(method, [
Expand All @@ -35,7 +35,7 @@ test(`${method}: call with false for second argument`, t => {
baseRequest(t, server, req, 200, expectRes)
})

test(`${method}: call with invalid block hash without 0x`, t => {
tape(`${method}: call with invalid block hash without 0x`, t => {
const server = baseSetup()

const req = params(method, ['WRONG BLOCK NUMBER', true])
Expand All @@ -47,7 +47,7 @@ test(`${method}: call with invalid block hash without 0x`, t => {
baseRequest(t, server, req, 200, expectRes)
})

test(`${method}: call with invalid hex string as block hash`, t => {
tape(`${method}: call with invalid hex string as block hash`, t => {
const server = baseSetup()

const req = params(method, ['0xWRONG BLOCK NUMBER', true])
Expand All @@ -59,7 +59,7 @@ test(`${method}: call with invalid hex string as block hash`, t => {
baseRequest(t, server, req, 200, expectRes)
})

test('call eth_getBlockByHash without second parameter', t => {
tape('call eth_getBlockByHash without second parameter', t => {
const server = baseSetup()

const req = params(method, ['0x0'])
Expand All @@ -71,7 +71,7 @@ test('call eth_getBlockByHash without second parameter', t => {
baseRequest(t, server, req, 200, expectRes)
})

test('call eth_getBlockByHash with invalid second parameter', t => {
tape('call eth_getBlockByHash with invalid second parameter', t => {
const server = baseSetup()

const req = params(method, ['0x0', 'INVALID PARAMETER'])
Expand Down
12 changes: 6 additions & 6 deletions test/rpc/eth/getBlockByNumber.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as test from 'tape'
import tape from 'tape'
import { INVALID_PARAMS } from '../../../lib/rpc/error-code'
import { startRPC, createManager, createNode, params, baseRequest } from '../helpers'
import { checkError } from '../util'
Expand All @@ -19,7 +19,7 @@ function createBlockchain () {

const method = 'eth_getBlockByNumber'

test(`${method}: call with valid arguments`, t => {
tape(`${method}: call with valid arguments`, t => {
const manager = createManager(createNode({ blockchain: createBlockchain() }))
const server = startRPC(manager.getMethods())

Expand All @@ -35,7 +35,7 @@ test(`${method}: call with valid arguments`, t => {
baseRequest(t, server, req, 200, expectRes)
})

test(`${method}: call with false for second argument`, t => {
tape(`${method}: call with false for second argument`, t => {
const manager = createManager(createNode({ blockchain: createBlockchain() }))
const server = startRPC(manager.getMethods())

Expand All @@ -57,7 +57,7 @@ test(`${method}: call with false for second argument`, t => {
baseRequest(t, server, req, 200, expectRes)
})

test(`${method}: call with invalid block number`, t => {
tape(`${method}: call with invalid block number`, t => {
const manager = createManager(createNode({ blockchain: createBlockchain() }))
const server = startRPC(manager.getMethods())

Expand All @@ -70,7 +70,7 @@ test(`${method}: call with invalid block number`, t => {
baseRequest(t, server, req, 200, expectRes)
})

test(`${method}: call without second parameter`, t => {
tape(`${method}: call without second parameter`, t => {
const manager = createManager(createNode({ blockchain: createBlockchain() }))
const server = startRPC(manager.getMethods())

Expand All @@ -83,7 +83,7 @@ test(`${method}: call without second parameter`, t => {
baseRequest(t, server, req, 200, expectRes)
})

test(`${method}: call with invalid second parameter`, t => {
tape(`${method}: call with invalid second parameter`, t => {
const manager = createManager(createNode({ blockchain: createBlockchain() }))
const server = startRPC(manager.getMethods())

Expand Down
4 changes: 2 additions & 2 deletions test/rpc/eth/getBlockNumber.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as test from 'tape'
import tape from 'tape'
import { toBuffer, intToHex } from 'ethereumjs-util'
import { startRPC, createManager, createNode, params, baseRequest } from '../helpers'

const method = 'eth_blockNumber'

test(`${method}: call with valid arguments`, t => {
tape(`${method}: call with valid arguments`, t => {
const mockBlockNumber = 123
const mockBlockChain = {
getLatestHeader: () => {
Expand Down
12 changes: 6 additions & 6 deletions test/rpc/eth/getBlockTransactionCountByHash.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as test from 'tape'
import tape from 'tape'
import { INVALID_PARAMS } from '../../../lib/rpc/error-code'
import { baseSetup, params, baseRequest } from '../helpers'
import { checkError } from '../util'

const method = 'eth_getBlockTransactionCountByHash'

test(`${method}: call with valid arguments`, t => {
tape(`${method}: call with valid arguments`, t => {
const server = baseSetup()

const req = params(method, [
Expand All @@ -22,7 +22,7 @@ test(`${method}: call with valid arguments`, t => {
baseRequest(t, server, req, 200, expectRes)
})

test(`${method}: call with invalid block hash without 0x`, t => {
tape(`${method}: call with invalid block hash without 0x`, t => {
const server = baseSetup()

const req = params(method, ['WRONG BLOCK NUMBER'])
Expand All @@ -34,7 +34,7 @@ test(`${method}: call with invalid block hash without 0x`, t => {
baseRequest(t, server, req, 200, expectRes)
})

test(`${method}: call with invalid hex string as block hash`, t => {
tape(`${method}: call with invalid hex string as block hash`, t => {
const server = baseSetup()

const req = params(method, ['0xWRONG BLOCK NUMBER', true])
Expand All @@ -46,7 +46,7 @@ test(`${method}: call with invalid hex string as block hash`, t => {
baseRequest(t, server, req, 200, expectRes)
})

test(`${method}: call without first parameter`, t => {
tape(`${method}: call without first parameter`, t => {
const server = baseSetup()

const req = params(method, [])
Expand All @@ -58,7 +58,7 @@ test(`${method}: call without first parameter`, t => {
baseRequest(t, server, req, 200, expectRes)
})

test(`${method}: call with invalid second parameter`, t => {
tape(`${method}: call with invalid second parameter`, t => {
const server = baseSetup()

const req = params(method, ['INVALID PARAMETER'])
Expand Down
4 changes: 2 additions & 2 deletions test/rpc/eth/protocolVersion.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as test from 'tape'
import tape from 'tape'
import { baseSetup, params, baseRequest } from '../helpers'

const method = 'eth_protocolVersion'

test(`${method}: call`, t => {
tape(`${method}: call`, t => {
const server = baseSetup()

const req = params(method, [])
Expand Down
2 changes: 1 addition & 1 deletion test/rpc/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as tape from 'tape'
import tape from 'tape'
const jayson = require('jayson')
const request = require('supertest')
import Common from 'ethereumjs-common'
Expand Down
6 changes: 3 additions & 3 deletions test/rpc/net/listening.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as test from 'tape'
import tape from 'tape'
import { startRPC, createManager, createNode, params, baseRequest } from '../helpers'

const method = 'net_listening'

test(`${method}: call while listening`, t => {
tape(`${method}: call while listening`, t => {
const manager = createManager(createNode({ opened: true }))
const server = startRPC(manager.getMethods())

Expand All @@ -27,7 +27,7 @@ test(`${method}: call while listening`, t => {
baseRequest(t, server, req, 200, expectRes)
})

test(`${method}: call while not listening`, t => {
tape(`${method}: call while not listening`, t => {
const manager = createManager(createNode({ opened: false }))
const server = startRPC(manager.getMethods())

Expand Down
4 changes: 2 additions & 2 deletions test/rpc/net/peerCount.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as test from 'tape'
import tape from 'tape'
import { startRPC, createManager, createNode, params, baseRequest } from '../helpers'

const method = 'net_peerCount'

test(`${method}: call`, t => {
tape(`${method}: call`, t => {
const manager = createManager(createNode({ opened: true }))
const server = startRPC(manager.getMethods())

Expand Down
Loading

0 comments on commit b4d885b

Please sign in to comment.