-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Line 58 in bf78d4d
| const paymentRequest = { |
I'm looking at the paymentRequest function and I find it somewhat confusing.
The payment request has a from and to props. Then we construct a message for the relay server and add counterParty and user that are equal to toand from.
At the end we return basically the const message defined on line 71, but override the direction. Hä, why do we override it? Why do we set the direction to "received" when we send the request to the relay server and then we return direction set to sent?
paymentRequestDecline accepts a counterPartyAddress and an id to decline. Then it returns a message object. The returned id however is set to the id that we are trying to decline. That's confusing - I would expect that paymentRequest and paymentRequestDecline generate different ids. At the end - those are unique actions. They should be connected through the use of a meta flag or a prop such as foreign_id -> to indicate the id of the message deleted.
The message returned from paymentMessage has no idprop at all? For the sake of uniformity I would have an id for paymentMessage as well.