@@ -88,18 +88,18 @@ type (
8888 // ExecConfig contains additional config parameters for the tests.
8989 ExecConfig interface {
9090 Peers () [2 ]map [wallet.BackendID ]wire.Address // must match the RoleSetup.Identity's
91- Asset () channel.Asset // single Asset to use in this channel
92- Backend () wallet.BackendID // backend corresponding to asset
93- InitBals () [2 ]* big.Int // channel deposit of each role
91+ Asset () [] channel.Asset // single Asset to use in this channel
92+ Backend () [] wallet.BackendID // backend corresponding to asset
93+ InitBals () [][ 2 ]* big.Int // channel deposit of each role
9494 App () client.ProposalOpts // must be either WithApp or WithoutApp
9595 }
9696
9797 // BaseExecConfig contains base config parameters.
9898 BaseExecConfig struct {
9999 peers [2 ]map [wallet.BackendID ]wire.Address // must match the RoleSetup.Identity's
100- asset channel.Asset // single Asset to use in this channel
101- backend wallet.BackendID // backend corresponding to asset
102- initBals [2 ]* big.Int // channel deposit of each role
100+ asset [] channel.Asset // single Asset to use in this channel
101+ backend [] wallet.BackendID // backend corresponding to asset
102+ initBals [][ 2 ]* big.Int // channel deposit of each role
103103 app client.ProposalOpts // must be either WithApp or WithoutApp
104104 }
105105
@@ -188,9 +188,9 @@ func ExecuteTwoPartyTest(ctx context.Context, t *testing.T, role [2]Executer, cf
188188// MakeBaseExecConfig creates a new BaseExecConfig.
189189func MakeBaseExecConfig (
190190 peers [2 ]map [wallet.BackendID ]wire.Address ,
191- asset channel.Asset ,
192- backend wallet.BackendID ,
193- initBals [2 ]* big.Int ,
191+ asset [] channel.Asset ,
192+ backend [] wallet.BackendID ,
193+ initBals [][ 2 ]* big.Int ,
194194 app client.ProposalOpts ,
195195) BaseExecConfig {
196196 return BaseExecConfig {
@@ -208,17 +208,17 @@ func (c *BaseExecConfig) Peers() [2]map[wallet.BackendID]wire.Address {
208208}
209209
210210// Asset returns the asset.
211- func (c * BaseExecConfig ) Asset () channel.Asset {
211+ func (c * BaseExecConfig ) Asset () [] channel.Asset {
212212 return c .asset
213213}
214214
215215// Backend returns the asset.
216- func (c * BaseExecConfig ) Backend () wallet.BackendID {
216+ func (c * BaseExecConfig ) Backend () [] wallet.BackendID {
217217 return c .backend
218218}
219219
220220// InitBals returns the initial balances.
221- func (c * BaseExecConfig ) InitBals () [2 ]* big.Int {
221+ func (c * BaseExecConfig ) InitBals () [][ 2 ]* big.Int {
222222 return c .initBals
223223}
224224
@@ -358,13 +358,19 @@ func (r *role) LedgerChannelProposal(rng *rand.Rand, cfg ExecConfig) *client.Led
358358 r .log .Panic ("Invalid ExecConfig: App does not specify an app." )
359359 }
360360
361- peers , asset , bals := cfg .Peers (), cfg .Asset (), cfg .InitBals ()
362- alloc := channel .NewAllocation (len (peers ), []wallet.BackendID {cfg .Backend ()}, asset )
363- alloc .SetAssetBalances (asset , bals [:])
361+ peers , assets , bals , backend := cfg .Peers (), cfg .Asset (), cfg .InitBals (), cfg .Backend ()
362+ alloc := channel .NewAllocation (len (peers ), cfg .Backend (), assets ... )
363+ for i := range assets {
364+ alloc .SetAssetBalances (assets [i ], bals [i ][:])
365+ }
364366
367+ peersList := make (map [wallet.BackendID ]wallet.Address )
368+ for i := range backend {
369+ peersList [backend [i ]] = r .setup .Wallet [backend [i ]].NewRandomAccount (rng ).Address ()
370+ }
365371 prop , err := client .NewLedgerChannelProposal (
366372 r .challengeDuration ,
367- map [wallet. BackendID ]wallet. Address { cfg . Backend (): r . setup . Wallet [ cfg . Backend ()]. NewRandomAccount ( rng ). Address ()} ,
373+ peersList ,
368374 alloc ,
369375 peers [:],
370376 client .WithNonceFrom (rng ),
0 commit comments