Skip to content

Commit

Permalink
fix: validator info api: runtimes status.
Browse files Browse the repository at this point in the history
  • Loading branch information
romever committed Aug 5, 2024
1 parent f2e5689 commit e315bad
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api/internal/logic/validator/validatorinfologic.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ func (l *ValidatorInfoLogic) ValidatorInfo(req *types.ValidatorInfoRequest) (res
Online: false,
})
}
runtimeMap := make(map[string]bool, 0)
for _, validatorNode := range validatorNodes {
var pubKey signature.PublicKey
err = pubKey.UnmarshalText([]byte(validatorNode.NodeId))
Expand All @@ -211,13 +212,12 @@ func (l *ValidatorInfoLogic) ValidatorInfo(req *types.ValidatorInfoRequest) (res
if !strings.Contains(node.Roles.String(), "compute") {
continue
}
runtimeMap := make(map[string]bool, 0)
for _, runtime := range node.Runtimes {
runtimeMap[runtime.ID.Hex()] = true
}
for _, validatorRuntime := range validatorRuntimes {
validatorRuntime.Online = runtimeMap[validatorRuntime.Id]
}
}
for _, validatorRuntime := range validatorRuntimes {
validatorRuntime.Online = runtimeMap[validatorRuntime.Id]
}
validatorInfo.Runtimes = validatorRuntimes

Expand Down

0 comments on commit e315bad

Please sign in to comment.