fixed wallet fetcher

This commit is contained in:
Stephan D
2025-12-26 01:21:16 +01:00
parent 8ee092089f
commit 3bb33b8895
4 changed files with 42 additions and 39 deletions

View File

@@ -156,12 +156,11 @@ func (l *loggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, erro
fields := []zap.Field{
zap.String("network", l.network),
zap.String("rpc_endpoint", l.endpoint),
}
if len(reqBody) > 0 {
fields = append(fields, zap.String("rpc_request", truncate(string(reqBody), 2048)))
}
l.logger.Error("RPC request", fields...)
l.logger.Debug("RPC request", fields...)
resp, err := l.base.RoundTrip(req)
if err != nil {
@@ -182,7 +181,7 @@ func (l *loggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, erro
if len(bodyBytes) > 0 {
respFields = append(respFields, zap.String("rpc_response", truncate(string(bodyBytes), 2048)))
}
l.logger.Error("RPC response", respFields...)
l.logger.Debug("RPC response", respFields...)
if resp.StatusCode >= 400 {
l.logger.Warn("RPC response error", respFields...)
} else if len(bodyBytes) == 0 {