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

feat: update substrate client rpc to v4 #10

Merged
merged 1 commit into from
Aug 15, 2024
Merged
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
8 changes: 4 additions & 4 deletions chains/substrate/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"github.com/ChainSafe/log15"
utils "github.com/crustio/ChainBridge/shared/substrate"
"github.com/crustio/chainbridge-utils/msg"
gsrpc "github.com/crustio/go-substrate-rpc-client/v3"
"github.com/crustio/go-substrate-rpc-client/v3/rpc/author"
"github.com/crustio/go-substrate-rpc-client/v3/signature"
"github.com/crustio/go-substrate-rpc-client/v3/types"
gsrpc "github.com/crustio/go-substrate-rpc-client/v4"
"github.com/crustio/go-substrate-rpc-client/v4/rpc/author"
"github.com/crustio/go-substrate-rpc-client/v4/signature"
"github.com/crustio/go-substrate-rpc-client/v4/types"
)

type Connection struct {
Expand Down
2 changes: 1 addition & 1 deletion chains/substrate/connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package substrate
import (
"testing"

"github.com/crustio/go-substrate-rpc-client/v3/types"
"github.com/crustio/go-substrate-rpc-client/v4/types"
)

func TestConnect_QueryStorage(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion chains/substrate/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/crustio/chainbridge-utils/blockstore"
metrics "github.com/crustio/chainbridge-utils/metrics/types"
"github.com/crustio/chainbridge-utils/msg"
"github.com/crustio/go-substrate-rpc-client/v3/types"
"github.com/crustio/go-substrate-rpc-client/v4/types"
)

type listener struct {
Expand Down
2 changes: 1 addition & 1 deletion chains/substrate/listener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
subtest "github.com/crustio/ChainBridge/shared/substrate/testing"
"github.com/crustio/chainbridge-utils/blockstore"
"github.com/crustio/chainbridge-utils/msg"
"github.com/crustio/go-substrate-rpc-client/v3/types"
"github.com/crustio/go-substrate-rpc-client/v4/types"
)

const ListenerTimeout = time.Second * 30
Expand Down
2 changes: 1 addition & 1 deletion chains/substrate/test_helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
utils "github.com/crustio/ChainBridge/shared/substrate"
"github.com/crustio/chainbridge-utils/keystore"
"github.com/crustio/chainbridge-utils/msg"
"github.com/crustio/go-substrate-rpc-client/v3/types"
"github.com/crustio/go-substrate-rpc-client/v4/types"
"github.com/ethereum/go-ethereum/common/hexutil"
)

Expand Down
4 changes: 2 additions & 2 deletions chains/substrate/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"math/big"

"github.com/crustio/chainbridge-utils/msg"
"github.com/crustio/go-substrate-rpc-client/v3/scale"
"github.com/crustio/go-substrate-rpc-client/v3/types"
"github.com/crustio/go-substrate-rpc-client/v4/scale"
"github.com/crustio/go-substrate-rpc-client/v4/types"
)

type voteState struct {
Expand Down
4 changes: 2 additions & 2 deletions chains/substrate/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (

"github.com/crustio/chainbridge-utils/core"

"github.com/ChainSafe/log15"
utils "github.com/crustio/ChainBridge/shared/substrate"
metrics "github.com/crustio/chainbridge-utils/metrics/types"
"github.com/crustio/chainbridge-utils/msg"
"github.com/ChainSafe/log15"
"github.com/crustio/go-substrate-rpc-client/v3/types"
"github.com/crustio/go-substrate-rpc-client/v4/types"
)

var _ core.Writer = &writer{}
Expand Down
2 changes: 1 addition & 1 deletion chains/substrate/writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"reflect"
"testing"

"github.com/crustio/go-substrate-rpc-client/v3/types"
"github.com/crustio/go-substrate-rpc-client/v4/types"

utils "github.com/crustio/ChainBridge/shared/substrate"
subtest "github.com/crustio/ChainBridge/shared/substrate/testing"
Expand Down
4 changes: 2 additions & 2 deletions e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"strings"
"testing"

log "github.com/ChainSafe/log15"
ethChain "github.com/crustio/ChainBridge/chains/ethereum"
subChain "github.com/crustio/ChainBridge/chains/substrate"
eth "github.com/crustio/ChainBridge/e2e/ethereum"
Expand All @@ -22,8 +23,7 @@ import (
subtest "github.com/crustio/ChainBridge/shared/substrate/testing"
"github.com/crustio/chainbridge-utils/core"
"github.com/crustio/chainbridge-utils/msg"
log "github.com/ChainSafe/log15"
"github.com/crustio/go-substrate-rpc-client/v3/types"
"github.com/crustio/go-substrate-rpc-client/v4/types"
"github.com/ethereum/go-ethereum/common"
)

Expand Down
4 changes: 2 additions & 2 deletions e2e/fungible_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import (
"math/big"
"testing"

log "github.com/ChainSafe/log15"
eth "github.com/crustio/ChainBridge/e2e/ethereum"
sub "github.com/crustio/ChainBridge/e2e/substrate"
utils "github.com/crustio/ChainBridge/shared/ethereum"
ethtest "github.com/crustio/ChainBridge/shared/ethereum/testing"
subtest "github.com/crustio/ChainBridge/shared/substrate/testing"
log "github.com/ChainSafe/log15"
"github.com/crustio/go-substrate-rpc-client/v3/types"
"github.com/crustio/go-substrate-rpc-client/v4/types"
)

func testErc20ToSubstrate(t *testing.T, ctx *testContext) {
Expand Down
4 changes: 2 additions & 2 deletions e2e/nonfungible_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import (
"fmt"
"testing"

log "github.com/ChainSafe/log15"
eth "github.com/crustio/ChainBridge/e2e/ethereum"
sub "github.com/crustio/ChainBridge/e2e/substrate"
ethtest "github.com/crustio/ChainBridge/shared/ethereum/testing"
subtest "github.com/crustio/ChainBridge/shared/substrate/testing"
log "github.com/ChainSafe/log15"
"github.com/crustio/go-substrate-rpc-client/v3/types"
"github.com/crustio/go-substrate-rpc-client/v4/types"
)

func testErc721ToSubstrateRoundTrip(t *testing.T, ctx *testContext) {
Expand Down
6 changes: 3 additions & 3 deletions e2e/parallel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import (
"testing"
"time"

log "github.com/ChainSafe/log15"
eth "github.com/crustio/ChainBridge/e2e/ethereum"
ethutils "github.com/crustio/ChainBridge/shared/ethereum"
ethtest "github.com/crustio/ChainBridge/shared/ethereum/testing"
subutils "github.com/crustio/ChainBridge/shared/substrate"
subtest "github.com/crustio/ChainBridge/shared/substrate/testing"
"github.com/crustio/chainbridge-utils/msg"
log "github.com/ChainSafe/log15"
"github.com/crustio/go-substrate-rpc-client/v3/signature"
"github.com/crustio/go-substrate-rpc-client/v3/types"
"github.com/crustio/go-substrate-rpc-client/v4/signature"
"github.com/crustio/go-substrate-rpc-client/v4/types"
"github.com/ethereum/go-ethereum/common"
)

Expand Down
4 changes: 2 additions & 2 deletions e2e/substrate/substrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (
"testing"
"time"

"github.com/ChainSafe/log15"
utils "github.com/crustio/ChainBridge/shared/substrate"
"github.com/crustio/chainbridge-utils/core"
"github.com/crustio/chainbridge-utils/keystore"
"github.com/crustio/chainbridge-utils/msg"
"github.com/ChainSafe/log15"
"github.com/crustio/go-substrate-rpc-client/v3/types"
"github.com/crustio/go-substrate-rpc-client/v4/types"
)

const TestSubEndpoint = "ws://localhost:9944"
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ go 1.15
require (
github.com/ChainSafe/log15 v1.0.0
github.com/crustio/chainbridge-substrate-events v1.8.3
github.com/crustio/chainbridge-utils v1.1.0
github.com/crustio/go-substrate-rpc-client/v3 v3.1.0
github.com/ethereum/go-ethereum v1.10.6
github.com/crustio/chainbridge-utils v1.2.6
github.com/crustio/go-substrate-rpc-client/v4 v4.0.3
github.com/ethereum/go-ethereum v1.10.15
github.com/prometheus/client_golang v1.4.1
github.com/stretchr/testify v1.7.0
github.com/urfave/cli/v2 v2.3.0
Expand Down
Loading
Loading