Skip to content

Commit

Permalink
Merge pull request #242 from m-Peter/improve-eth-call-error-logging
Browse files Browse the repository at this point in the history
Improve error logging for `eth_call` JSON-RPC endpoint
  • Loading branch information
m-Peter authored May 13, 2024
2 parents 553fca6 + abbe267 commit 4cd2076
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,8 @@ func (b *BlockChainAPI) Call(

res, err := b.evm.Call(ctx, tx, from, cadenceHeight)
if err != nil {
b.logger.Error().Err(err).Msg("failed to execute call")
return handleError[hexutil.Bytes](b.logger, errs.ErrInternal)
b.logger.Debug().Err(err).Msg("failed to execute call")
return nil, err
}

return res, nil
Expand Down
8 changes: 4 additions & 4 deletions services/requester/requester.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ func (e *EVM) Call(
from common.Address,
height uint64,
) ([]byte, error) {
e.logger.Debug().
Str("data", fmt.Sprintf("%x", data)).
Msg("call")

hexEncodedTx, err := cadence.NewString(hex.EncodeToString(data))
if err != nil {
return nil, err
Expand All @@ -333,10 +337,6 @@ func (e *EVM) Call(
return nil, err
}

e.logger.Debug().
Str("data", fmt.Sprintf("%x", data)).
Msg("call")

scriptResult, err := e.executeScriptAtHeight(
ctx,
dryRunScript,
Expand Down

0 comments on commit 4cd2076

Please sign in to comment.