From 1d752c087f34f44bb8ad5dd477e398567d991be8 Mon Sep 17 00:00:00 2001 From: Andrea Maria Piana Date: Fri, 19 Nov 2021 12:21:43 +0000 Subject: [PATCH] Default to sent if confirmations not enabled --- VERSION | 2 +- protocol/transport/envelopes_monitor.go | 6 ++++++ protocol/transport/envelopes_monitor_test.go | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index ad7e0bcae..1d5e6c02b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.91.4 +0.91.5 diff --git a/protocol/transport/envelopes_monitor.go b/protocol/transport/envelopes_monitor.go index 7ecc2d698..f230396e2 100644 --- a/protocol/transport/envelopes_monitor.go +++ b/protocol/transport/envelopes_monitor.go @@ -189,6 +189,12 @@ func (m *EnvelopesMonitor) handleEventEnvelopeSent(event types.EnvelopeEvent) { } m.batches[event.Batch][event.Hash] = struct{}{} m.logger.Debug("waiting for a confirmation", zap.String("batch", event.Batch.String())) + } else { + m.logger.Debug("confirmation not expected, marking as sent") + m.envelopes[event.Hash] = EnvelopeSent + if m.handler != nil { + m.handler.EnvelopeSent(m.identifiers[event.Hash]) + } } } diff --git a/protocol/transport/envelopes_monitor_test.go b/protocol/transport/envelopes_monitor_test.go index c3862ca7a..72e86af7c 100644 --- a/protocol/transport/envelopes_monitor_test.go +++ b/protocol/transport/envelopes_monitor_test.go @@ -50,7 +50,7 @@ func (s *EnvelopesMonitorSuite) TestEnvelopePosted() { Hash: testHash, }) s.Contains(s.monitor.envelopes, testHash) - s.Equal(EnvelopePosted, s.monitor.envelopes[testHash]) + s.Equal(EnvelopeSent, s.monitor.envelopes[testHash]) } func (s *EnvelopesMonitorSuite) TestConfirmedWithAcknowledge() {