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

Commit

Permalink
fixes, remove unneeded tests (solved by type strictness)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanio committed Nov 10, 2020
1 parent a780c64 commit 5257851
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 24 deletions.
2 changes: 0 additions & 2 deletions lib/service/ethereumservice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ const defaultOptions = {
* @memberof module:service
*/
export class EthereumService extends Service {
public config: Config

public flow: FlowControl
public chain: Chain
public interval: number
Expand Down
24 changes: 2 additions & 22 deletions test/blockchain/chain.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import tape from 'tape'
import { Block, BlockHeader, BlockData, HeaderData } from '@ethereumjs/block'
import { Block, BlockData, HeaderData } from '@ethereumjs/block'
import { BN } from 'ethereumjs-util'
import { Chain } from '../../lib/blockchain'
import { defaultLogger } from '../../lib/logging'
import { Config } from '../../lib/config'
defaultLogger.silent = true

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

tape('[Chain]', (t) => {
t.test('should test blockchain DB is initialized', async (t) => {
Expand Down Expand Up @@ -80,26 +80,6 @@ tape('[Chain]', (t) => {
t.end()
})

t.test('should handle bad arguments to putBlocks()', async (t) => {
const chain = new Chain({ config: new Config() }) // eslint-disable-line no-new
await chain.open()
t.notOk(await chain.putBlocks((<unknown>undefined) as Block[]), 'add undefined block')
t.notOk(await chain.putBlocks((<unknown>null) as Block[]), 'add null block')
t.notOk(await chain.putBlocks([]), 'add empty block list')
await chain.close()
t.end()
})

t.test('should handle bad arguments to putHeaders()', async (t) => {
const chain = new Chain({ config: new Config() }) // eslint-disable-line no-new
await chain.open()
t.notOk(await chain.putHeaders((<unknown>undefined) as BlockHeader[]), 'add undefined header')
t.notOk(await chain.putHeaders((<unknown>null) as BlockHeader[]), 'add null header')
t.notOk(await chain.putHeaders([]), 'add empty header list')
await chain.close()
t.end()
})

t.test('should add block to chain', async (t) => {
const chain = new Chain({ config: new Config() }) // eslint-disable-line no-new
await chain.open()
Expand Down
1 change: 1 addition & 0 deletions test/net/server/rlpxserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ tape('[RlpxServer]', (t) => {
t.test('should return rlpx server info', async (t) => {
const mockId = '123'
const server = new RlpxServer({
config: new Config({ transports: [] }),
bootnodes: '10.0.0.1:1234,10.0.0.2:1234',
})
server.initDpt = td.func()
Expand Down

0 comments on commit 5257851

Please sign in to comment.