@@ -86,18 +86,18 @@ type (
8686 // ExecConfig contains additional config parameters for the tests.
8787 ExecConfig interface {
8888 Peers () [2 ]map [wallet.BackendID ]wire.Address // must match the RoleSetup.Identity's
89- Asset () channel.Asset // single Asset to use in this channel
90- Backend () wallet.BackendID // backend corresponding to asset
91- InitBals () [2 ]* big.Int // channel deposit of each role
89+ Asset () [] channel.Asset // single Asset to use in this channel
90+ Backend () [] wallet.BackendID // backend corresponding to asset
91+ InitBals () [][ 2 ]* big.Int // channel deposit of each role
9292 App () client.ProposalOpts // must be either WithApp or WithoutApp
9393 }
9494
9595 // BaseExecConfig contains base config parameters.
9696 BaseExecConfig struct {
9797 peers [2 ]map [wallet.BackendID ]wire.Address // must match the RoleSetup.Identity's
98- asset channel.Asset // single Asset to use in this channel
99- backend wallet.BackendID // backend corresponding to asset
100- initBals [2 ]* big.Int // channel deposit of each role
98+ asset [] channel.Asset // single Asset to use in this channel
99+ backend [] wallet.BackendID // backend corresponding to asset
100+ initBals [][ 2 ]* big.Int // channel deposit of each role
101101 app client.ProposalOpts // must be either WithApp or WithoutApp
102102 }
103103
@@ -185,9 +185,9 @@ func ExecuteTwoPartyTest(ctx context.Context, t *testing.T, role [2]Executer, cf
185185// MakeBaseExecConfig creates a new BaseExecConfig.
186186func MakeBaseExecConfig (
187187 peers [2 ]map [wallet.BackendID ]wire.Address ,
188- asset channel.Asset ,
189- backend wallet.BackendID ,
190- initBals [2 ]* big.Int ,
188+ asset [] channel.Asset ,
189+ backend [] wallet.BackendID ,
190+ initBals [][ 2 ]* big.Int ,
191191 app client.ProposalOpts ,
192192) BaseExecConfig {
193193 return BaseExecConfig {
@@ -205,17 +205,17 @@ func (c *BaseExecConfig) Peers() [2]map[wallet.BackendID]wire.Address {
205205}
206206
207207// Asset returns the asset.
208- func (c * BaseExecConfig ) Asset () channel.Asset {
208+ func (c * BaseExecConfig ) Asset () [] channel.Asset {
209209 return c .asset
210210}
211211
212212// Backend returns the asset.
213- func (c * BaseExecConfig ) Backend () wallet.BackendID {
213+ func (c * BaseExecConfig ) Backend () [] wallet.BackendID {
214214 return c .backend
215215}
216216
217217// InitBals returns the initial balances.
218- func (c * BaseExecConfig ) InitBals () [2 ]* big.Int {
218+ func (c * BaseExecConfig ) InitBals () [][ 2 ]* big.Int {
219219 return c .initBals
220220}
221221
@@ -355,13 +355,19 @@ func (r *role) LedgerChannelProposal(rng *rand.Rand, cfg ExecConfig) *client.Led
355355 r .log .Panic ("Invalid ExecConfig: App does not specify an app." )
356356 }
357357
358- peers , asset , bals := cfg .Peers (), cfg .Asset (), cfg .InitBals ()
359- alloc := channel .NewAllocation (len (peers ), []wallet.BackendID {cfg .Backend ()}, asset )
360- alloc .SetAssetBalances (asset , bals [:])
358+ peers , assets , bals , backend := cfg .Peers (), cfg .Asset (), cfg .InitBals (), cfg .Backend ()
359+ alloc := channel .NewAllocation (len (peers ), cfg .Backend (), assets ... )
360+ for i := range assets {
361+ alloc .SetAssetBalances (assets [i ], bals [i ][:])
362+ }
361363
364+ peersList := make (map [wallet.BackendID ]wallet.Address )
365+ for i := range backend {
366+ peersList [backend [i ]] = r .setup .Wallet [backend [i ]].NewRandomAccount (rng ).Address ()
367+ }
362368 prop , err := client .NewLedgerChannelProposal (
363369 r .challengeDuration ,
364- map [wallet. BackendID ]wallet. Address { cfg . Backend (): r . setup . Wallet [ cfg . Backend ()]. NewRandomAccount ( rng ). Address ()} ,
370+ peersList ,
365371 alloc ,
366372 peers [:],
367373 client .WithNonceFrom (rng ),
0 commit comments