Skip to content

Commit

Permalink
feat: update polkadot node container version
Browse files Browse the repository at this point in the history
Signed-off-by: Minh Huy Tran <huy@perun.network>
  • Loading branch information
NhoxxKienn committed Apr 23, 2024
1 parent 0141940 commit 9d37df1
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.21
- name: Checkout
uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.45
version: v1.56.2

test:
name: Test
Expand All @@ -25,7 +25,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.21

- name: Checkout
uses: actions/checkout@v2
Expand All @@ -40,7 +40,7 @@ jobs:
${{ runner.os }}-go-
- name: Start Substrate node
run: docker run --rm -d --name substrate -p 9944:9944 ghcr.io/perun-network/polkadot-test-node:0.2.0
run: docker run --rm -d --name substrate -p 9944:9944 ghcr.io/perun-network/polkadot-test-node:0.4.0

- name: Wait for Substrate node
# Wait for port 9944 to listen.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ cd perun-polkadot-backend
2. Start a local Substrate node with the Perun Pallet installed. See the [polkadot node] repository for more details.

```sh
docker run --rm -p 9944:9944 ghcr.io/perun-network/polkadot-test-node
docker run --rm -p 9944:9944 ghcr.io/perun-network/polkadot-test-node:0.4.0
```

3. Run the tests. This step needs a working [Go distribution](https://golang.org), see [go.mod](go.mod) for the required version.
Expand Down
2 changes: 1 addition & 1 deletion channel/pallet/adjudicator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions channel/pallet/event_sub.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
Expand Down
16 changes: 14 additions & 2 deletions client/appchannel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)

Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module github.com/perun-network/perun-polkadot-backend

go 1.21

toolchain go1.21.4

require (
github.com/ChainSafe/go-schnorrkel v1.1.0
github.com/centrifuge/go-substrate-rpc-client/v4 v4.2.1
Expand Down

0 comments on commit 9d37df1

Please sign in to comment.