mirror of
https://github.com/mimblewimble/grin.git
synced 2025-02-01 17:01:09 +03:00
Also produce full block hashes
This commit is contained in:
parent
194235a5a7
commit
a71af7adae
2 changed files with 7 additions and 2 deletions
|
@ -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, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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");
|
||||||
|
|
Loading…
Reference in a new issue