@@ -282,9 +282,14 @@ func TestAllocationValidLimits(t *testing.T) {
282282 }
283283
284284 for i := range allocation .Locked {
285- allocation .Locked [i ] = channel.SubAlloc {
286- ID : channel.ID {byte (i ), byte (i >> 8 ), byte (i >> 16 ), byte (i >> 24 )},
287- Bals : make ([]channel.Bal , x .numAssets )}
285+ allocation .Locked [i ] = * channel .NewSubAlloc (
286+ channel.ID {byte (i ), byte (i >> 8 ), byte (i >> 16 ), byte (i >> 24 )},
287+ make ([]channel.Bal , x .numAssets ),
288+ )
289+ allocation .Locked [i ] = * channel .NewSubAlloc (
290+ channel.ID {byte (i ), byte (i >> 8 ), byte (i >> 16 ), byte (i >> 24 )},
291+ make ([]channel.Bal , x .numAssets ),
292+ )
288293
289294 for j := range allocation .Locked [i ].Bals {
290295 bal := big .NewInt (int64 (x .numAssets )* int64 (i ) + int64 (j ) + 1 )
@@ -372,7 +377,7 @@ func TestAllocation_Sum(t *testing.T) {
372377
373378 {
374379 "single asset/one participants/one locked" ,
375- * test .NewRandomAllocation (rng , test .WithNumAssets (1 ), test .WithNumParts (1 ), test .WithLocked (channel.SubAlloc { Bals : []channel.Bal {big .NewInt (2 )}} ), test .WithBalancesInRange (big .NewInt (1 ), big .NewInt (1 ))),
380+ * test .NewRandomAllocation (rng , test .WithNumAssets (1 ), test .WithNumParts (1 ), test .WithLocked (* channel .NewSubAlloc (channel. ID {}, []channel.Bal {big .NewInt (2 )}) ), test .WithBalancesInRange (big .NewInt (1 ), big .NewInt (1 ))),
376381 []channel.Bal {big .NewInt (3 )},
377382 },
378383
@@ -485,7 +490,7 @@ func TestAllocation_Valid(t *testing.T) {
485490 {big .NewInt (64 ), big .NewInt (128 )},
486491 },
487492 Locked : []channel.SubAlloc {
488- { channel .Zero , []channel.Bal {big .NewInt (4 )}} ,
493+ * channel .NewSubAlloc ( channel . Zero , []channel.Bal {big .NewInt (4 )}) ,
489494 },
490495 },
491496 false ,
@@ -501,7 +506,7 @@ func TestAllocation_Valid(t *testing.T) {
501506 {big .NewInt (64 ), big .NewInt (128 )},
502507 },
503508 Locked : []channel.SubAlloc {
504- { channel .Zero , []channel.Bal {big .NewInt (- 1 )}} ,
509+ * channel .NewSubAlloc ( channel . Zero , []channel.Bal {big .NewInt (- 1 )}) ,
505510 },
506511 },
507512 false ,
@@ -529,7 +534,7 @@ func TestAllocation_Valid(t *testing.T) {
529534 {big .NewInt (2 ), big .NewInt (16 )},
530535 },
531536 Locked : []channel.SubAlloc {
532- { channel .Zero , []channel.Bal {big .NewInt (4 ), big .NewInt (- 1 )}} ,
537+ * channel .NewSubAlloc ( channel . Zero , []channel.Bal {big .NewInt (4 ), big .NewInt (- 1 )}) ,
533538 },
534539 },
535540 false ,
@@ -549,9 +554,9 @@ func TestAllocation_Valid(t *testing.T) {
549554// suballocation serialization.
550555func TestSuballocSerialization (t * testing.T ) {
551556 ss := []perunio.Serializer {
552- & channel.SubAlloc { channel.ID {2 }, []channel.Bal {}} ,
553- & channel.SubAlloc { channel.ID {3 }, []channel.Bal {big .NewInt (0 )}} ,
554- & channel.SubAlloc { channel.ID {4 }, []channel.Bal {big .NewInt (5 ), big .NewInt (1 << 62 )}} ,
557+ channel .NewSubAlloc ( channel.ID {2 }, []channel.Bal {}) ,
558+ channel .NewSubAlloc ( channel.ID {3 }, []channel.Bal {big .NewInt (0 )}) ,
559+ channel .NewSubAlloc ( channel.ID {4 }, []channel.Bal {big .NewInt (5 ), big .NewInt (1 << 62 )}) ,
555560 }
556561
557562 iotest .GenericSerializerTest (t , ss ... )
0 commit comments