mirror of
https://github.com/sigp/lighthouse.git
synced 2026-06-10 09:37:38 +00:00
merge conflicts
This commit is contained in:
@@ -1177,8 +1177,8 @@ fn make_genesis_block<E: EthSpec>(
|
|||||||
genesis_state: &mut BeaconState<E>,
|
genesis_state: &mut BeaconState<E>,
|
||||||
spec: &ChainSpec,
|
spec: &ChainSpec,
|
||||||
) -> Result<SignedBeaconBlock<E>, String> {
|
) -> Result<SignedBeaconBlock<E>, String> {
|
||||||
let mut block = genesis_block(genesis_state, spec)
|
let mut block =
|
||||||
.map_err(|e| format!("Error building genesis block: {:?}", e))?;
|
genesis_block(spec).map_err(|e| format!("Error building genesis block: {:?}", e))?;
|
||||||
|
|
||||||
*block.state_root_mut() = genesis_state
|
*block.state_root_mut() = genesis_state
|
||||||
.update_tree_hash_cache()
|
.update_tree_hash_cache()
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ impl TestContext {
|
|||||||
root: Hash256::ZERO,
|
root: Hash256::ZERO,
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut block = genesis_block(&state, &spec).expect("should build genesis block");
|
let mut block = genesis_block(&spec).expect("should build genesis block");
|
||||||
*block.state_root_mut() = state
|
*block.state_root_mut() = state
|
||||||
.update_tree_hash_cache()
|
.update_tree_hash_cache()
|
||||||
.expect("should hash genesis state");
|
.expect("should hash genesis state");
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ impl TestContext {
|
|||||||
)
|
)
|
||||||
.expect("should register inactive builder");
|
.expect("should register inactive builder");
|
||||||
|
|
||||||
let mut block = genesis_block(&state, &spec).expect("should build genesis block");
|
let mut block = genesis_block(&spec).expect("should build genesis block");
|
||||||
*block.state_root_mut() = state
|
*block.state_root_mut() = state
|
||||||
.update_tree_hash_cache()
|
.update_tree_hash_cache()
|
||||||
.expect("should hash genesis state");
|
.expect("should hash genesis state");
|
||||||
|
|||||||
@@ -184,15 +184,12 @@ pub fn initialize_beacon_state_from_eth1<E: EthSpec>(
|
|||||||
Ok(state)
|
Ok(state)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create an unsigned genesis `BeaconBlock` matching the genesis state.
|
/// Create an unsigned genesis `BeaconBlock`.
|
||||||
///
|
///
|
||||||
/// Per spec, the genesis block body is empty (all default fields).
|
/// Per spec, the genesis block body is empty (all default fields).
|
||||||
/// `state.latest_block_header.body_root` is set from `BeaconBlock::empty()`,
|
/// `state.latest_block_header.body_root` is set from `BeaconBlock::empty()`,
|
||||||
/// so this function must return the same empty block to keep roots consistent.
|
/// so this function must return the same empty block to keep roots consistent.
|
||||||
pub fn genesis_block<E: EthSpec>(
|
pub fn genesis_block<E: EthSpec>(spec: &ChainSpec) -> Result<BeaconBlock<E>, BeaconStateError> {
|
||||||
_genesis_state: &BeaconState<E>,
|
|
||||||
spec: &ChainSpec,
|
|
||||||
) -> Result<BeaconBlock<E>, BeaconStateError> {
|
|
||||||
Ok(BeaconBlock::empty(spec))
|
Ok(BeaconBlock::empty(spec))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user