Skip to content

Commit

Permalink
fix: fixing unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Peterson <[email protected]>
  • Loading branch information
mattp-swirldslabs committed Nov 19, 2024
1 parent 5ff602a commit 2c8f15e
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 141 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import com.hedera.block.server.producer.ProducerBlockItemObserver;
import com.hedera.block.server.producer.ProducerConfig;
import com.hedera.block.server.service.ServiceStatus;
import com.hedera.hapi.block.BlockItemSetUnparsed;
import com.hedera.hapi.block.BlockItemUnparsed;
import com.hedera.hapi.block.PublishStreamRequestUnparsed;
import com.hedera.hapi.block.PublishStreamResponse;
Expand Down Expand Up @@ -196,9 +195,7 @@ private Bytes createSubscribeStreamResponse(
private List<BlockItemUnparsed> parsePublishStreamRequest(
@NonNull final Bytes message, @NonNull final RequestOptions options) throws ParseException {
final PublishStreamRequestUnparsed request = PublishStreamRequestUnparsed.PROTOBUF.parse(message);
final Bytes b = request.blockItems();
final BlockItemSetUnparsed blockItemSet = BlockItemSetUnparsed.PROTOBUF.parse(b);
return blockItemSet.blockItems();
return request.blockItems().blockItems();
}

@NonNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ public void onNext(@NonNull final List<BlockItemUnparsed> blockItems) {
livenessCalculator.refresh();

// Publish the block to the mediator
publisher.publish(blockItems);
if (!blockItems.isEmpty()) {
publisher.publish(blockItems);
}

} else {
LOGGER.log(ERROR, getClass().getName() + " is not accepting BlockItems");
Expand Down
Loading

0 comments on commit 2c8f15e

Please sign in to comment.