Fix npe and unrecognized error (#456)

This commit is contained in:
KirillPamPam
2024-04-19 13:46:29 +04:00
committed by GitHub
parent ef6913d2d6
commit 72dcedc38e
2 changed files with 39 additions and 37 deletions

View File

@@ -35,7 +35,9 @@ class Describe(
return requestMono.map { _ -> return requestMono.map { _ ->
val resp = BlockchainOuterClass.DescribeResponse.newBuilder() val resp = BlockchainOuterClass.DescribeResponse.newBuilder()
resp.buildInfoBuilder.version = Global.version resp.buildInfoBuilder.version = Global.version
multistreamHolder.getAvailable().forEach { chain -> multistreamHolder.getAvailable()
.filter { Common.ChainRef.forNumber(it.id) != null }
.forEach { chain ->
multistreamHolder.getUpstream(chain).let { chainUpstreams -> multistreamHolder.getUpstream(chain).let { chainUpstreams ->
val status = subscribeStatus.chainStatus(chain, chainUpstreams.getStatus(), chainUpstreams) val status = subscribeStatus.chainStatus(chain, chainUpstreams.getStatus(), chainUpstreams)
val targets = chainUpstreams.getMethods().getSupportedMethods() val targets = chainUpstreams.getMethods().getSupportedMethods()

View File

@@ -93,7 +93,7 @@ class StreamHead(
private fun toProtoLowerBoundType(type: LowerBoundType): BlockchainOuterClass.LowerBoundType { private fun toProtoLowerBoundType(type: LowerBoundType): BlockchainOuterClass.LowerBoundType {
return when (type) { return when (type) {
LowerBoundType.SLOT -> BlockchainOuterClass.LowerBoundType.LOWER_BOUND_SLOT LowerBoundType.SLOT -> BlockchainOuterClass.LowerBoundType.LOWER_BOUND_SLOT
LowerBoundType.UNKNOWN -> BlockchainOuterClass.LowerBoundType.UNRECOGNIZED LowerBoundType.UNKNOWN -> BlockchainOuterClass.LowerBoundType.LOWER_BOUND_UNSPECIFIED
LowerBoundType.STATE -> BlockchainOuterClass.LowerBoundType.LOWER_BOUND_STATE LowerBoundType.STATE -> BlockchainOuterClass.LowerBoundType.LOWER_BOUND_STATE
LowerBoundType.BLOCK -> BlockchainOuterClass.LowerBoundType.LOWER_BOUND_BLOCK LowerBoundType.BLOCK -> BlockchainOuterClass.LowerBoundType.LOWER_BOUND_BLOCK
} }