<commit_before>var genesisData = require('../../../tests/genesishashestest.json'),
  assert = require('assert'),
  Blockchain = require('../../lib/blockchain.js'),
  Block = require('../../lib/block.js'),
  levelup = require('levelup'),
  utils = require('../../lib/utils'),
  rlp = require('rlp'),
  SHA3 = require('sha3');

var blockDB = levelup('', {
  db: require('memdown')
}),
  detailsDB = levelup('/does/not/matter', {
    db: require('memdown')
  }),
  internals = {};

describe('[Common]: genesis hashes tests', function () {
  it('should create a new block chain', function (done) {
    internals.blockchain = new Blockchain(blockDB, detailsDB);
    internals.blockchain.init(done);
  });

  it('should have added the genesis correctly', function () {
    var blockGenesis = new Block(),
      rlpGenesis;
    blockGenesis.header.stateRoot = genesisData.genesis_state_root;

    rlpGenesis = blockGenesis.serialize();
    assert(rlpGenesis.toString('hex') === genesisData.genesis_rlp_hex, 'rlp hex mismatch');

    internals.blockchain.addBlock(blockGenesis, function() {
      assert(internals.blockchain.meta.genesis === genesisData.genesis_hash);
    });<commit_msg>eslint<commit_after>var genesisData = require('../../../tests/genesishashestest.json'),
  assert = require('assert'),
  Blockchain = require('../../lib/blockchain.js'),
  Block = require('../../lib/block.js'),
  levelup = require('levelup');

var blockDB = levelup('', {
  db: require('memdown')
}),
  detailsDB = levelup('/does/not/matter', {
    db: require('memdown')
  }),
  blockchain;

describe('[Common]: genesis hashes tests', function () {
  it('should create a new block chain', function (done) {
    blockchain = new Blockchain(blockDB, detailsDB);
    blockchain.init(done);
  });

  it('should have added the genesis correctly', function () {
    var blockGenesis = new Block(),
      rlpGenesis;
    blockGenesis.header.stateRoot = genesisData.genesis_state_root;

    rlpGenesis = blockGenesis.serialize();
    assert(rlpGenesis.toString('hex') === genesisData.genesis_rlp_hex, 'rlp hex mismatch');

    blockchain.addBlock(blockGenesis, function() {
      assert(blockchain.meta.genesis === genesisData.genesis_hash);
    });
{'fraction_non_alphanumeric': 0.1728950923007654, 'fraction_numerical': 0.0009004952723998199, 'mean_word_length': 4.08466819221968, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5297684', 'n_tokens_mistral': 708, 'n_tokens_neox': 681, 'n_words': 134}