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

Account for NumParts in NewRandom...ChannelProposal

Open matthiasgeihs opened this issue 3 years ago • 2 comments

NewRandomLedgerChannelProposal and NewRandomSubChannelProposal do the same thing. I don't know why. Just was doing the same.

Originally posted by @matthiasgeihs in https://github.com/hyperledger-labs/go-perun/pull/123#discussion_r662396964

matthiasgeihs avatar Jul 02 '21 08:07 matthiasgeihs

Looking at the functions, there is a thing that worries me even more:
NewRandomSubChannelProposal, NewRandomVirtualChannelProposal, NewRandomLedgerChannelProposalBy and NewRandomLedgerChannelProposal all accept ProposalOpts instead of RandomOpts.

This leads to weird things, like having to hardcode the number of participants to 2 or not being able to modify the ChallengeDuration.
Maybe this explains our confusion as we looked at the functions in the review :see_no_evil:

PS: I will try to fix it if it is possible in a few lines.

ggwpez avatar Jul 09 '21 13:07 ggwpez

Okay it seems to be a bigger thing, because RandomOpts for ParentID, ParentIDs, NumParentIDs, IndexMaps etc. would need to be created.

ggwpez avatar Jul 09 '21 13:07 ggwpez