perun-network / perun-eth-payment

Simplified payment channel API of go-perun.
Apache License 2.0
5 stars 1 forks source link

Move methods `Client.HandleProposal`, `HandleUpdate` and `HandleAdjudicatorEvent` to an unexported type #8

Open sebastianst opened 3 years ago

sebastianst commented 3 years ago

The API currently exposes those two methods that should not be used (as the docs also state), which is confusing. It also clutters the API of the Client.

Better create typedefs like

type (
  clientHandler Client
  channelHandler Channel
)

then move the methods onto these types and where you previously passed instances c as handlers, you pass (*clientHandler)(c) or (*channelHandler)(c).