Skip to content

Commit

Permalink
feat: update go-substrate-rpc-client/v3_to_v4
Browse files Browse the repository at this point in the history
Signed-off-by: Minh Huy Tran <[email protected]>
  • Loading branch information
NhoxxKienn committed Apr 11, 2024
1 parent 9ec28fc commit 029d963
Show file tree
Hide file tree
Showing 29 changed files with 113 additions and 494 deletions.
2 changes: 1 addition & 1 deletion channel/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package channel
import (
"math/big"

"github.com/centrifuge/go-substrate-rpc-client/v3/types"
"github.com/centrifuge/go-substrate-rpc-client/v4/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/pkg/errors"
pchannel "perun.network/go-perun/channel"
Expand Down
7 changes: 4 additions & 3 deletions channel/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import (
"math/big"
"time"

"github.com/centrifuge/go-substrate-rpc-client/v3/types"
"github.com/centrifuge/go-substrate-rpc-client/v4/types"
"github.com/centrifuge/go-substrate-rpc-client/v4/types/codec"
"github.com/perun-network/perun-polkadot-backend/pkg/substrate"
"github.com/pkg/errors"
pchannel "perun.network/go-perun/channel"
Expand All @@ -28,12 +29,12 @@ import (

// ScaleEncode encodes any struct according to the SCALE codec.
func ScaleEncode(obj interface{}) ([]byte, error) {
return types.EncodeToBytes(obj)
return codec.Encode(obj)
}

// ScaleDecode decodes any struct according to the SCALE codec.
func ScaleDecode(obj interface{}, data []byte) error {
return types.DecodeFromBytes(data, obj)
return codec.Decode(data, obj)
}

// MakeBalance creates a new Balance.
Expand Down
2 changes: 1 addition & 1 deletion channel/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package channel

import (
"github.com/centrifuge/go-substrate-rpc-client/v3/types"
"github.com/centrifuge/go-substrate-rpc-client/v4/types"
)

type (
Expand Down
2 changes: 1 addition & 1 deletion channel/pallet/adjudicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package pallet
import (
"context"

"github.com/centrifuge/go-substrate-rpc-client/v3/types"
"github.com/centrifuge/go-substrate-rpc-client/v4/types"
"github.com/pkg/errors"
pchannel "perun.network/go-perun/channel"
"perun.network/go-perun/log"
Expand Down
2 changes: 1 addition & 1 deletion channel/pallet/adjudicator_sub.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"fmt"
"time"

"github.com/centrifuge/go-substrate-rpc-client/v3/types"
"github.com/centrifuge/go-substrate-rpc-client/v4/types"
"github.com/perun-network/perun-polkadot-backend/channel"
pkg_sr25519 "github.com/perun-network/perun-polkadot-backend/pkg/sr25519"
"github.com/perun-network/perun-polkadot-backend/pkg/substrate"
Expand Down
2 changes: 1 addition & 1 deletion channel/pallet/event_sub.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package pallet

import (
"github.com/centrifuge/go-substrate-rpc-client/v3/types"
"github.com/centrifuge/go-substrate-rpc-client/v4/types"
"perun.network/go-perun/log"
pkgsync "polycry.pt/poly-go/sync"

Expand Down
2 changes: 1 addition & 1 deletion channel/pallet/funder.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"context"
"time"

"github.com/centrifuge/go-substrate-rpc-client/v3/types"
"github.com/centrifuge/go-substrate-rpc-client/v4/types"
"github.com/perun-network/perun-polkadot-backend/channel"
pchannel "perun.network/go-perun/channel"
"perun.network/go-perun/log"
Expand Down
2 changes: 1 addition & 1 deletion channel/pallet/pallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package pallet
import (
"errors"

"github.com/centrifuge/go-substrate-rpc-client/v3/types"
"github.com/centrifuge/go-substrate-rpc-client/v4/types"
pchannel "perun.network/go-perun/channel"
"perun.network/go-perun/log"
pwallet "perun.network/go-perun/wallet"
Expand Down
2 changes: 1 addition & 1 deletion channel/pallet/test/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"math/big"
"testing"

"github.com/centrifuge/go-substrate-rpc-client/v3/types"
"github.com/centrifuge/go-substrate-rpc-client/v4/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand Down
2 changes: 1 addition & 1 deletion client/dispute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"math/big"
"testing"

"github.com/centrifuge/go-substrate-rpc-client/v3/types"
"github.com/centrifuge/go-substrate-rpc-client/v4/types"
pclient "perun.network/go-perun/client"
clienttest "perun.network/go-perun/client/test"
"perun.network/go-perun/wire"
Expand Down
2 changes: 1 addition & 1 deletion client/happy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"perun.network/go-perun/wire"
pkgtest "polycry.pt/poly-go/test"

"github.com/centrifuge/go-substrate-rpc-client/v3/types"
"github.com/centrifuge/go-substrate-rpc-client/v4/types"
"github.com/perun-network/perun-polkadot-backend/channel"
"github.com/perun-network/perun-polkadot-backend/channel/pallet/test"
"github.com/perun-network/perun-polkadot-backend/wallet"
Expand Down
33 changes: 19 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,37 +1,42 @@
module github.com/perun-network/perun-polkadot-backend

go 1.17
go 1.21

toolchain go1.21.4

require (
github.com/ChainSafe/go-schnorrkel v0.0.0-20210318173838-ccb5cd955283
github.com/centrifuge/go-substrate-rpc-client/v3 v3.0.2
github.com/ethereum/go-ethereum v1.10.12
github.com/ChainSafe/go-schnorrkel v1.1.0
github.com/centrifuge/go-substrate-rpc-client/v4 v4.2.1
github.com/ethereum/go-ethereum v1.10.20
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.8.1
github.com/stretchr/testify v1.7.0
github.com/stretchr/testify v1.7.2
github.com/vedhavyas/go-subkey v1.0.2
perun.network/go-perun v0.10.6
polycry.pt/poly-go v0.0.0-20220301085937-fb9d71b45a37
)

require (
github.com/btcsuite/btcd v0.21.0-beta // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set v1.7.1 // indirect
github.com/decred/base58 v1.0.3 // indirect
github.com/deckarep/golang-set v1.8.0 // indirect
github.com/decred/base58 v1.0.4 // indirect
github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect
github.com/go-stack/stack v1.8.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/gtank/merlin v0.1.1 // indirect
github.com/gtank/ristretto255 v0.1.2 // indirect
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
github.com/mimoo/StrobeGo v0.0.0-20220103164710-9a04d6ca976b // indirect
github.com/pierrec/xxHash v0.1.5 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rs/cors v1.8.0 // indirect
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 // indirect
github.com/rs/cors v1.8.2 // indirect
github.com/vedhavyas/go-subkey/v2 v2.0.0 // indirect
golang.org/x/crypto v0.7.0 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912 // indirect
golang.org/x/sys v0.6.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 029d963

Please sign in to comment.