Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core-snapshots): use correct genesis block instead of hardcoding devnet #2462

Merged
merged 1 commit into from
Apr 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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