This commit is contained in:
parent
33b8f28f62
commit
7316cb9d92
@ -591,8 +591,12 @@ fn execute_export(cmd: ExportBlockchain) -> Result<(), String> {
|
|||||||
}
|
}
|
||||||
let b = client.block(BlockId::Number(i)).ok_or("Error exporting incomplete chain")?.into_inner();
|
let b = client.block(BlockId::Number(i)).ok_or("Error exporting incomplete chain")?.into_inner();
|
||||||
match format {
|
match format {
|
||||||
DataFormat::Binary => { out.write(&b).expect("Couldn't write to stream."); }
|
DataFormat::Binary => {
|
||||||
DataFormat::Hex => { out.write_fmt(format_args!("{}", b.pretty())).expect("Couldn't write to stream."); }
|
out.write(&b).map_err(|e| format!("Couldn't write to stream. Cause: {}", e))?;
|
||||||
|
}
|
||||||
|
DataFormat::Hex => {
|
||||||
|
out.write_fmt(format_args!("{}", b.pretty())).map_err(|e| format!("Couldn't write to stream. Cause: {}", e))?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user