Skip to content

Commit 7af28d5

Browse files
authored
Remove channelID map (#413)
* feat(wallet, channel): Change backend to map of backends feat(Asset, Adjudicator): Add AssetID struct to identify assets with LedgerID and BackendID feat(persistence, wire): Use map[int]Address to identify clients Signed-off-by: Sophia Koehler <sophia@perun.network> * fix(multi): Add AssetIDKey struct to fix the map lookups for funders and adjudicators. fix(randomizer): Lookup backend opts to correctly initialize address maps. fix(test): Generalize tests to be used in other backends. Signed-off-by: Sophia Koehler <sophia@perun.network> * fix(all): Use map[int]ID instead of id for each backend. Signed-off-by: Sophia Koehler <sophia@perun.network> * fix(all): Add map of IDs Signed-off-by: Sophia Koehler <sophia@perun.network> * fix(channel/backend): Revert change in verify. fix(wallet/wallet, wallet/account): Revert changed definition. feat(client): Add wallet map to client for each backend. Signed-off-by: Sophia Koehler <sophia@perun.network> * fix(Adjudicator): Change to singular channel ID in events. Signed-off-by: Sophia Koehler <sophia@perun.network> * fix(client/test): Generalize role test. Signed-off-by: Sophia Koehler <sophia@perun.network> * feat(channel): Add backend field check. feat(client/test, wire): Add backendID arguments. Signed-off-by: Sophia Koehler <sophia@perun.network> * fix(subchannel_dispute): Generalize event watcher. Signed-off-by: Sophia Koehler <sophia@perun.network> * feat: Asset Address function to handle encoding in backends. Signed-off-by: Sophia Koehler <sophia@perun.network> * feat(apps/payment, backend/sim, channel/test, client/test, log, wallet, ): Specify backend for randomizers feat(channel/multi): Change AssetID to interface feat(channel/persistence, client/test): Generalize test for backends Signed-off-by: Sophia Koehler <sophia@perun.network> * fix(asset.go, allocation.go): Adjust Address() to return byte[] instead of string. fix(params.go): Change IDKey to encode map entries sorted by keys. fix(backend.go): Use BackendID in argument to sign depending on backend. fix(address.go): Sort Addresses by keys before adding them to Keys. Signed-off-by: Sophia Koehler <sophia@perun.network> * chore: Remove unnecessary logs Signed-off-by: Sophia Koehler <sophia@perun.network> * fix: Remove repeated assetIDs in LedgerID array Signed-off-by: Sophia Koehler <sophia@perun.network> * chore: update go.sum, gofmt some files Signed-off-by: Sophia Koehler <sophia@perun.network> * fix(wallet/backend.go): Return just one error instead of concatenation of errors chore(All): Run gofmt and sort imports Signed-off-by: Sophia Koehler <sophia@perun.network> * fix(golangci.yml): Exclude generated file from linter chore: Refactor for linter Signed-off-by: Sophia Koehler <sophia@perun.network> * fix(ci): Use go1.18 for the any type in proto fix(golangci): Fix structure Signed-off-by: Sophia Koehler <sophia@perun.network> * fix(ci): Use glinter 1.45 which supports go1.18 Signed-off-by: Sophia Koehler <sophia@perun.network> * chore(all): Add nolint flags for conversions Signed-off-by: Sophia Koehler <sophia@perun.network> * chore(all): remove unnecessary flags Signed-off-by: Sophia Koehler <sophia@perun.network> * chore(all): remove unnecessary flags Signed-off-by: Sophia Koehler <sophia@perun.network> * chore(all): remove unnecessary flags Signed-off-by: Sophia Koehler <sophia@perun.network> * chore(all): remove unnecessary flags Signed-off-by: Sophia Koehler <sophia@perun.network> * chore(all): remove unnecessary flags Signed-off-by: Sophia Koehler <sophia@perun.network> * chore(all): remove unnecessary flags Signed-off-by: Sophia Koehler <sophia@perun.network> * chore(all): remove unnecessary flags Signed-off-by: Sophia Koehler <sophia@perun.network> * chore(all): Rename and add comments to exported functions Signed-off-by: Sophia Koehler <sophia@perun.network> * chore: Rename variables Signed-off-by: Sophia Koehler <sophia@perun.network> * fix(params, address): Fix index allocation Signed-off-by: Sophia Koehler <sophia@perun.network> * Revert "fix(all): Add map of IDs" Revert "fix(all): Use map[int]ID instead of id for each backend." This reverts commit ab8e60b and ef11de9 Signed-off-by: Sophia Koehler <sophia@perun.network> * fix(backend.go): Remove unnecessary errors.join() Signed-off-by: Sophia Koehler <sophia@perun.network> * fix: remove unnecessary else statement, add linter flag Signed-off-by: Sophia Koehler <sophia@perun.network> * refactor(/apps/payment, /sim/wallet, /channel, /client, /wallet, /wire): Name test backend ID in tests refactor(/multi, /client/test): Rename AssetID to MultiLedgerID Signed-off-by: Sophia Koehler <sophia@perun.network> * chore: Update proto binding, remove IDMap Signed-off-by: Sophia Koehler <sophia@perun.network> * refactor: Name TestBackendID, rename multiLedgerID to LedgerBackendID Signed-off-by: Sophia Koehler <sophia@perun.network> * refactor: Fix comment on exported function Signed-off-by: Sophia Koehler <sophia@perun.network> * chore(all): Update license dates Signed-off-by: Sophia Koehler <sophia@perun.network> * chore(backendtest): Rename to fix import issues Signed-off-by: Sophia Koehler <sophia@perun.network> * fix(allocation_test): Remove channelID map from merge fix(wire.pb.go): go fmt Signed-off-by: Sophia Koehler <sophia@perun.network> * fix(all): Fix errors from merge Signed-off-by: Sophia Koehler <sophia@perun.network> * chore(client_role_test): format file Signed-off-by: Sophia Koehler <sophia@perun.network> * chore: fix merge errors Signed-off-by: Sophia Koehler <sophia@perun.network> --------- Signed-off-by: Sophia Koehler <sophia@perun.network>
1 parent b53c36b commit 7af28d5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+773
-1174
lines changed

backend/sim/wallet/address.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ func NewRandomAddress(rng io.Reader) *Address {
6363

6464
// NewRandomAddresses creates a new address using the randomness
6565
// provided by rng.
66-
func NewRandomAddresses(rng io.Reader) map[int]wallet.Address {
66+
func NewRandomAddresses(rng io.Reader) map[wallet.BackendID]wallet.Address {
6767
privateKey, err := ecdsa.GenerateKey(curve, rng)
6868
if err != nil {
6969
log.Panicf("Creation of account failed with error", err)
7070
}
7171

72-
return map[int]wallet.Address{channel.TestBackendID: &Address{
72+
return map[wallet.BackendID]wallet.Address{channel.TestBackendID: &Address{
7373
Curve: privateKey.Curve,
7474
X: privateKey.X,
7575
Y: privateKey.Y,

channel/adjudicator.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ type (
9898
// subscription should be closed by calling Close on the subscription after
9999
// the channel is closed.
100100
EventSubscriber interface {
101-
Subscribe(context.Context, map[wallet.BackendID]ID) (AdjudicatorSubscription, error)
101+
Subscribe(context.Context, ID) (AdjudicatorSubscription, error)
102102
}
103103

104104
// An AdjudicatorReq collects all necessary information to make calls to the
@@ -204,7 +204,7 @@ type (
204204
}
205205

206206
// StateMap represents a channel state tree.
207-
StateMap map[string]*State
207+
StateMap map[ID]*State
208208
)
209209

210210
// NewProgressReq creates a new ProgressReq object.
@@ -302,13 +302,12 @@ func (t *TimeTimeout) String() string {
302302

303303
// MakeStateMap creates a new StateMap object.
304304
func MakeStateMap() StateMap {
305-
return make(map[string]*State)
305+
return make(map[ID]*State)
306306
}
307307

308308
// Add adds the given states to the state map.
309309
func (m StateMap) Add(states ...*State) {
310310
for _, s := range states {
311-
key := IDKey(s.ID)
312-
m[key] = s
311+
m[s.ID] = s
313312
}
314313
}

channel/allocation.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ type (
8282
// The size of the balances slice must be of the same size as the assets slice
8383
// of the channel Params.
8484
SubAlloc struct {
85-
ID map[wallet.BackendID]ID
85+
ID ID
8686
Bals []Bal
8787
IndexMap []Index // Maps participant indices of the sub-channel to participant indices of the parent channel.
8888
}
@@ -552,7 +552,7 @@ func (b Balances) Sum() []Bal {
552552
}
553553

554554
// NewSubAlloc creates a new sub-allocation.
555-
func NewSubAlloc(id map[wallet.BackendID]ID, bals []Bal, indexMap []Index) *SubAlloc {
555+
func NewSubAlloc(id ID, bals []Bal, indexMap []Index) *SubAlloc {
556556
if indexMap == nil {
557557
indexMap = []Index{}
558558
}
@@ -561,9 +561,9 @@ func NewSubAlloc(id map[wallet.BackendID]ID, bals []Bal, indexMap []Index) *SubA
561561

562562
// SubAlloc tries to return the sub-allocation for the given subchannel.
563563
// The second return value indicates success.
564-
func (a Allocation) SubAlloc(subchannel map[wallet.BackendID]ID) (subAlloc SubAlloc, ok bool) {
564+
func (a Allocation) SubAlloc(subchannel ID) (subAlloc SubAlloc, ok bool) {
565565
for _, subAlloc = range a.Locked {
566-
if EqualIDs(subAlloc.ID, subchannel) {
566+
if subAlloc.ID == subchannel {
567567
ok = true
568568
return
569569
}
@@ -667,7 +667,7 @@ func (s SubAlloc) Encode(w io.Writer) error {
667667
err, "invalid sub-allocations cannot be encoded, got %v", s)
668668
}
669669
// encode ID and dimension
670-
if err := perunio.Encode(w, IDMap(s.ID), Index(len(s.Bals))); err != nil {
670+
if err := perunio.Encode(w, s.ID, Index(len(s.Bals))); err != nil {
671671
return errors.WithMessagef(
672672
err, "encoding sub-allocation ID or dimension, id %v", s.ID)
673673
}
@@ -696,7 +696,7 @@ func (s SubAlloc) Encode(w io.Writer) error {
696696
func (s *SubAlloc) Decode(r io.Reader) error {
697697
var numAssets Index
698698
// decode ID and dimension
699-
if err := perunio.Decode(r, (*IDMap)(&s.ID), &numAssets); err != nil {
699+
if err := perunio.Decode(r, &s.ID, &numAssets); err != nil {
700700
return errors.WithMessage(err, "decoding sub-allocation ID or dimension")
701701
}
702702
if numAssets > MaxNumAssets {
@@ -731,7 +731,7 @@ func (s *SubAlloc) Equal(t *SubAlloc) error {
731731
if s == t {
732732
return nil
733733
}
734-
if !EqualIDs(s.ID, t.ID) {
734+
if s.ID != t.ID {
735735
return errors.New("different ID")
736736
}
737737
if !s.BalancesEqual(t.Bals) {

channel/allocation_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -291,12 +291,12 @@ func TestAllocationValidLimits(t *testing.T) {
291291

292292
for i := range allocation.Locked {
293293
allocation.Locked[i] = *channel.NewSubAlloc(
294-
map[wallet.BackendID]channel.ID{channel.TestBackendID: {byte(i), byte(i >> 8), byte(i >> 16), byte(i >> 24)}},
294+
channel.ID{byte(i), byte(i >> 8), byte(i >> 16), byte(i >> 24)},
295295
make([]channel.Bal, x.numAssets),
296296
nil,
297297
)
298298
allocation.Locked[i] = *channel.NewSubAlloc(
299-
map[wallet.BackendID]channel.ID{channel.TestBackendID: {byte(i), byte(i >> 8), byte(i >> 16), byte(i >> 24)}},
299+
channel.ID{byte(i), byte(i >> 8), byte(i >> 16), byte(i >> 24)},
300300
make([]channel.Bal, x.numAssets),
301301
nil,
302302
)
@@ -387,7 +387,7 @@ func TestAllocation_Sum(t *testing.T) {
387387

388388
{
389389
"single asset/one participants/one locked",
390-
*test.NewRandomAllocation(rng, test.WithNumAssets(1), test.WithNumParts(1), test.WithLocked(*channel.NewSubAlloc(map[wallet.BackendID]channel.ID{}, []channel.Bal{big.NewInt(2)}, nil)), test.WithBalancesInRange(big.NewInt(1), big.NewInt(1))),
390+
*test.NewRandomAllocation(rng, test.WithNumAssets(1), test.WithNumParts(1), test.WithLocked(*channel.NewSubAlloc(channel.ID{}, []channel.Bal{big.NewInt(2)}, nil)), test.WithBalancesInRange(big.NewInt(1), big.NewInt(1))),
391391
[]channel.Bal{big.NewInt(3)},
392392
},
393393

@@ -500,7 +500,7 @@ func TestAllocation_Valid(t *testing.T) {
500500
{big.NewInt(64), big.NewInt(128)},
501501
},
502502
Locked: []channel.SubAlloc{
503-
*channel.NewSubAlloc(map[wallet.BackendID]channel.ID{channel.TestBackendID: channel.Zero}, []channel.Bal{big.NewInt(4)}, nil),
503+
*channel.NewSubAlloc(channel.Zero, []channel.Bal{big.NewInt(4)}, nil),
504504
},
505505
},
506506
false,
@@ -516,7 +516,7 @@ func TestAllocation_Valid(t *testing.T) {
516516
{big.NewInt(64), big.NewInt(128)},
517517
},
518518
Locked: []channel.SubAlloc{
519-
*channel.NewSubAlloc(map[wallet.BackendID]channel.ID{channel.TestBackendID: channel.Zero}, []channel.Bal{big.NewInt(-1)}, nil),
519+
*channel.NewSubAlloc(channel.Zero, []channel.Bal{big.NewInt(-1)}, nil),
520520
},
521521
},
522522
false,
@@ -544,7 +544,7 @@ func TestAllocation_Valid(t *testing.T) {
544544
{big.NewInt(2), big.NewInt(16)},
545545
},
546546
Locked: []channel.SubAlloc{
547-
*channel.NewSubAlloc(map[wallet.BackendID]channel.ID{channel.TestBackendID: channel.Zero}, []channel.Bal{big.NewInt(4), big.NewInt(-1)}, nil),
547+
*channel.NewSubAlloc(channel.Zero, []channel.Bal{big.NewInt(4), big.NewInt(-1)}, nil),
548548
},
549549
},
550550
false,
@@ -564,9 +564,9 @@ func TestAllocation_Valid(t *testing.T) {
564564
// suballocation serialization.
565565
func TestSuballocSerialization(t *testing.T) {
566566
ss := []perunio.Serializer{
567-
channel.NewSubAlloc(map[wallet.BackendID]channel.ID{channel.TestBackendID: {2}}, []channel.Bal{}, nil),
568-
channel.NewSubAlloc(map[wallet.BackendID]channel.ID{channel.TestBackendID: {3}}, []channel.Bal{big.NewInt(0)}, nil),
569-
channel.NewSubAlloc(map[wallet.BackendID]channel.ID{channel.TestBackendID: {4}}, []channel.Bal{big.NewInt(5), big.NewInt(1 << 62)}, nil),
567+
channel.NewSubAlloc(channel.ID{2}, []channel.Bal{}, nil),
568+
channel.NewSubAlloc(channel.ID{3}, []channel.Bal{big.NewInt(0)}, nil),
569+
channel.NewSubAlloc(channel.ID{4}, []channel.Bal{big.NewInt(5), big.NewInt(1 << 62)}, nil),
570570
}
571571

572572
peruniotest.GenericSerializerTest(t, ss...)

channel/backend.go

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,21 @@ func SetBackend(b Backend, id int) {
6464
}
6565

6666
// CalcID calculates the CalcID.
67-
func CalcID(p *Params) (map[wallet.BackendID]ID, error) {
68-
id := make(map[wallet.BackendID]ID)
69-
var err error
70-
for i := range p.Parts[0] {
71-
id[i], err = backend[i].CalcID(p)
72-
if err != nil {
73-
return nil, err
67+
func CalcID(p *Params) (ID, error) {
68+
var lastErr error
69+
for _, b := range backend {
70+
id, err := b.CalcID(p)
71+
if err == nil {
72+
return id, nil
7473
}
74+
lastErr = err
7575
}
76-
return id, nil
76+
77+
if lastErr != nil {
78+
return ID{}, lastErr
79+
}
80+
81+
return ID{}, errors.New("no valid ID found")
7782
}
7883

7984
// Sign creates a signature from the account a on state s.

channel/errors.go

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,24 @@ package channel
1717
import (
1818
"fmt"
1919

20-
"perun.network/go-perun/wallet"
21-
2220
"github.com/pkg/errors"
2321
)
2422

2523
type (
2624
// StateTransitionError happens in case of an invalid channel state transition.
2725
StateTransitionError struct {
28-
ID map[wallet.BackendID]ID
26+
ID ID
2927
}
3028

3129
// ActionError happens if an invalid action is applied to a channel state.
3230
ActionError struct {
33-
ID map[wallet.BackendID]ID
31+
ID ID
3432
}
3533

3634
// PhaseTransitionError happens in case of an invalid channel machine phase
3735
// transition.
3836
PhaseTransitionError struct {
39-
ID map[wallet.BackendID]ID
37+
ID ID
4038
current Phase
4139
PhaseTransition
4240
}
@@ -58,20 +56,20 @@ func (e *PhaseTransitionError) Error() string {
5856
}
5957

6058
// NewStateTransitionError creates a new StateTransitionError.
61-
func NewStateTransitionError(id map[wallet.BackendID]ID, msg string) error {
59+
func NewStateTransitionError(id ID, msg string) error {
6260
return errors.Wrap(&StateTransitionError{
6361
ID: id,
6462
}, msg)
6563
}
6664

6765
// NewActionError creates a new ActionError.
68-
func NewActionError(id map[wallet.BackendID]ID, msg string) error {
66+
func NewActionError(id ID, msg string) error {
6967
return errors.Wrap(&ActionError{
7068
ID: id,
7169
}, msg)
7270
}
7371

74-
func newPhaseTransitionError(id map[wallet.BackendID]ID, current Phase, expected PhaseTransition, msg string) error {
72+
func newPhaseTransitionError(id ID, current Phase, expected PhaseTransition, msg string) error {
7573
return errors.Wrap(&PhaseTransitionError{
7674
ID: id,
7775
current: current,
@@ -80,7 +78,7 @@ func newPhaseTransitionError(id map[wallet.BackendID]ID, current Phase, expected
8078
}
8179

8280
func newPhaseTransitionErrorf(
83-
id map[wallet.BackendID]ID,
81+
id ID,
8482
current Phase,
8583
expected PhaseTransition,
8684
format string,

channel/errors_internal_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,19 @@ import (
1818
"errors"
1919
"testing"
2020

21-
"perun.network/go-perun/wallet"
22-
2321
"github.com/stretchr/testify/assert"
2422
)
2523

2624
func TestTransitionErrors(t *testing.T) {
2725
assert.False(t, IsStateTransitionError(errors.New("No StateTransitionError")))
28-
assert.True(t, IsStateTransitionError(NewStateTransitionError(map[wallet.BackendID]ID{TestBackendID: Zero}, "A StateTransitionError")))
26+
assert.True(t, IsStateTransitionError(NewStateTransitionError(Zero, "A StateTransitionError")))
2927

3028
assert.False(t, IsActionError(errors.New("No ActionError")))
31-
assert.True(t, IsActionError(NewActionError(map[wallet.BackendID]ID{TestBackendID: Zero}, "An ActionError")))
29+
assert.True(t, IsActionError(NewActionError(Zero, "An ActionError")))
3230

3331
assert.False(t, IsPhaseTransitionError(errors.New("No PhaseTransitionError")))
3432
assert.True(t, IsPhaseTransitionError(newPhaseTransitionError(
35-
map[wallet.BackendID]ID{TestBackendID: Zero}, InitActing, PhaseTransition{InitActing, InitActing}, "A PhaseTransitionError")))
33+
Zero, InitActing, PhaseTransition{InitActing, InitActing}, "A PhaseTransitionError")))
3634
assert.True(t, IsPhaseTransitionError(newPhaseTransitionErrorf(
37-
map[wallet.BackendID]ID{TestBackendID: Zero}, InitActing, PhaseTransition{InitActing, InitActing}, "A %s", "PhaseTransitionError")))
35+
Zero, InitActing, PhaseTransition{InitActing, InitActing}, "A %s", "PhaseTransitionError")))
3836
}

channel/machine.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ type (
5555
// needed for persistence. The ID, Idx and Params only need to be persisted
5656
// once per channel as they stay constant during a channel's lifetime.
5757
Source interface {
58-
ID() map[wallet.BackendID]ID // ID is the channel ID of this source. It is the same as Params().ID().
59-
Idx() Index // Idx is the own index in the channel.
60-
Params() *Params // Params are the channel parameters.
61-
StagingTX() Transaction // StagingTX is the staged transaction (State+incomplete list of sigs).
62-
CurrentTX() Transaction // CurrentTX is the current transaction (State+complete list of sigs).
63-
Phase() Phase // Phase is the phase in which the channel is currently in.
58+
ID() ID // ID is the channel ID of this source. It is the same as Params().ID().
59+
Idx() Index // Idx is the own index in the channel.
60+
Params() *Params // Params are the channel parameters.
61+
StagingTX() Transaction // StagingTX is the staged transaction (State+incomplete list of sigs).
62+
CurrentTX() Transaction // CurrentTX is the current transaction (State+complete list of sigs).
63+
Phase() Phase // Phase is the phase in which the channel is currently in.
6464
}
6565
)
6666

@@ -169,7 +169,7 @@ func restoreMachine(acc map[wallet.BackendID]wallet.Account, source Source) (*ma
169169
}
170170

171171
// ID returns the channel id.
172-
func (m *machine) ID() map[wallet.BackendID]ID {
172+
func (m *machine) ID() ID {
173173
return m.params.ID()
174174
}
175175

@@ -488,7 +488,7 @@ func (m *machine) expect(tr PhaseTransition) error {
488488
// A StateMachine will additionally check the validity of the app-specific
489489
// transition whereas an ActionMachine checks each Action as being valid.
490490
func (m *machine) ValidTransition(to *State) error {
491-
if !EqualIDs(to.ID, m.params.id) {
491+
if to.ID != m.params.id {
492492
return errors.New("new state's ID doesn't match")
493493
}
494494

channel/mock_app.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ import (
1818
"encoding/binary"
1919
"fmt"
2020

21-
"perun.network/go-perun/wallet"
22-
2321
"github.com/pkg/errors"
2422
)
2523

@@ -170,9 +168,9 @@ func (a MockApp) execMockOp(op *MockOp) error {
170168
case OpErr:
171169
return errors.New("MockOp: runtime error")
172170
case OpTransitionErr:
173-
return NewStateTransitionError(map[wallet.BackendID]ID{}, "MockOp: state transition error")
171+
return NewStateTransitionError(ID{}, "MockOp: state transition error")
174172
case OpActionErr:
175-
return NewActionError(map[wallet.BackendID]ID{}, "MockOp: action error")
173+
return NewActionError(ID{}, "MockOp: action error")
176174
case OpPanic:
177175
panic("MockOp: panic")
178176
case OpValid:

channel/mock_app_internal_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ package channel
1717
import (
1818
"testing"
1919

20-
"perun.network/go-perun/wallet"
21-
2220
"github.com/stretchr/testify/assert"
2321

2422
wiretest "perun.network/go-perun/wire/test"
@@ -143,5 +141,5 @@ func MockActionAppTest(t *testing.T, app MockApp) {
143141
}
144142

145143
func createState(op MockOp) *State {
146-
return &State{ID: map[wallet.BackendID]ID{}, Version: 0, Allocation: Allocation{}, Data: NewMockOp(op), IsFinal: false}
144+
return &State{ID: ID{}, Version: 0, Allocation: Allocation{}, Data: NewMockOp(op), IsFinal: false}
147145
}

channel/multi/subscription.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ import (
1818
"context"
1919

2020
"perun.network/go-perun/channel"
21-
"perun.network/go-perun/wallet"
2221
)
2322

2423
// Subscribe creates a new multi-ledger AdjudicatorSubscription.
25-
func (a *Adjudicator) Subscribe(ctx context.Context, chID map[wallet.BackendID]channel.ID) (channel.AdjudicatorSubscription, error) {
24+
func (a *Adjudicator) Subscribe(ctx context.Context, chID channel.ID) (channel.AdjudicatorSubscription, error) {
2625
asub := &AdjudicatorSubscription{
2726
events: make(chan channel.AdjudicatorEvent),
2827
errors: make(chan error),

0 commit comments

Comments
 (0)