Skip to content

Commit

Permalink
spotless
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan <[email protected]>
  • Loading branch information
pinges committed Aug 14, 2023
1 parent 7f1846e commit de6da92
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,10 @@ public String getExcessDataGas() {
* @return the excess data gas
*/
public String getParentBeaconBlockRoot() {
return JsonUtil.getValueAsString(configRoot, "parentBeaconBlockRoot", "0x0000000000000000000000000000000000000000000000000000000000000000");
return JsonUtil.getValueAsString(
configRoot,
"parentBeaconBlockRoot",
"0x0000000000000000000000000000000000000000000000000000000000000000");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import static java.util.stream.Collectors.toList;

import org.apache.tuweni.bytes.Bytes32;
import org.hyperledger.besu.datatypes.Hash;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.WithdrawalParameter;
import org.hyperledger.besu.ethereum.core.BlockHeader;
Expand All @@ -31,6 +30,7 @@
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.databind.JsonNode;
import org.apache.tuweni.bytes.Bytes32;

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
Expand Down Expand Up @@ -87,7 +87,7 @@ public class BlockResult implements JsonRpcResult {

private final String dataGasUsed;
private final String excessDataGas;
private String parentBeaconBlockRoot;
private final String parentBeaconBlockRoot;

public BlockResult(
final BlockHeader header,
Expand Down Expand Up @@ -136,7 +136,8 @@ public BlockResult(

this.dataGasUsed = header.getDataGasUsed().map(Quantity::create).orElse(null);
this.excessDataGas = header.getExcessDataGas().map(Quantity::create).orElse(null);
this.parentBeaconBlockRoot = header.getParentBeaconBlockRoot().map(Bytes32::toHexString).orElse(null);
this.parentBeaconBlockRoot =
header.getParentBeaconBlockRoot().map(Bytes32::toHexString).orElse(null);
}

@JsonGetter(value = "number")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import static java.util.Collections.emptyList;

import org.apache.tuweni.bytes.Bytes32;
import org.hyperledger.besu.config.GenesisAllocation;
import org.hyperledger.besu.config.GenesisConfigFile;
import org.hyperledger.besu.datatypes.Address;
Expand Down Expand Up @@ -54,6 +53,7 @@

import com.google.common.base.MoreObjects;
import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.bytes.Bytes32;
import org.apache.tuweni.units.bigints.UInt256;

public final class GenesisState {
Expand Down Expand Up @@ -171,7 +171,8 @@ private static BlockHeader buildHeader(
.withdrawalsRoot(isShanghaiAtGenesis(genesis) ? Hash.EMPTY_TRIE_HASH : null)
.dataGasUsed(isCancunAtGenesis(genesis) ? parseDataGasUsed(genesis) : null)
.excessDataGas(isCancunAtGenesis(genesis) ? parseExcessDataGas(genesis) : null)
.parentBeaconBlockRoot((isCancunAtGenesis(genesis) ? parseParentBeaconBlockRoot(genesis) : null))
.parentBeaconBlockRoot(
(isCancunAtGenesis(genesis) ? parseParentBeaconBlockRoot(genesis) : null))
.depositsRoot(isExperimentalEipsTimeAtGenesis(genesis) ? Hash.EMPTY_TRIE_HASH : null)
.buildBlockHeader();
}
Expand Down Expand Up @@ -236,7 +237,7 @@ private static DataGas parseExcessDataGas(final GenesisConfigFile genesis) {

private static Bytes32 parseParentBeaconBlockRoot(final GenesisConfigFile genesis) {
return withNiceErrorMessage(
"parentBeaconBlockRoot", genesis.getParentBeaconBlockRoot(), Bytes32::fromHexString);
"parentBeaconBlockRoot", genesis.getParentBeaconBlockRoot(), Bytes32::fromHexString);
}

private static long parseUnsignedLong(final String value) {
Expand Down

0 comments on commit de6da92

Please sign in to comment.