Also produce full block hashes

This commit is contained in:
Ignotus Peverell 2018-12-14 22:12:54 +00:00
parent 194235a5a7
commit a71af7adae
No known key found for this signature in database
GPG key ID: 99CD25F39F8F8211
2 changed files with 7 additions and 2 deletions

View file

@ -187,11 +187,13 @@ pub fn genesis_main() -> core::Block {
mod test { mod test {
use super::*; use super::*;
// TODO update the hash once genesis is set // TODO hardcode the hashes once genesis is set
#[test] #[test]
fn mainnet_genesis_hash() { fn mainnet_genesis_hash() {
let gen_hash = genesis_main().hash(); let gen_hash = genesis_main().hash();
println!("mainnet genesis hash: {}", gen_hash.to_hex()); println!("mainnet genesis hash: {}", gen_hash.to_hex());
let gen_bin = core::ser::ser_vec(&genesis_main()).unwrap();
println!("mainnet genesis full hash: {}\n", gen_bin.hash().to_hex());
//assert_eq!(gene_hash.to_hex, ""); //assert_eq!(gene_hash.to_hex, "");
} }
} }

View file

@ -30,6 +30,7 @@ use grin_miner_plugin as plugin;
use grin_store as store; use grin_store as store;
use grin_util as util; use grin_util as util;
use grin_core::core::hash::Hashed;
use grin_core::core::verifier_cache::LruVerifierCache; use grin_core::core::verifier_cache::LruVerifierCache;
use grin_keychain::{BlindingFactor, ExtKeychain, Keychain}; use grin_keychain::{BlindingFactor, ExtKeychain, Keychain};
@ -129,7 +130,9 @@ fn main() {
) )
.unwrap(); .unwrap();
println!("Final genesis hash: {}", gen.hash().to_hex()); println!("\nFinal genesis cyclehash: {}", gen.hash().to_hex());
let gen_bin = core::ser::ser_vec(&gen).unwrap();
println!("Final genesis full hash: {}\n", gen_bin.hash().to_hex());
update_genesis_rs(&gen); update_genesis_rs(&gen);
println!("genesis.rs has been updated, check it and run mainnet_genesis_hash test"); println!("genesis.rs has been updated, check it and run mainnet_genesis_hash test");