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

Commit 5257851

Browse files
committed
fixes, remove unneeded tests (solved by type strictness)
1 parent a780c64 commit 5257851

File tree

3 files changed

+3
-24
lines changed

3 files changed

+3
-24
lines changed

lib/service/ethereumservice.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ const defaultOptions = {
1212
* @memberof module:service
1313
*/
1414
export class EthereumService extends Service {
15-
public config: Config
16-
1715
public flow: FlowControl
1816
public chain: Chain
1917
public interval: number

test/blockchain/chain.spec.ts

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import tape from 'tape'
2-
import { Block, BlockHeader, BlockData, HeaderData } from '@ethereumjs/block'
2+
import { Block, BlockData, HeaderData } from '@ethereumjs/block'
33
import { BN } from 'ethereumjs-util'
44
import { Chain } from '../../lib/blockchain'
55
import { defaultLogger } from '../../lib/logging'
6+
import { Config } from '../../lib/config'
67
defaultLogger.silent = true
78

89
// explicitly import util and buffer,
910
// needed for karma-typescript bundling
1011
import * as util from 'util' //eslint-disable-line @typescript-eslint/no-unused-vars
1112
import { Buffer } from 'buffer' //eslint-disable-line @typescript-eslint/no-unused-vars
12-
import { Config } from '../../lib/config'
1313

1414
tape('[Chain]', (t) => {
1515
t.test('should test blockchain DB is initialized', async (t) => {
@@ -80,26 +80,6 @@ tape('[Chain]', (t) => {
8080
t.end()
8181
})
8282

83-
t.test('should handle bad arguments to putBlocks()', async (t) => {
84-
const chain = new Chain({ config: new Config() }) // eslint-disable-line no-new
85-
await chain.open()
86-
t.notOk(await chain.putBlocks((<unknown>undefined) as Block[]), 'add undefined block')
87-
t.notOk(await chain.putBlocks((<unknown>null) as Block[]), 'add null block')
88-
t.notOk(await chain.putBlocks([]), 'add empty block list')
89-
await chain.close()
90-
t.end()
91-
})
92-
93-
t.test('should handle bad arguments to putHeaders()', async (t) => {
94-
const chain = new Chain({ config: new Config() }) // eslint-disable-line no-new
95-
await chain.open()
96-
t.notOk(await chain.putHeaders((<unknown>undefined) as BlockHeader[]), 'add undefined header')
97-
t.notOk(await chain.putHeaders((<unknown>null) as BlockHeader[]), 'add null header')
98-
t.notOk(await chain.putHeaders([]), 'add empty header list')
99-
await chain.close()
100-
t.end()
101-
})
102-
10383
t.test('should add block to chain', async (t) => {
10484
const chain = new Chain({ config: new Config() }) // eslint-disable-line no-new
10585
await chain.open()

test/net/server/rlpxserver.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ tape('[RlpxServer]', (t) => {
7878
t.test('should return rlpx server info', async (t) => {
7979
const mockId = '123'
8080
const server = new RlpxServer({
81+
config: new Config({ transports: [] }),
8182
bootnodes: '10.0.0.1:1234,10.0.0.2:1234',
8283
})
8384
server.initDpt = td.func()

0 commit comments

Comments
 (0)