Skip to content

Commit 0a66d2c

Browse files
committed
blockchain: instantiating Block with empty/undefined data
1 parent 1d07328 commit 0a66d2c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/blockchain/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ export default class Blockchain implements BlockchainInterface {
312312
* @hidden
313313
*/
314314
_setCanonicalGenesisBlock(cb: any): void {
315-
const genesisBlock = new Block(Buffer.from([]), { common: this._common })
315+
const genesisBlock = new Block(undefined, { common: this._common })
316316
genesisBlock.setGenesisParams()
317317
this._putBlockOrHeader(genesisBlock, cb, true)
318318
}

packages/blockchain/test/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -875,9 +875,9 @@ test('blockchain test', t => {
875875
const common = new Common('mainnet')
876876
const blockchain = new Blockchain({ common: common, validateBlocks: true, validatePow: false })
877877
const blocks = [
878-
new Block(null, { common: common }),
879-
new Block(null, { chain: 'mainnet' }),
880-
new Block(null, { chain: 'ropsten' }),
878+
new Block(undefined, { common: common }),
879+
new Block(undefined, { chain: 'mainnet' }),
880+
new Block(undefined, { chain: 'ropsten' }),
881881
]
882882

883883
blocks[0].setGenesisParams()

0 commit comments

Comments
 (0)