go-perun icon indicating copy to clipboard operation
go-perun copied to clipboard

Simplify channel proposal acceptance

Open matthiasgeihs opened this issue 4 years ago • 0 comments

The current way of accepting a ledger channel proposal lcp is as follows.

acceptance := lcp.Accept(part, nonce)
r.Accept(h.conn.Context(), acceptance)
  1. It is confusing that accept needs to be called on the proposal and the proposal responder.
  2. In most cases we provide a nonce via client.WithRandomNonce(), which does not depend on any parameters.

Regarding 2.: We can make the nonce parameter optional and let the default behavior be that the nonce is chosen as client.WithRandomNonce().

Regarding 1.: We should consider combining lcp.Accept and r.Accept into one function. We might even consider combining lcp and r into one object. Alternatively, we should at least rename lcp.Accept to make it clear, that it does not accept the proposal, but only generates the acceptance message.

matthiasgeihs avatar May 14 '21 07:05 matthiasgeihs