Skip to content

Commit

Permalink
Fix proxy newHeads sub (#446)
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillPamPam authored Mar 29, 2024
1 parent 7e9709b commit 2bedcad
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,12 @@ class WebsocketHandler(
val responses = nativeSubscribe
.subscribe(blockchain, methodParams.first, methodParams.second, io.emeraldpay.dshackle.upstream.Selector.empty)
.map { event ->
WsSubscriptionResponse(params = WsSubscriptionData(event, subscriptionId))
val data = if (event is ByteArray) {
Global.objectMapper.readTree(event)
} else {
event
}
WsSubscriptionResponse(params = WsSubscriptionData(data, subscriptionId))
}
.takeUntilOther(currentControl.asMono())
Flux.concat(Mono.just(start), responses)
Expand Down

0 comments on commit 2bedcad

Please sign in to comment.