From 3663baedd3c270f529b5559c49b89a18cf5504df Mon Sep 17 00:00:00 2001 From: Ilja von Hoessle Date: Tue, 20 Aug 2024 17:04:55 +0200 Subject: [PATCH 1/2] * chore(go.mod, go.sum): Adapt to go-perun v0.11.0 * chore(*/client.go): Set new argument gasLimit for transactions * chore(app-channel/app/app.go): Adapt TicTacToeApp to AppID interface from go-perun --- app-channel/app/app.go | 60 ++++++++++++++++++++++++---- app-channel/client/client.go | 5 ++- app-channel/go.mod | 6 +-- app-channel/go.sum | 12 +++--- multiledger-channel/client/client.go | 5 ++- multiledger-channel/go.mod | 4 +- multiledger-channel/go.sum | 8 ++-- payment-channel-dot/go.mod | 2 +- payment-channel-dot/go.sum | 8 ++-- payment-channel/client/client.go | 6 ++- payment-channel/go.mod | 6 +-- payment-channel/go.sum | 11 ++--- 12 files changed, 91 insertions(+), 42 deletions(-) diff --git a/app-channel/app/app.go b/app-channel/app/app.go index 67aa45c..d75ad9b 100644 --- a/app-channel/app/app.go +++ b/app-channel/app/app.go @@ -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. @@ -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 := ðwallet.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 { diff --git a/app-channel/client/client.go b/app-channel/client/client.go index ae45562..b529f1c 100644 --- a/app-channel/client/client.go +++ b/app-channel/client/client.go @@ -38,6 +38,7 @@ import ( const ( txFinalityDepth = 1 // Number of blocks required to confirm a transaction. + gasLimit = 500000 ) // AppClient is an app channel client. @@ -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) diff --git a/app-channel/go.mod b/app-channel/go.mod index 075b148..840ad59 100644 --- a/app-channel/go.mod +++ b/app-channel/go.mod @@ -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 ( @@ -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 diff --git a/app-channel/go.sum b/app-channel/go.sum index 29ff5ac..5fdaa4d 100644 --- a/app-channel/go.sum +++ b/app-channel/go.sum @@ -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= @@ -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= @@ -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= diff --git a/multiledger-channel/client/client.go b/multiledger-channel/client/client.go index 62256df..5be3d2e 100644 --- a/multiledger-channel/client/client.go +++ b/multiledger-channel/client/client.go @@ -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. @@ -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 @@ -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) } diff --git a/multiledger-channel/go.mod b/multiledger-channel/go.mod index 94ae9d3..08b877f 100644 --- a/multiledger-channel/go.mod +++ b/multiledger-channel/go.mod @@ -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 ( diff --git a/multiledger-channel/go.sum b/multiledger-channel/go.sum index 3f9b0bb..eefa09d 100644 --- a/multiledger-channel/go.sum +++ b/multiledger-channel/go.sum @@ -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= @@ -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= diff --git a/payment-channel-dot/go.mod b/payment-channel-dot/go.mod index 65d6b0e..bd23542 100644 --- a/payment-channel-dot/go.mod +++ b/payment-channel-dot/go.mod @@ -6,7 +6,7 @@ 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/pkg/errors v0.9.1 - perun.network/go-perun v0.10.6 + perun.network/go-perun v0.11.0 ) require ( diff --git a/payment-channel-dot/go.sum b/payment-channel-dot/go.sum index 8d23c7c..162182d 100644 --- a/payment-channel-dot/go.sum +++ b/payment-channel-dot/go.sum @@ -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= @@ -166,8 +168,6 @@ 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/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= @@ -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= diff --git a/payment-channel/client/client.go b/payment-channel/client/client.go index 6aa696c..7d2f9b6 100644 --- a/payment-channel/client/client.go +++ b/payment-channel/client/client.go @@ -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. @@ -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) diff --git a/payment-channel/go.mod b/payment-channel/go.mod index 7b17703..402f0a5 100644 --- a/payment-channel/go.mod +++ b/payment-channel/go.mod @@ -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 ( @@ -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 diff --git a/payment-channel/go.sum b/payment-channel/go.sum index b4ed635..eefa09d 100644 --- a/payment-channel/go.sum +++ b/payment-channel/go.sum @@ -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= @@ -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= @@ -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= From 1a711904e208e83aba5e8ed62995c609b7348830 Mon Sep 17 00:00:00 2001 From: Ilja von Hoessle Date: Thu, 22 Aug 2024 09:39:23 +0200 Subject: [PATCH 2/2] chore(payment-channel-dot/go.mod, go.sum): Update to v0.11.0 compatible Polkadot Backend --- payment-channel-dot/go.mod | 2 +- payment-channel-dot/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/payment-channel-dot/go.mod b/payment-channel-dot/go.mod index bd23542..64f2d22 100644 --- a/payment-channel-dot/go.mod +++ b/payment-channel-dot/go.mod @@ -4,7 +4,7 @@ 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.11.0 ) diff --git a/payment-channel-dot/go.sum b/payment-channel-dot/go.sum index 162182d..eab613c 100644 --- a/payment-channel-dot/go.sum +++ b/payment-channel-dot/go.sum @@ -168,8 +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.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=