2018-04-11 18:41:51 +03:00
|
|
|
package shhext
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/ethereum/go-ethereum/common"
|
2018-05-03 09:35:58 +02:00
|
|
|
"github.com/status-im/status-go/signal"
|
2018-04-11 18:41:51 +03:00
|
|
|
)
|
|
|
|
|
2018-04-13 08:52:22 +03:00
|
|
|
// EnvelopeSignalHandler sends signals when envelope is sent or expired.
|
|
|
|
type EnvelopeSignalHandler struct{}
|
|
|
|
|
|
|
|
// EnvelopeSent triggered when envelope delivered atleast to 1 peer.
|
|
|
|
func (h EnvelopeSignalHandler) EnvelopeSent(hash common.Hash) {
|
2018-05-03 09:35:58 +02:00
|
|
|
signal.SendEnvelopeSent(hash)
|
2018-04-13 08:52:22 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// EnvelopeExpired triggered when envelope is expired but wasn't delivered to any peer.
|
|
|
|
func (h EnvelopeSignalHandler) EnvelopeExpired(hash common.Hash) {
|
2018-05-03 09:35:58 +02:00
|
|
|
signal.SendEnvelopeExpired(hash)
|
2018-04-11 18:41:51 +03:00
|
|
|
}
|