Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt examples to go-perun v0.11.0 #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 52 additions & 8 deletions app-channel/app/app.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 PolyCrypt GmbH, Germany
// Copyright 2024 PolyCrypt GmbH, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -19,26 +19,70 @@ import (
"io"
"log"

ethwallet "github.com/perun-network/perun-eth-backend/wallet"
"github.com/pkg/errors"

"perun.network/go-perun/channel"
"perun.network/go-perun/wallet"
)

// TicTacToeApp is a channel app.
type TicTacToeApp struct {
// var _ channel.AppID = new(TicTacToeAppID)
var _ channel.AppID = (*TicTacToeAppID)(nil)

type TicTacToeAppID struct {
Addr wallet.Address
}

type AppIDKey string

// MarshalBinary marshals the contents of AppID into a byte string.
func (a TicTacToeAppID) MarshalBinary() ([]byte, error) {
data, err := a.Addr.MarshalBinary()
if err != nil {
return nil, err
}
return data, nil
}

// UnmarshalBinary converts a bytestring, representing AppID into the AppID struct.
func (a *TicTacToeAppID) UnmarshalBinary(data []byte) error {
addr := &ethwallet.Address{}
err := addr.UnmarshalBinary(data)
if err != nil {
return err
}
appaddr := &TicTacToeAppID{addr}
*a = *appaddr
return nil
}

func (a TicTacToeAppID) Key() channel.AppIDKey {
b, err := a.MarshalBinary()
if err != nil {
panic(err)
}
return channel.AppIDKey(b)
}
func (a TicTacToeAppID) Equal(b channel.AppID) bool {
// Type assert b to TicTacToeAppID
bTyped, ok := b.(*TicTacToeAppID)
if !ok {
return false
}
return a.Addr.Equal(bTyped.Addr)
}

type TicTacToeApp struct {
AppID TicTacToeAppID //wallet.Address
}

func NewTicTacToeApp(addr wallet.Address) *TicTacToeApp {
return &TicTacToeApp{
Addr: addr,
AppID: TicTacToeAppID{Addr: addr},
}
}

// Def returns the app address.
func (a *TicTacToeApp) Def() wallet.Address {
return a.Addr
func (a *TicTacToeApp) Def() channel.AppID {
return &a.AppID
}

func (a *TicTacToeApp) NewData() channel.Data {
Expand Down
5 changes: 3 additions & 2 deletions app-channel/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (

const (
txFinalityDepth = 1 // Number of blocks required to confirm a transaction.
gasLimit = 500000
)

// AppClient is an app channel client.
Expand Down Expand Up @@ -82,13 +83,13 @@ func SetupAppClient(

// Setup funder.
funder := ethchannel.NewFunder(cb)
dep := ethchannel.NewETHDepositor()
dep := ethchannel.NewETHDepositor(gasLimit)
ethAcc := accounts.Account{Address: acc}
asset := ethchannel.NewAsset(big.NewInt(int64(chainID)), common.Address(assetaddr))
funder.RegisterAsset(*asset, dep, ethAcc)

// Setup adjudicator.
adj := ethchannel.NewAdjudicator(cb, adjudicator, acc, ethAcc)
adj := ethchannel.NewAdjudicator(cb, adjudicator, acc, ethAcc, gasLimit)

// Setup dispute watcher.
watcher, err := local.NewWatcher(adj)
Expand Down
6 changes: 3 additions & 3 deletions app-channel/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ go 1.20

require (
github.com/ethereum/go-ethereum v1.13.5
github.com/perun-network/perun-eth-backend v0.1.0
github.com/perun-network/perun-eth-backend v0.5.0
github.com/pkg/errors v0.9.1
perun.network/go-perun v0.10.6
perun.network/go-perun v0.11.0
)

require (
Expand All @@ -25,7 +25,7 @@ require (
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-ole/go-ole v1.2.5 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/holiman/uint256 v1.2.4 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
Expand Down
12 changes: 6 additions & 6 deletions app-channel/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk=
github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE=
Expand Down Expand Up @@ -103,8 +103,8 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/perun-network/perun-eth-backend v0.1.0 h1:MySwhdtz7MbwzIeGP5tJqdb6MZRBBKugzMt6nY5YLMs=
github.com/perun-network/perun-eth-backend v0.1.0/go.mod h1:yE+WLgaHzKVBRVsmXB2a9DWj55J8RSM2ippIes7DTns=
github.com/perun-network/perun-eth-backend v0.5.0 h1:Dk92gerSN3WCtVkk0aV+h5lKfos7I1vHDMMgE1Ys8yQ=
github.com/perun-network/perun-eth-backend v0.5.0/go.mod h1:tAFsmhcA+Hu0+7tEognaasrYq2eavQAV1h0hbuVDEuQ=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down Expand Up @@ -180,8 +180,8 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
perun.network/go-perun v0.10.6 h1:uj1e33yfCSfE75DK/uwjNp+TwvGG85Qhi6HuYQ9EPrQ=
perun.network/go-perun v0.10.6/go.mod h1:BGBZC3npkX457u87pjDd0NEIXr1a4dsH4H/YpLdGGe8=
perun.network/go-perun v0.11.0 h1:25aL0MsyXQ2rHziOnMwJMe70K6NTCbopZMwX67qxt/k=
perun.network/go-perun v0.11.0/go.mod h1:pY/1pJ2OMlCQgEbnfGh9wVfRMJtqN0iAKsiJBLH0/Gc=
polycry.pt/poly-go v0.0.0-20220301085937-fb9d71b45a37 h1:iA5GzEa/hHfVlQpimEjPV09NATwHXxSjWNB0VVodtew=
polycry.pt/poly-go v0.0.0-20220301085937-fb9d71b45a37/go.mod h1:XUBrNtqgEhN3EEOP/5gh7IBd3xVHKidCjXDZfl9+kMU=
rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU=
Expand Down
5 changes: 3 additions & 2 deletions multiledger-channel/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (

const (
txFinalityDepth = 1 // Number of blocks required to confirm a transaction.
gasLimit = 500000
)

// ChainConfig is used to hold all information needed about a specific chain.
Expand Down Expand Up @@ -93,7 +94,7 @@ func SetupSwapClient(
// Setup funder.
funder := ethchannel.NewFunder(cb)
// Register the asset on the funder.
dep := ethchannel.NewERC20Depositor(chain.Token)
dep := ethchannel.NewERC20Depositor(chain.Token, gasLimit)
ethAcc := accounts.Account{Address: acc}
funder.RegisterAsset(*assets[i].(*ethchannel.Asset), dep, ethAcc)
// We have to register the asset of the other chain too, but use a
Expand All @@ -103,7 +104,7 @@ func SetupSwapClient(
multiFunder.RegisterFunder(chain.ChainID, funder)

// Setup adjudicator.
adj := ethchannel.NewAdjudicator(cb, chain.Adjudicator, acc, ethAcc)
adj := ethchannel.NewAdjudicator(cb, chain.Adjudicator, acc, ethAcc, gasLimit)
// Register the adjudicator on the multi-adjudicator.
multiAdjudicator.RegisterAdjudicator(chain.ChainID, adj)
}
Expand Down
4 changes: 2 additions & 2 deletions multiledger-channel/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ go 1.20

require (
github.com/ethereum/go-ethereum v1.10.12
github.com/perun-network/perun-eth-backend v0.1.0
github.com/perun-network/perun-eth-backend v0.5.0
github.com/pkg/errors v0.9.1
perun.network/go-perun v0.10.6
perun.network/go-perun v0.11.0
)

require (
Expand Down
8 changes: 4 additions & 4 deletions multiledger-channel/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,8 @@ github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFSt
github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE=
github.com/perun-network/perun-eth-backend v0.1.0 h1:MySwhdtz7MbwzIeGP5tJqdb6MZRBBKugzMt6nY5YLMs=
github.com/perun-network/perun-eth-backend v0.1.0/go.mod h1:yE+WLgaHzKVBRVsmXB2a9DWj55J8RSM2ippIes7DTns=
github.com/perun-network/perun-eth-backend v0.5.0 h1:Dk92gerSN3WCtVkk0aV+h5lKfos7I1vHDMMgE1Ys8yQ=
github.com/perun-network/perun-eth-backend v0.5.0/go.mod h1:tAFsmhcA+Hu0+7tEognaasrYq2eavQAV1h0hbuVDEuQ=
github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc=
github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0=
github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
Expand Down Expand Up @@ -623,8 +623,8 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las=
perun.network/go-perun v0.10.6 h1:uj1e33yfCSfE75DK/uwjNp+TwvGG85Qhi6HuYQ9EPrQ=
perun.network/go-perun v0.10.6/go.mod h1:BGBZC3npkX457u87pjDd0NEIXr1a4dsH4H/YpLdGGe8=
perun.network/go-perun v0.11.0 h1:25aL0MsyXQ2rHziOnMwJMe70K6NTCbopZMwX67qxt/k=
perun.network/go-perun v0.11.0/go.mod h1:pY/1pJ2OMlCQgEbnfGh9wVfRMJtqN0iAKsiJBLH0/Gc=
polycry.pt/poly-go v0.0.0-20220301085937-fb9d71b45a37 h1:iA5GzEa/hHfVlQpimEjPV09NATwHXxSjWNB0VVodtew=
polycry.pt/poly-go v0.0.0-20220301085937-fb9d71b45a37/go.mod h1:XUBrNtqgEhN3EEOP/5gh7IBd3xVHKidCjXDZfl9+kMU=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
Expand Down
4 changes: 2 additions & 2 deletions payment-channel-dot/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ go 1.21

require (
github.com/centrifuge/go-substrate-rpc-client/v4 v4.2.1
github.com/perun-network/perun-polkadot-backend v0.2.1-0.20240425071359-589d0ae7df6d
github.com/perun-network/perun-polkadot-backend v0.2.1-0.20240822065131-d2dc885d1131
github.com/pkg/errors v0.9.1
perun.network/go-perun v0.10.6
perun.network/go-perun v0.11.0
)

require (
Expand Down
12 changes: 6 additions & 6 deletions payment-channel-dot/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa h1:Q75Upo5UN4JbPFURXZ8nLKYUvF85dyFRop/vQ0Rv+64=
github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
Expand Down Expand Up @@ -166,10 +168,8 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34=
github.com/perun-network/perun-polkadot-backend v0.2.1-0.20240411100708-029d9632b748 h1:nKTTy/mgfMza0x/qJ3ydzyAVwJfyPs/br6OOeP4IeTw=
github.com/perun-network/perun-polkadot-backend v0.2.1-0.20240411100708-029d9632b748/go.mod h1:qBlduBvrtUUz86dcqxEzgTID7psZ000WyucSWO2M6Qk=
github.com/perun-network/perun-polkadot-backend v0.2.1-0.20240425071359-589d0ae7df6d h1:XNERW32C3qi24oSPsC7WdRc9VNqWlTQAlgDUiCagsZs=
github.com/perun-network/perun-polkadot-backend v0.2.1-0.20240425071359-589d0ae7df6d/go.mod h1:cddzrhZ0iFylrhVsGyxdiiPrXwWMLMunoa3AtWfX/Qk=
github.com/perun-network/perun-polkadot-backend v0.2.1-0.20240822065131-d2dc885d1131 h1:qR0O6AwDXX4qMYcYi4ODootYJz1H6XdpljRZ4Eh6hJo=
github.com/perun-network/perun-polkadot-backend v0.2.1-0.20240822065131-d2dc885d1131/go.mod h1:ig/+ZyCMkeAEk0iTd/S3Z7Imsm+pnwkB1h6UNULNfo4=
github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0=
github.com/pierrec/xxHash v0.1.5 h1:n/jBpwTHiER4xYvK3/CdPVnLDPchj8eTJFFLUb4QHBo=
github.com/pierrec/xxHash v0.1.5/go.mod h1:w2waW5Zoa/Wc4Yqe0wgrIYAGKqRMf7czn2HNKXmuL+I=
Expand Down Expand Up @@ -312,7 +312,7 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
perun.network/go-perun v0.10.6 h1:uj1e33yfCSfE75DK/uwjNp+TwvGG85Qhi6HuYQ9EPrQ=
perun.network/go-perun v0.10.6/go.mod h1:BGBZC3npkX457u87pjDd0NEIXr1a4dsH4H/YpLdGGe8=
perun.network/go-perun v0.11.0 h1:25aL0MsyXQ2rHziOnMwJMe70K6NTCbopZMwX67qxt/k=
perun.network/go-perun v0.11.0/go.mod h1:pY/1pJ2OMlCQgEbnfGh9wVfRMJtqN0iAKsiJBLH0/Gc=
polycry.pt/poly-go v0.0.0-20220301085937-fb9d71b45a37 h1:iA5GzEa/hHfVlQpimEjPV09NATwHXxSjWNB0VVodtew=
polycry.pt/poly-go v0.0.0-20220301085937-fb9d71b45a37/go.mod h1:XUBrNtqgEhN3EEOP/5gh7IBd3xVHKidCjXDZfl9+kMU=
6 changes: 4 additions & 2 deletions payment-channel/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import (
"github.com/pkg/errors"
)

const gasLimit = 500000

// PaymentClient is a payment channel client.
type PaymentClient struct {
perunClient *client.Client // The core Perun client.
Expand Down Expand Up @@ -73,13 +75,13 @@ func SetupPaymentClient(

// Setup funder.
funder := ethchannel.NewFunder(cb)
dep := ethchannel.NewETHDepositor()
dep := ethchannel.NewETHDepositor(gasLimit)
ethAcc := accounts.Account{Address: acc}
asset := ethchannel.NewAsset(big.NewInt(int64(chainID)), common.Address(assetaddr))
funder.RegisterAsset(*asset, dep, ethAcc)

// Setup adjudicator.
adj := ethchannel.NewAdjudicator(cb, adjudicator, acc, ethAcc)
adj := ethchannel.NewAdjudicator(cb, adjudicator, acc, ethAcc, gasLimit)

// Setup dispute watcher.
watcher, err := local.NewWatcher(adj)
Expand Down
6 changes: 3 additions & 3 deletions payment-channel/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ go 1.20

require (
github.com/ethereum/go-ethereum v1.10.12
github.com/perun-network/perun-eth-backend v0.1.0
github.com/perun-network/perun-eth-backend v0.5.0
github.com/pkg/errors v0.9.1
perun.network/go-perun v0.10.6
perun.network/go-perun v0.11.0
)

require (
Expand All @@ -16,7 +16,7 @@ require (
github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea // indirect
github.com/go-ole/go-ole v1.2.1 // indirect
github.com/go-stack/stack v1.8.0 // indirect
github.com/google/uuid v1.1.5 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rjeczalik/notify v0.9.1 // indirect
Expand Down
11 changes: 6 additions & 5 deletions payment-channel/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,9 @@ github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OI
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.1.5 h1:kxhtnfFVi+rYdOALN0B3k9UT86zVJKfBimRaciULW4I=
github.com/google/uuid v1.1.5/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
Expand Down Expand Up @@ -303,8 +304,8 @@ github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFSt
github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE=
github.com/perun-network/perun-eth-backend v0.1.0 h1:MySwhdtz7MbwzIeGP5tJqdb6MZRBBKugzMt6nY5YLMs=
github.com/perun-network/perun-eth-backend v0.1.0/go.mod h1:yE+WLgaHzKVBRVsmXB2a9DWj55J8RSM2ippIes7DTns=
github.com/perun-network/perun-eth-backend v0.5.0 h1:Dk92gerSN3WCtVkk0aV+h5lKfos7I1vHDMMgE1Ys8yQ=
github.com/perun-network/perun-eth-backend v0.5.0/go.mod h1:tAFsmhcA+Hu0+7tEognaasrYq2eavQAV1h0hbuVDEuQ=
github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc=
github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0=
github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
Expand Down Expand Up @@ -622,8 +623,8 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las=
perun.network/go-perun v0.10.6 h1:uj1e33yfCSfE75DK/uwjNp+TwvGG85Qhi6HuYQ9EPrQ=
perun.network/go-perun v0.10.6/go.mod h1:BGBZC3npkX457u87pjDd0NEIXr1a4dsH4H/YpLdGGe8=
perun.network/go-perun v0.11.0 h1:25aL0MsyXQ2rHziOnMwJMe70K6NTCbopZMwX67qxt/k=
perun.network/go-perun v0.11.0/go.mod h1:pY/1pJ2OMlCQgEbnfGh9wVfRMJtqN0iAKsiJBLH0/Gc=
polycry.pt/poly-go v0.0.0-20220301085937-fb9d71b45a37 h1:iA5GzEa/hHfVlQpimEjPV09NATwHXxSjWNB0VVodtew=
polycry.pt/poly-go v0.0.0-20220301085937-fb9d71b45a37/go.mod h1:XUBrNtqgEhN3EEOP/5gh7IBd3xVHKidCjXDZfl9+kMU=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
Expand Down
Loading