Skip to content
Permalink
Browse files

Merge pull request #343 from input-output-hk/block0_chk

Validate block0 during creation in JCLI
  • Loading branch information...
vincenthz committed May 14, 2019
2 parents 6cb5cb3 + 71c24ca commit ff1abb86f701612453071fbaddf62507327f440a
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/bin/jcli_app/block/genesis.rs
@@ -3,8 +3,9 @@ extern crate chain_core;
extern crate chain_impl_mockchain;
extern crate structopt;

use chain_core::property::{Block as _, Deserialize, Serialize};
use chain_core::property::{Block as _, Deserialize, HasMessages, Serialize};
use chain_impl_mockchain::block;
use chain_impl_mockchain::ledger::Ledger;
use jcli_app::utils::io;
use structopt::StructOpt;

@@ -35,6 +36,8 @@ fn encode_block_0(argument: Common) {

let block = yaml.to_block();

Ledger::new(block.id(), block.messages()).expect("Generated invalid block0");

block
.serialize(io::open_file_write(&argument.output_file).unwrap())
.unwrap()

0 comments on commit ff1abb8

Please sign in to comment.
You can’t perform that action at this time.