Default to sent if confirmations not enabled

This commit is contained in:
Andrea Maria Piana 2021-11-19 12:21:43 +00:00
parent 272342fb6b
commit 1d752c087f
3 changed files with 8 additions and 2 deletions

View File

@ -1 +1 @@
0.91.4
0.91.5

View File

@ -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])
}
}
}

View File

@ -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() {