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