From 0c47d5154d93e19767753fc6a46cfadb8ad393e3 Mon Sep 17 00:00:00 2001 From: Ian Shim Date: Mon, 4 Mar 2024 16:32:17 -0800 Subject: [PATCH] match wrapped errors --- core/validator.go | 2 +- node/node.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/validator.go b/core/validator.go index 93e1fae25f..c7b090cbae 100644 --- a/core/validator.go +++ b/core/validator.go @@ -132,7 +132,7 @@ func (v *chunkValidator) ValidateBatch(blobs []*BlobMessage, operatorState *Oper // for each quorum for _, quorumHeader := range blob.BlobHeader.QuorumInfos { chunks, assignment, params, err := v.validateBlobQuorum(quorumHeader, blob, operatorState) - if err == ErrBlobQuorumSkip { + if errors.Is(err, ErrBlobQuorumSkip) { continue } else if err != nil { return err diff --git a/node/node.go b/node/node.go index 728b06d3de..9a91b12832 100644 --- a/node/node.go +++ b/node/node.go @@ -303,7 +303,7 @@ func (n *Node) ProcessBatch(ctx context.Context, header *core.BatchHeader, blobs if err != nil { // If batch already exists, we don't store it again, but we should not // error out in such case. - if err == ErrBatchAlreadyExist { + if errors.Is(err, ErrBatchAlreadyExist) { storeChan <- storeResult{err: nil, keys: nil, latency: 0} } else { storeChan <- storeResult{err: fmt.Errorf("failed to store batch: %w", err), keys: nil, latency: 0}