Skip to content

Commit

Permalink
fix: refactored to fromPbj
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Peterson <[email protected]>
  • Loading branch information
mattp-swirldslabs committed Aug 23, 2024
1 parent d18dfb9 commit 3827a83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
7 changes: 2 additions & 5 deletions server/src/main/java/com/hedera/block/server/Translator.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,8 @@ public static com.hedera.hapi.block.protoc.SubscribeStreamResponse fromPbj(
* @return the converted {@link com.hedera.hapi.block.protoc.SubscribeStreamRequest}
*/
@NonNull
public static com.hedera.hapi.block.protoc.SubscribeStreamRequest
toProtocSubscribeStreamRequest(
@NonNull
final com.hedera.hapi.block.SubscribeStreamRequest
subscribeStreamRequest) {
public static com.hedera.hapi.block.protoc.SubscribeStreamRequest fromPbj(
@NonNull final com.hedera.hapi.block.SubscribeStreamRequest subscribeStreamRequest) {
try {
final byte[] pbjBytes =
asBytes(SubscribeStreamRequest.PROTOBUF, subscribeStreamRequest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.hedera.block.server;

import static com.hedera.block.server.Translator.fromPbj;
import static com.hedera.block.server.Translator.toProtocSubscribeStreamRequest;
import static com.hedera.block.server.producer.Util.getFakeHash;
import static com.hedera.block.server.util.PersistTestUtils.generateBlockItems;
import static java.lang.System.Logger;
Expand Down Expand Up @@ -511,7 +510,7 @@ public void testMediatorExceptionHandlingWhenPersistenceFailure()
SubscribeStreamRequest.newBuilder().startBlockNumber(1).build();
// Simulate a consumer attempting to connect to the Block Node after the exception.
blockStreamService.protocSubscribeBlockStream(
toProtocSubscribeStreamRequest(subscribeStreamRequest), subscribeStreamObserver4);
fromPbj(subscribeStreamRequest), subscribeStreamObserver4);

// The BlockItem passed through since it was published
// before the IOException was thrown.
Expand Down

0 comments on commit 3827a83

Please sign in to comment.