refactor_: decouple go-waku api from go-waku wakunode

This commit is contained in:
Richard Ramos 2024-10-15 19:18:27 -04:00
parent 441fee76d2
commit c207997071
No known key found for this signature in database
GPG Key ID: 1CE87DB518195760
1 changed files with 3 additions and 3 deletions

View File

@ -1145,7 +1145,7 @@ func (w *Waku) Start() error {
if w.cfg.EnableMissingMessageVerification { if w.cfg.EnableMissingMessageVerification {
w.missingMsgVerifier = missing.NewMissingMessageVerifier( w.missingMsgVerifier = missing.NewMissingMessageVerifier(
w.node.Store(), missing.NewDefaultStorenodeRequestor(w.node.Store()),
w, w,
w.node.Timesource(), w.node.Timesource(),
w.logger) w.logger)
@ -1293,7 +1293,7 @@ func (w *Waku) startMessageSender() error {
publishMethod = publish.LightPush publishMethod = publish.LightPush
} }
sender, err := publish.NewMessageSender(publishMethod, w.node.Lightpush(), w.node.Relay(), w.logger) sender, err := publish.NewMessageSender(publishMethod, publish.NewDefaultPublisher(w.node.Lightpush(), w.node.Relay()), w.logger)
if err != nil { if err != nil {
w.logger.Error("failed to create message sender", zap.Error(err)) w.logger.Error("failed to create message sender", zap.Error(err))
return err return err
@ -1302,7 +1302,7 @@ func (w *Waku) startMessageSender() error {
if w.cfg.EnableStoreConfirmationForMessagesSent { if w.cfg.EnableStoreConfirmationForMessagesSent {
msgStoredChan := make(chan gethcommon.Hash, 1000) msgStoredChan := make(chan gethcommon.Hash, 1000)
msgExpiredChan := make(chan gethcommon.Hash, 1000) msgExpiredChan := make(chan gethcommon.Hash, 1000)
messageSentCheck := publish.NewMessageSentCheck(w.ctx, w.node.Store(), w.StorenodeCycle, w.node.Timesource(), msgStoredChan, msgExpiredChan, w.logger) messageSentCheck := publish.NewMessageSentCheck(w.ctx, publish.NewDefaultStorenodeMessageVerifier(w.node.Store()), w.StorenodeCycle, w.node.Timesource(), msgStoredChan, msgExpiredChan, w.logger)
sender.WithMessageSentCheck(messageSentCheck) sender.WithMessageSentCheck(messageSentCheck)
w.wg.Add(1) w.wg.Add(1)