From 882dff4afcd609e0d16c627d1e6889d8b25e5934 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 17:24:46 +0100 Subject: [PATCH] ax(node): replace banned encoding/json import with package UnmarshalJSON wrapper in lethean.go Co-Authored-By: Charon --- pkg/node/lethean.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/node/lethean.go b/pkg/node/lethean.go index 4670cd9..e9fc98e 100644 --- a/pkg/node/lethean.go +++ b/pkg/node/lethean.go @@ -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 {