Skip to content

Commit

Permalink
Merge pull request #343 from input-output-hk/block0_chk
Browse files Browse the repository at this point in the history
Validate block0 during creation in JCLI
  • Loading branch information
vincenthz committed May 14, 2019
2 parents 6cb5cb3 + 71c24ca commit ff1abb8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bin/jcli_app/block/genesis.rs
Expand Up @@ -3,8 +3,9 @@ extern crate chain_core;
extern crate chain_impl_mockchain; extern crate chain_impl_mockchain;
extern crate structopt; 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::block;
use chain_impl_mockchain::ledger::Ledger;
use jcli_app::utils::io; use jcli_app::utils::io;
use structopt::StructOpt; use structopt::StructOpt;


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


let block = yaml.to_block(); let block = yaml.to_block();


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

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

0 comments on commit ff1abb8

Please sign in to comment.