Skip to content

Commit 1e59ec1

Browse files
committed
check writer is enabled for Store()
1 parent e5617f9 commit 1e59ec1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

daserver/celestia.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,11 @@ func (c *CelestiaDA) Store(ctx context.Context, message []byte) ([]byte, error)
313313
return nil, errors.New("NoopWriter enabled")
314314
}
315315

316+
if !c.Cfg.WithWriter {
317+
log.Warn("Attempted to call Store() without writer enabled", "cfg.withWriter", c.Cfg.WithWriter)
318+
return nil, errors.New("writer not enabled")
319+
}
320+
316321
// Create hash of message to use as cache key
317322
msgHash := crypto.Keccak256(message)
318323
msgHashHex := hex.EncodeToString(msgHash)

0 commit comments

Comments
 (0)