chore!: wallet related signals alignment
A signal type `wallet` which had an event `type` set to `sing-transactions` is now a new signal type `wallt.sing.transactions` with event which represents list of transactions that need to be signed.
This commit is contained in:
parent
6e52565356
commit
8bcb6ce667
|
@ -68,7 +68,7 @@ func (tm *TransactionManager) SendTransactionForSigningToKeycard(ctx context.Con
|
|||
return err
|
||||
}
|
||||
|
||||
signal.SendTransactionsForSigningEvent(hashes)
|
||||
signal.SendWalletEvent(signal.SignTransactions, hashes)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ func (tmr *SignalsTransmitter) Start() error {
|
|||
return
|
||||
case event := <-events:
|
||||
if !event.Type.IsInternal() {
|
||||
signal.SendWalletEvent(event)
|
||||
signal.SendWalletEvent(signal.Wallet, event)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +1,13 @@
|
|||
package signal
|
||||
|
||||
type SignalType string
|
||||
|
||||
const (
|
||||
walletEvent = "wallet"
|
||||
Wallet = SignalType("wallet")
|
||||
SignTransactions = SignalType("wallet.sign.transactions")
|
||||
)
|
||||
|
||||
type UnsignedTransactions struct {
|
||||
Type string `json:"type"`
|
||||
Transactions []string `json:"transactions"`
|
||||
}
|
||||
|
||||
// SendWalletEvent sends event from services/wallet/events.
|
||||
func SendWalletEvent(event interface{}) {
|
||||
send(walletEvent, event)
|
||||
}
|
||||
|
||||
func SendTransactionsForSigningEvent(transactions []string) {
|
||||
send(walletEvent, UnsignedTransactions{Type: "sing-transactions", Transactions: transactions})
|
||||
func SendWalletEvent(signalType SignalType, event interface{}) {
|
||||
send(string(signalType), event)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue