|
|
@ -63,20 +63,23 @@ public class EngineGetBlobsBundleV1 extends AbstractEngineGetPayload { |
|
|
|
|
|
|
|
|
|
|
|
private BlobsBundleV1 createResponse(final Block block) { |
|
|
|
private BlobsBundleV1 createResponse(final Block block) { |
|
|
|
|
|
|
|
|
|
|
|
List<Bytes> kzgs = |
|
|
|
final List<Transaction.BlobsWithCommitments> blobsWithCommitments = |
|
|
|
block.getBody().getTransactions().stream() |
|
|
|
block.getBody().getTransactions().stream() |
|
|
|
.map(Transaction::getBlobsWithCommitments) |
|
|
|
.map(Transaction::getBlobsWithCommitments) |
|
|
|
.filter(Optional::isPresent) |
|
|
|
.filter(Optional::isPresent) |
|
|
|
.map(Optional::get) |
|
|
|
.map(Optional::get) |
|
|
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final List<String> kzgs = |
|
|
|
|
|
|
|
blobsWithCommitments.stream() |
|
|
|
.flatMap(b -> b.getKzgCommitments().stream()) |
|
|
|
.flatMap(b -> b.getKzgCommitments().stream()) |
|
|
|
|
|
|
|
.map(Bytes::toString) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
List<Bytes> blobs = |
|
|
|
final List<String> blobs = |
|
|
|
block.getBody().getTransactions().stream() |
|
|
|
blobsWithCommitments.stream() |
|
|
|
.map(Transaction::getBlobsWithCommitments) |
|
|
|
|
|
|
|
.filter(Optional::isPresent) |
|
|
|
|
|
|
|
.map(Optional::get) |
|
|
|
|
|
|
|
.flatMap(b -> b.getBlobs().stream()) |
|
|
|
.flatMap(b -> b.getBlobs().stream()) |
|
|
|
|
|
|
|
.map(Bytes::toString) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
return new BlobsBundleV1(block.getHash(), kzgs, blobs); |
|
|
|
return new BlobsBundleV1(block.getHash(), kzgs, blobs); |
|
|
|