diff --git a/channel/pallet/adjudicator_test.go b/channel/pallet/adjudicator_test.go index 4568f05..815907f 100644 --- a/channel/pallet/adjudicator_test.go +++ b/channel/pallet/adjudicator_test.go @@ -80,7 +80,7 @@ func TestAdjudicator_Walkthrough(t *testing.T) { dSetup := chtest.NewDepositSetup(params, state) adjAlice := pallet.NewAdjudicator(s.Alice.Acc, s.Pallet, s.API, test.PastBlocks) adjBob := pallet.NewAdjudicator(s.Bob.Acc, s.Pallet, s.API, test.PastBlocks) - ctx, cancel := context.WithTimeout(context.Background(), 100*s.BlockTime) + ctx, cancel := context.WithTimeout(context.Background(), 1000*s.BlockTime) defer cancel() // Fund diff --git a/channel/pallet/event_sub.go b/channel/pallet/event_sub.go index be41a4f..aa5b3f7 100644 --- a/channel/pallet/event_sub.go +++ b/channel/pallet/event_sub.go @@ -15,6 +15,8 @@ package pallet import ( + "io" + "github.com/centrifuge/go-substrate-rpc-client/v4/types" "perun.network/go-perun/log" pkgsync "polycry.pt/poly-go/sync" @@ -60,6 +62,9 @@ func NewEventSub(source *substrate.EventSource, meta *types.Metadata, p EventPre select { case set := <-source.Events(): if err = sub.decodeEventRecords(set, meta); err != nil { + if err == io.EOF { + continue + } sub.Log().Errorf("decoding event records: %v", err) break loop } diff --git a/client/appchannel_test.go b/client/appchannel_test.go index 4f85969..90b2dde 100644 --- a/client/appchannel_test.go +++ b/client/appchannel_test.go @@ -23,12 +23,14 @@ import ( "perun.network/go-perun/channel" "perun.network/go-perun/client" clienttest "perun.network/go-perun/client/test" - test "perun.network/go-perun/wallet/test" "perun.network/go-perun/wire" pkgtest "polycry.pt/poly-go/test" + "github.com/ChainSafe/go-schnorrkel" pchannel "github.com/perun-network/perun-polkadot-backend/channel" ptest "github.com/perun-network/perun-polkadot-backend/channel/pallet/test" + dotwallet "github.com/perun-network/perun-polkadot-backend/wallet/sr25519" + "github.com/stretchr/testify/require" ) func TestAppChannel(t *testing.T) { @@ -42,7 +44,17 @@ func TestAppChannel(t *testing.T) { clienttest.NewPaula(t, setups[B]), } - appAddress := test.NewRandomAddress(rng) + byteArray := [32]byte{ + 176, 115, 108, 113, 171, 155, 245, 248, + 27, 234, 80, 36, 30, 145, 56, 217, + 213, 25, 176, 99, 145, 198, 217, 248, + 220, 159, 39, 241, 120, 209, 175, 8, + } + pk, err := schnorrkel.NewPublicKey(byteArray) + require.NoError(t, err) + + appAddress := dotwallet.NewAddressFromPK(pk) + require.NoError(t, err) app := channel.NewMockApp(appAddress) channel.RegisterApp(app)