Skip to content

Commit

Permalink
fix fullethereumservice spec
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech committed Aug 4, 2022
1 parent 80c2763 commit 50e6a95
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions packages/client/test/service/fullethereumservice.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Common } from '@ethereumjs/common'
import { Log } from '@ethereumjs/evm/dist/types'
import { isTruthy } from '@ethereumjs/util'

import * as tape from 'tape'
import * as td from 'testdouble'

Expand Down Expand Up @@ -75,12 +77,18 @@ tape('[FullEthereumService]', async (t) => {
let config = new Config({ transports: [] })
const chain = new Chain({ config })
let service = new FullEthereumService({ config, chain })
t.ok(service.protocols[0] instanceof EthProtocol, 'full protocol')
t.notOk(service.protocols[1], 'no light protocol')
t.ok(isTruthy(service.protocols.filter((p) => p instanceof EthProtocol)[0]), 'full protocol')
t.notOk(
isTruthy(service.protocols.filter((p) => p instanceof LesProtocol)[0]),
'no light protocol'
)
config = new Config({ transports: [], lightserv: true })
service = new FullEthereumService({ config, chain })
t.ok(service.protocols[0] instanceof EthProtocol, 'full protocol')
t.ok(service.protocols[1] instanceof LesProtocol, 'lightserv protocols')
t.ok(isTruthy(service.protocols.filter((p) => p instanceof EthProtocol)[0]), 'full protocol')
t.ok(
isTruthy(service.protocols.filter((p) => p instanceof LesProtocol)[0]),
'lightserv protocols'
)
t.end()
})

Expand Down

0 comments on commit 50e6a95

Please sign in to comment.