mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 04:57:17 +00:00
23 lines
388 B
Go
23 lines
388 B
Go
|
package health
|
||
|
|
||
|
import (
|
||
|
"github.com/ledgerwatch/erigon/rpc"
|
||
|
)
|
||
|
|
||
|
func parseAPI(api []rpc.API) (netAPI NetAPI, ethAPI EthAPI) {
|
||
|
for _, rpc := range api {
|
||
|
if rpc.Service == nil {
|
||
|
continue
|
||
|
}
|
||
|
|
||
|
if netCandidate, ok := rpc.Service.(NetAPI); ok {
|
||
|
netAPI = netCandidate
|
||
|
}
|
||
|
|
||
|
if ethCandidate, ok := rpc.Service.(EthAPI); ok {
|
||
|
ethAPI = ethCandidate
|
||
|
}
|
||
|
}
|
||
|
return netAPI, ethAPI
|
||
|
}
|