Skip to content

Commit

Permalink
Remove unnecessary argument (#644)
Browse files Browse the repository at this point in the history
  • Loading branch information
cemozerr authored May 8, 2019
1 parent 68153b2 commit f4af8ff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public void onEth2GenesisEvent(Eth2GenesisEvent event) {
DataStructureUtil.createInitialBeaconState(config.getNumValidators());
Bytes32 initial_state_root = initial_state.hash_tree_root();
BeaconBlock genesis_block = BeaconBlockUtil.get_empty_block();
genesis_block.setState_root(initial_state_root);
Bytes32 genesis_block_root = genesis_block.hash_tree_root();
LOG.log(Level.INFO, "Initial state root is " + initial_state_root.toHexString());
this.store.addState(initial_state_root, initial_state);
Expand Down Expand Up @@ -182,7 +183,7 @@ public void onNewSlot(Date date) throws StateTransitionException, InterruptedExc
"Transitioning state from slot: " + newHeadState.getSlot() + " to slot: " + nodeSlot);
firstLoop = false;
}
stateTransition.initiate((BeaconStateWithCache) newHeadState, null, previousBlockRoot);
stateTransition.initiate((BeaconStateWithCache) newHeadState, null);
}
this.store.addState(newHeadState.hash_tree_root(), newHeadState);
this.headState = newHeadState;
Expand Down Expand Up @@ -245,12 +246,12 @@ protected void processBlock(Optional<BeaconBlock> unprocessedBlock) {

firstLoop = false;
}
stateTransition.initiate((BeaconStateWithCache) currentState, null, parentBlockRoot);
stateTransition.initiate((BeaconStateWithCache) currentState, null);
}

// Run state transition with the block
LOG.log(Level.INFO, ANSI_PURPLE + "Running state transition with block." + ANSI_RESET);
stateTransition.initiate((BeaconStateWithCache) currentState, block, parentBlockRoot);
stateTransition.initiate((BeaconStateWithCache) currentState, block);

Bytes32 newStateRoot = currentState.hash_tree_root();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public StateTransition(boolean printEnabled) {
this.printEnabled = printEnabled;
}

public void initiate(BeaconStateWithCache state, BeaconBlock block, Bytes32 previous_block_root)
public void initiate(BeaconStateWithCache state, BeaconBlock block)
throws StateTransitionException {
// Client specific optimization
preProcessor(state);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ private void createNewBlock(

BLSSignature epoch_signature = setEpochSignature(headState, keypair);
block.getBody().setRandao_reveal(epoch_signature);
stateTransition.initiate(headState, block, blockRoot);
stateTransition.initiate(headState, block);
Bytes32 stateRoot = headState.hash_tree_root();
block.setState_root(stateRoot);
BLSSignature signed_proposal = signProposalData(headState, block, keypair);
Expand Down

0 comments on commit f4af8ff

Please sign in to comment.