synapsecns/sanguine

View on GitHub
services/rfq/guard/service/handlers.go

Summary

Maintainability
A
3 hrs
Test Coverage

Method Guard.handleProveCalled has 11 return statements (exceeds 4 allowed).
Open

func (g *Guard) handleProveCalled(parentCtx context.Context, proven *guarddb.PendingProven) (err error) {
    ctx, span := g.metrics.Tracer().Start(parentCtx, "handleProveCalled", trace.WithAttributes(
        attribute.String("transaction_id", hexutil.Encode(proven.TransactionID[:])),
    ))
    defer func() {
Severity: Major
Found in services/rfq/guard/service/handlers.go - About 1 hr to fix

    Function relayMatchesBridgeRequest has 8 return statements (exceeds 4 allowed).
    Open

    func relayMatchesBridgeRequest(event *fastbridge.FastBridgeBridgeRelayed, bridgeRequest *guarddb.BridgeRequest) bool {
        // TODO: is this exhaustive?
        if event.TransactionId != bridgeRequest.TransactionID {
            return false
        }
    Severity: Major
    Found in services/rfq/guard/service/handlers.go - About 50 mins to fix

      Method Guard.handleBridgeRequestedLog has 7 return statements (exceeds 4 allowed).
      Open

      func (g *Guard) handleBridgeRequestedLog(parentCtx context.Context, req *fastbridge.FastBridgeBridgeRequested, chainID int) (err error) {
          ctx, span := g.metrics.Tracer().Start(parentCtx, "handleBridgeRequestedLog-guard", trace.WithAttributes(
              attribute.Int(metrics.Origin, chainID),
              attribute.String("transaction_id", hexutil.Encode(req.TransactionId[:])),
          ))
      Severity: Major
      Found in services/rfq/guard/service/handlers.go - About 45 mins to fix

        Method Guard.isProveValid has 7 return statements (exceeds 4 allowed).
        Open

        func (g *Guard) isProveValid(ctx context.Context, proven *guarddb.PendingProven, bridgeRequest *guarddb.BridgeRequest) (bool, error) {
            span := trace.SpanFromContext(ctx)
        
            // get the receipt for this tx on dest chain
            chainClient, err := g.client.GetChainClient(ctx, int(bridgeRequest.Transaction.DestChainId))
        Severity: Major
        Found in services/rfq/guard/service/handlers.go - About 45 mins to fix

          There are no issues that match your filters.

          Category
          Status