Skip to content
Permalink
Browse files

Validate block0 during creation in JCLI

  • Loading branch information...
CodeSandwich committed May 14, 2019
1 parent da1cb1d commit 71c24ca8d7feaf323b5a7e8ca6b5bb2efd9f4bbf
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 71c24ca

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