services/cctp-relayer/relayer/circle.go
Method circleCCTPHandler.handleDepositForBurn
has 61 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (c *circleCCTPHandler) handleDepositForBurn(parentCtx context.Context, log *types.Log, chainID uint32) (msg *relayTypes.Message, err error) {
ctx, span := c.handler.Tracer().Start(parentCtx, "handleDepositForBurn", trace.WithAttributes(
attribute.String(metrics.TxHash, log.TxHash.Hex()),
attribute.Int(metrics.ChainID, int(chainID)),
attribute.Int("block_number", int(log.BlockNumber)),
Method circleCCTPHandler.handleDepositForBurn
has 9 return statements (exceeds 4 allowed). Open
Open
func (c *circleCCTPHandler) handleDepositForBurn(parentCtx context.Context, log *types.Log, chainID uint32) (msg *relayTypes.Message, err error) {
ctx, span := c.handler.Tracer().Start(parentCtx, "handleDepositForBurn", trace.WithAttributes(
attribute.String(metrics.TxHash, log.TxHash.Hex()),
attribute.Int(metrics.ChainID, int(chainID)),
attribute.Int("block_number", int(log.BlockNumber)),
Method circleCCTPHandler.HandleLog
has 7 return statements (exceeds 4 allowed). Open
Open
func (c *circleCCTPHandler) HandleLog(ctx context.Context, log *types.Log, chainID uint32) (processQueue bool, err error) {
if log == nil {
return false, fmt.Errorf("log is nil")
}
Method circleCCTPHandler.getMessagePayload
has 7 return statements (exceeds 4 allowed). Open
Open
func (c *circleCCTPHandler) getMessagePayload(ctx context.Context, txHash common.Hash, chainID uint32, ethClient client.EVM) (message []byte, err error) {
chainCfg, err := c.cfg.GetChainConfig(chainID)
if err != nil {
return nil, fmt.Errorf("could not get chain config: %w", err)
}
Method circleCCTPHandler.handleMessageReceived
has 7 return statements (exceeds 4 allowed). Open
Open
func (c *circleCCTPHandler) handleMessageReceived(parentCtx context.Context, log *types.Log, chainID uint32) (err error) {
ctx, span := c.handler.Tracer().Start(parentCtx, "handleMessageReceived", trace.WithAttributes(
attribute.String(metrics.TxHash, log.TxHash.Hex()),
attribute.Int(metrics.ChainID, int(chainID)),
attribute.Int("block_number", int(log.BlockNumber)),
Method circleCCTPHandler.FetchAndProcessSentEvent
has 7 return statements (exceeds 4 allowed). Open
Open
func (c *circleCCTPHandler) FetchAndProcessSentEvent(parentCtx context.Context, txHash common.Hash, chainID uint32) (msg *relayTypes.Message, err error) {
ctx, span := c.handler.Tracer().Start(parentCtx, "FetchAndProcessSentEvent", trace.WithAttributes(
attribute.String(metrics.TxHash, txHash.String()),
attribute.Int(metrics.ChainID, int(chainID)),
))
Function NewCircleCCTPHandler
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func NewCircleCCTPHandler(ctx context.Context, cfg config.Config, db db2.CCTPRelayerDB, omniRPCClient omniClient.RPCClient, txSubmitter submitter.TransactionSubmitter, handler metrics.Handler) (CCTPHandler, error) {
Method circleCCTPHandler.SubmitReceiveMessage
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *circleCCTPHandler) SubmitReceiveMessage(parentCtx context.Context, msg *relayTypes.Message) (err error) {
ctx, span := c.handler.Tracer().Start(parentCtx, "SubmitReceiveMessage", trace.WithAttributes(
attribute.String("message_hash", msg.MessageHash),
attribute.Int(metrics.ChainID, int(msg.DestChainID)),
))
Function NewCircleCCTPHandler
has 5 return statements (exceeds 4 allowed). Open
Open
func NewCircleCCTPHandler(ctx context.Context, cfg config.Config, db db2.CCTPRelayerDB, omniRPCClient omniClient.RPCClient, txSubmitter submitter.TransactionSubmitter, handler metrics.Handler) (CCTPHandler, error) {
boundMessageTransmitters := make(map[uint32]*messagetransmitter.MessageTransmitter)
for _, chain := range cfg.Chains {
cl, err := omniRPCClient.GetConfirmationsClient(ctx, int(chain.ChainID), 1)
if err != nil {