Fix for Genesis.

This commit is contained in:
Gav Wood 2016-01-07 19:42:59 +01:00
parent 14d77d522b
commit 3cb3c2a2bd
2 changed files with 3 additions and 3 deletions

View File

@ -99,7 +99,7 @@ impl BlockChain {
///
/// let bc = BlockChain::new(genesis.block(), &dir);
///
/// let genesis_hash = "347db3ae87cf4703f948676de5858af1a2a336cbe2e6e56c5041dd80bed3071f";
/// let genesis_hash = "d4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3";
/// assert_eq!(bc.genesis_hash(), H256::from_str(genesis_hash).unwrap());
/// assert!(bc.is_known(&bc.genesis_hash()));
/// assert_eq!(bc.genesis_hash(), bc.block_hash(&U256::from(0u8)).unwrap());

View File

@ -89,7 +89,7 @@ impl Genesis {
// ethash specific fields
let mixhash = H256::from_str(&json["mixhash"].as_string().unwrap()[2..]).unwrap();
let nonce = H64::from_str(&json["nonce"].as_string().unwrap()[2..]).unwrap();
vec![mixhash.to_vec(), nonce.to_vec()]
vec![encode(&mixhash), encode(&nonce)]
}
};
@ -118,6 +118,6 @@ fn test_genesis() {
let g = Genesis::new_frontier();
let view = BlockView::new(&g.block).header_view();
let genesis_hash = H256::from_str("347db3ae87cf4703f948676de5858af1a2a336cbe2e6e56c5041dd80bed3071f").unwrap();
let genesis_hash = H256::from_str("d4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3").unwrap();
assert_eq!(view.sha3(), genesis_hash);
}