Skip to content

Commit

Permalink
Add a bit more info in logging to make it easier to see results
Browse files Browse the repository at this point in the history
  • Loading branch information
nolag committed Dec 15, 2023
1 parent 82fb436 commit 08477d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions core/services/relay/evm/chain_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,28 +82,28 @@ func (cr *chainReader) GetLatestValue(ctx context.Context, contractName, method
}

func (cr *chainReader) getLatestValueFromLogPoller(ctx context.Context, contractName, method string, hash common.Hash, returnVal any) error {
cr.lggr.Infof("!!!!!!!!!!\nEVM latest from log poller\n!!!!!!!!!!\n")
cr.lggr.Infof("!!!!!!!!!!\nlp: EVM latest from log poller\n!!!!!!!!!!\n")
ae, err := cr.bindings.getBinding(contractName, method, false)
if err != nil {
cr.lggr.Errorf("!!!!!!!!!!\nEVM no binding err:\n%v\n!!!!!!!!!!\n", err)
cr.lggr.Errorf("!!!!!!!!!!\nlp: EVM no binding err:\n%v\n!!!!!!!!!!\n", err)
return err
}

log, err := cr.lp.LatestLogByEventSigWithConfs(hash, ae.addr, logpoller.Finalized)
if err != nil {
errStr := err.Error()
if strings.Contains(errStr, "not found") || strings.Contains(errStr, "no rows") {
cr.lggr.Infof("!!!!!!!!!!\nReturning no error when nothing is found\n!!!!!!!!!!\n")
cr.lggr.Infof("!!!!!!!!!!\nlp: Returning no error when nothing is found\n!!!!!!!!!!\n")
return nil
}
cr.lggr.Errorf("!!!!!!!!!!\nNo sig err:\n%v\n!!!!!!!!!!\n", err)
cr.lggr.Errorf("!!!!!!!!!!\nlp: No sig err:\n%v\n!!!!!!!!!!\n", err)
return fmt.Errorf("%w: %w", commontypes.ErrInternal, err)
}
err = cr.codec.Decode(ctx, log.Data, returnVal, wrapItemType(contractName, method, false))
if err != nil {
cr.lggr.Errorf("!!!!!!!!!!\nEVM decode err:\n%v\n!!!!!!!!!!\n", err)
cr.lggr.Errorf("!!!!!!!!!!\nlp: EVM decode err:\n%v\n!!!!!!!!!!\n", err)
} else {
cr.lggr.Infof("!!!!!!!!!!\nEVM decode success\n%#v\n!!!!!!!!!!\n", returnVal)
cr.lggr.Infof("!!!!!!!!!!\nlp: EVM decode success\n%#v\n!!!!!!!!!!\n", returnVal)
}
return err
}
Expand Down
2 changes: 1 addition & 1 deletion core/services/relay/evm/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func NewCodec(conf types.CodecConfig) (commontypes.RemoteCodec, error) {
for k, v := range conf.ChainCodecConfigs {
args := abi.Arguments{}
if err := json.Unmarshal(([]byte)(v.TypeAbi), &args); err != nil {
fmt.Printf("!!!!!!!!!!\nNewCodec json abi/n%s/n err\n%#v\n!!!!!!!!!!\n%", v.TypeAbi, err)
fmt.Printf("!!!!!!!!!!\nNewCodec json abi/n%s/n err\n%#v\n!!!!!!!!!!\n", v.TypeAbi, err)
return nil, err
}

Expand Down

0 comments on commit 08477d0

Please sign in to comment.