|
1 | 1 | import tape from 'tape' |
2 | | -import { Block, BlockHeader, BlockData, HeaderData } from '@ethereumjs/block' |
| 2 | +import { Block, BlockData, HeaderData } from '@ethereumjs/block' |
3 | 3 | import { BN } from 'ethereumjs-util' |
4 | 4 | import { Chain } from '../../lib/blockchain' |
5 | 5 | import { defaultLogger } from '../../lib/logging' |
| 6 | +import { Config } from '../../lib/config' |
6 | 7 | defaultLogger.silent = true |
7 | 8 |
|
8 | 9 | // explicitly import util and buffer, |
9 | 10 | // needed for karma-typescript bundling |
10 | 11 | import * as util from 'util' //eslint-disable-line @typescript-eslint/no-unused-vars |
11 | 12 | import { Buffer } from 'buffer' //eslint-disable-line @typescript-eslint/no-unused-vars |
12 | | -import { Config } from '../../lib/config' |
13 | 13 |
|
14 | 14 | tape('[Chain]', (t) => { |
15 | 15 | t.test('should test blockchain DB is initialized', async (t) => { |
@@ -80,26 +80,6 @@ tape('[Chain]', (t) => { |
80 | 80 | t.end() |
81 | 81 | }) |
82 | 82 |
|
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 | | - |
103 | 83 | t.test('should add block to chain', async (t) => { |
104 | 84 | const chain = new Chain({ config: new Config() }) // eslint-disable-line no-new |
105 | 85 | await chain.open() |
|
0 commit comments