-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chequebook: change cashout api to include uncashed amount #1402
Conversation
82897b6
to
9ce168a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i presume s.swap.CashoutStatus(r.Context(), peer)
fills in UncashedAmount
and it is tested.
@zelig swap just translates from peer to chequebook and forwards the reference to the cashout status struct, so there was no change necessary there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
var action *cashoutAction | ||
err := s.store.Get(cashoutActionKey(chequebookAddress), &action) | ||
err = s.store.Get(cashoutActionKey(chequebookAddress), &action) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider initializing action as an instance, then just pass the address here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
c423a39
to
a8878a0
Compare
a8878a0
to
8679e0e
Compare
changes the GET cashout endpoint to include uncashed amount. it always returns uncashed amount even if no cashout has taken place so far (as long as we have in fact at least one cheque from the peer).
The main advantage of putting this into cashout endpoint are easier cashout scripts as we can all relevant values in one call and better handling of currently pending or cancelled transactions (in the calculation of uncashed amount).
This is an API-breaking change as in addition to the new
uncashedAmount
, several values moved intolastCashedCheque
(which may benull
).