diff --git a/pkg/rpc/server/da_visualization.go b/pkg/rpc/server/da_visualization.go index 008f88f40..e14a06910 100644 --- a/pkg/rpc/server/da_visualization.go +++ b/pkg/rpc/server/da_visualization.go @@ -8,6 +8,7 @@ import ( "fmt" "html/template" "net/http" + "slices" "sync" "time" @@ -199,15 +200,12 @@ func (s *DAVisualizationServer) handleDABlobDetails(w http.ResponseWriter, r *ht if !found { s.mutex.RLock() for _, submission := range s.submissions { - for _, subBlobID := range submission.BlobIDs { - if subBlobID == blobID { - if submission.Namespace != "" { - if ns, err := hex.DecodeString(submission.Namespace); err == nil { - namespace = ns - found = true - } + if slices.Contains(submission.BlobIDs, blobID) { + if submission.Namespace != "" { + if ns, err := hex.DecodeString(submission.Namespace); err == nil { + namespace = ns + found = true } - break } } if found { diff --git a/tools/local-da/rpc.go b/tools/local-da/rpc.go index 60dd51ac4..e90071efa 100644 --- a/tools/local-da/rpc.go +++ b/tools/local-da/rpc.go @@ -4,6 +4,7 @@ import ( "context" "errors" "net/http" + "slices" "time" libshare "github.com/celestiaorg/go-square/v3/share" @@ -93,11 +94,8 @@ func (s *blobServer) GetAll(_ context.Context, height uint64, namespaces []libsh out := make([]*jsonrpc.Blob, 0, len(blobs)) for _, b := range blobs { - for _, ns := range namespaces { - if b.Namespace().Equals(ns) { - out = append(out, b) - break - } + if b != nil && slices.ContainsFunc(namespaces, b.Namespace().Equals) { + out = append(out, b) } }