Added a signal to emit after the AccountPayloadManager processes the multiaccounts.Account (#3228)
This commit is contained in:
parent
d0cc036d48
commit
90d4dde64b
|
@ -4,16 +4,18 @@ package pairing
|
|||
type EventType string
|
||||
|
||||
const (
|
||||
// Both Sender and Receiver
|
||||
|
||||
// both client and server
|
||||
EventConnectionError EventType = "connection-error"
|
||||
EventConnectionSuccess EventType = "connection-success"
|
||||
EventTransferError EventType = "transfer-error"
|
||||
EventTransferSuccess EventType = "transfer-success"
|
||||
|
||||
// Only receiver side
|
||||
EventProcessSuccess EventType = "process-success"
|
||||
EventProcessError EventType = "process-error"
|
||||
// Only Receiver side
|
||||
|
||||
EventReceivedAccount EventType = "received-account"
|
||||
EventProcessSuccess EventType = "process-success"
|
||||
EventProcessError EventType = "process-error"
|
||||
)
|
||||
|
||||
// Event is a type for transfer events.
|
||||
|
@ -21,6 +23,7 @@ type Event struct {
|
|||
Type EventType `json:"type"`
|
||||
Error string `json:"error,omitempty"`
|
||||
Action Action `json:"action"`
|
||||
Data any `json:"data,omitempty"`
|
||||
}
|
||||
|
||||
type Action int
|
||||
|
|
|
@ -19,6 +19,7 @@ import (
|
|||
"github.com/status-im/status-go/params"
|
||||
"github.com/status-im/status-go/protocol/common"
|
||||
"github.com/status-im/status-go/protocol/protobuf"
|
||||
"github.com/status-im/status-go/signal"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -253,6 +254,8 @@ func (apm *AccountPayloadManager) Receive(data []byte) error {
|
|||
zap.Binary("accountPayloadMarshaller.Received()", apm.Received()),
|
||||
)
|
||||
|
||||
signal.SendLocalPairingEvent(Event{Type: EventReceivedAccount, Action: ActionPairingAccount, Data: apm.accountPayload.multiaccount})
|
||||
|
||||
return apm.payloadRepository.StoreToSource()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue