fixed labels grouping

This commit is contained in:
Maksim Fomenkov
2022-12-20 15:00:23 +03:00
parent 8f0c9d1187
commit 5894501f0c
2 changed files with 13 additions and 9 deletions

View File

@@ -116,14 +116,18 @@ class SubscribeNodeStatus(
private fun buildDescription(chain: Chain, up: Upstream): NodeDescription.Builder = private fun buildDescription(chain: Chain, up: Upstream): NodeDescription.Builder =
NodeDescription.newBuilder() NodeDescription.newBuilder()
.setChain(Common.ChainRef.forNumber(chain.id)) .setChain(Common.ChainRef.forNumber(chain.id))
.addAllLabels( .addAllNodeLabels(
up.getLabels().flatMap { labels -> up.getLabels().map { nodeLabels ->
labels.map { BlockchainOuterClass.NodeLabels.newBuilder()
BlockchainOuterClass.Label.newBuilder() .addAllLabels(
.setName(it.key) nodeLabels.map {
.setValue(it.value) BlockchainOuterClass.Label.newBuilder()
.build() .setName(it.key)
} .setValue(it.value)
.build()
}
)
.build()
} }
) )
.addAllSupportedMethods(up.getMethods().getSupportedMethods()) .addAllSupportedMethods(up.getMethods().getSupportedMethods())