|
|
|
@ -25,6 +25,7 @@ import java.util.Optional; |
|
|
|
|
|
|
|
|
|
import org.apache.tuweni.bytes.Bytes; |
|
|
|
|
import org.apache.tuweni.bytes.Bytes32; |
|
|
|
|
import org.apache.tuweni.units.bigints.UInt64; |
|
|
|
|
|
|
|
|
|
public class BlockHeaderTestFixture { |
|
|
|
|
|
|
|
|
@ -55,6 +56,7 @@ public class BlockHeaderTestFixture { |
|
|
|
|
private Optional<BlobGas> excessBlobGas = Optional.empty(); |
|
|
|
|
private Optional<Long> blobGasUsed = Optional.empty(); |
|
|
|
|
private Optional<Bytes32> parentBeaconBlockRoot = Optional.empty(); |
|
|
|
|
private Optional<UInt64> targetBlobCount = Optional.empty(); |
|
|
|
|
|
|
|
|
|
public BlockHeader buildHeader() { |
|
|
|
|
final BlockHeaderBuilder builder = BlockHeaderBuilder.create(); |
|
|
|
@ -80,6 +82,7 @@ public class BlockHeaderTestFixture { |
|
|
|
|
blobGasUsed.ifPresent(builder::blobGasUsed); |
|
|
|
|
requestsHash.ifPresent(builder::requestsHash); |
|
|
|
|
parentBeaconBlockRoot.ifPresent(builder::parentBeaconBlockRoot); |
|
|
|
|
targetBlobCount.ifPresent(builder::targetBlobCount); |
|
|
|
|
builder.blockHeaderFunctions(blockHeaderFunctions); |
|
|
|
|
|
|
|
|
|
return builder.buildBlockHeader(); |
|
|
|
@ -201,4 +204,9 @@ public class BlockHeaderTestFixture { |
|
|
|
|
this.parentBeaconBlockRoot = parentBeaconBlockRoot; |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public BlockHeaderTestFixture targetBlobCount(final UInt64 targetBlobCount) { |
|
|
|
|
this.targetBlobCount = Optional.of(targetBlobCount); |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|