Skip to content

Commit

Permalink
fix(core-snapshots): use correct genesis block instead of hardcoding …
Browse files Browse the repository at this point in the history
…devnet (#2462)
  • Loading branch information
spkjp authored and faustbrian committed Apr 24, 2019
1 parent c48be0b commit cd48afb
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/core-snapshots/src/transport/verification.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { app } from "@arkecosystem/core-container";
import { Logger } from "@arkecosystem/core-interfaces";
import { crypto, HashAlgorithms, models, Transaction } from "@arkecosystem/crypto";
import { configManager, crypto, HashAlgorithms, models, Transaction } from "@arkecosystem/crypto";
import { camelizeKeys } from "xcase";

const { Block } = models;
Expand All @@ -15,13 +15,9 @@ export const verifyData = (context, data, prevData, verifySignatures) => {
// genesis payload different as block.serialize stores
// block.previous_block with 00000 instead of null
// it fails on height 2 - chain check
// hardcoding for now
// TODO: check to improve ser/deser for genesis, add mainnet
if (
data.height === 2 &&
data.previous_block === "13114381566690093367" &&
prevData.id === "12760288562212273414"
) {
// TODO: check to improve ser/deser for genesis
const genesisBlock = configManager.get("genesisBlock");
if (data.height === 2 && data.previous_block === genesisBlock.id) {
return true;
}

Expand Down

0 comments on commit cd48afb

Please sign in to comment.