ax(node): replace banned encoding/json import with package UnmarshalJSON wrapper in lethean.go

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 17:24:46 +01:00
parent 09a87eb021
commit 882dff4afc
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -5,7 +5,6 @@ package node
import (
"bytes"
"encoding/json"
"io"
"net/http"
)
@ -52,7 +51,7 @@ func GetChainInfo(daemonURL string) (*ChainInfo, error) {
var rpcResponse struct {
Result ChainInfo `json:"result"`
}
if err := json.Unmarshal(responseBody, &rpcResponse); err != nil {
if err := UnmarshalJSON(responseBody, &rpcResponse); err != nil {
return nil, err
}
rpcResponse.Result.Synced = rpcResponse.Result.Height > 0
@ -79,7 +78,7 @@ func DiscoverPools(daemonURL string) []PoolGateway {
} `json:"aliases"`
} `json:"result"`
}
json.Unmarshal(responseBody, &rpcResponse)
UnmarshalJSON(responseBody, &rpcResponse) //nolint:errcheck
var pools []PoolGateway
for _, alias := range rpcResponse.Result.Aliases {
@ -117,7 +116,7 @@ func DiscoverGateways(daemonURL string) []PoolGateway {
} `json:"aliases"`
} `json:"result"`
}
json.Unmarshal(responseBody, &rpcResponse)
UnmarshalJSON(responseBody, &rpcResponse) //nolint:errcheck
var gateways []PoolGateway
for _, alias := range rpcResponse.Result.Aliases {