Skip to content

Commit

Permalink
update imports to v2 (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
vedhavyas authored Jan 4, 2021
1 parent f42aa12 commit 3b7101e
Show file tree
Hide file tree
Showing 165 changed files with 236 additions and 238 deletions.
6 changes: 3 additions & 3 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"context"
"log"

"github.com/centrifuge/go-substrate-rpc-client/config"
gethrpc "github.com/centrifuge/go-substrate-rpc-client/gethrpc"
"github.com/centrifuge/go-substrate-rpc-client/types"
"github.com/centrifuge/go-substrate-rpc-client/v2/config"
gethrpc "github.com/centrifuge/go-substrate-rpc-client/v2/gethrpc"
"github.com/centrifuge/go-substrate-rpc-client/v2/types"
)

type Client interface {
Expand Down
8 changes: 4 additions & 4 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ In order to sign extrinsics, you need to have [subkey](https://github.com/parity
Types
The package [types](https://godoc.org/github.com/centrifuge/go-substrate-rpc-client/types/) exports a number
The package [types](https://godoc.org/github.com/centrifuge/go-substrate-rpc-client/v2/types/) exports a number
of useful basic types including functions for encoding and decoding them.
To use your own custom types, you can simply create structs and arrays composing those basic types. Here are some
examples using composition of a mix of these basic and builtin Go types:
1. Vectors, lists, series, sets, arrays, slices: https://godoc.org/github.com/centrifuge/go-substrate-rpc-client/types/#example_Vec_simple
1. Vectors, lists, series, sets, arrays, slices: https://godoc.org/github.com/centrifuge/go-substrate-rpc-client/v2/types/#example_Vec_simple
2. Structs: https://godoc.org/github.com/centrifuge/go-substrate-rpc-client/types/#example_Struct_simple
2. Structs: https://godoc.org/github.com/centrifuge/go-substrate-rpc-client/v2/types/#example_Struct_simple
There are some caveats though that you should be aware of:
Expand All @@ -56,6 +56,6 @@ methods that implement the Encodeable/Decodeable interfaces. Examples for that a
types, you can find reference implementations of those here: types/enum_test.go , types/tuple_test.go and
types/vec_any_test.go
For more information about the types sub-package, see https://godoc.org/github.com/centrifuge/go-substrate-rpc-client/types
For more information about the types sub-package, see https://godoc.org/github.com/centrifuge/go-substrate-rpc-client/v2/types
*/
package gsrpc
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/centrifuge/go-substrate-rpc-client
module github.com/centrifuge/go-substrate-rpc-client/v2

go 1.15

Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d h1:2+ZP7EfsZV7Vvmx3TIqSlSzATMkTAKqM14YGFPoSKjI=
golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package gsrpc

import (
"github.com/centrifuge/go-substrate-rpc-client/client"
"github.com/centrifuge/go-substrate-rpc-client/rpc"
"github.com/centrifuge/go-substrate-rpc-client/v2/client"
"github.com/centrifuge/go-substrate-rpc-client/v2/rpc"
)

type SubstrateAPI struct {
Expand Down
8 changes: 4 additions & 4 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"math/big"
"time"

gsrpc "github.com/centrifuge/go-substrate-rpc-client"
"github.com/centrifuge/go-substrate-rpc-client/config"
"github.com/centrifuge/go-substrate-rpc-client/signature"
"github.com/centrifuge/go-substrate-rpc-client/types"
gsrpc "github.com/centrifuge/go-substrate-rpc-client/v2"
"github.com/centrifuge/go-substrate-rpc-client/v2/config"
"github.com/centrifuge/go-substrate-rpc-client/v2/signature"
"github.com/centrifuge/go-substrate-rpc-client/v2/types"
)

func Example_simpleConnect() {
Expand Down
2 changes: 1 addition & 1 deletion rpc/author/author.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package author

import "github.com/centrifuge/go-substrate-rpc-client/client"
import "github.com/centrifuge/go-substrate-rpc-client/v2/client"

// Author exposes methods for authoring of network items
type Author struct {
Expand Down
4 changes: 2 additions & 2 deletions rpc/author/author_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"os"
"testing"

"github.com/centrifuge/go-substrate-rpc-client/client"
"github.com/centrifuge/go-substrate-rpc-client/rpcmocksrv"
"github.com/centrifuge/go-substrate-rpc-client/v2/client"
"github.com/centrifuge/go-substrate-rpc-client/v2/rpcmocksrv"
)

var author *Author
Expand Down
2 changes: 1 addition & 1 deletion rpc/author/pending_extrinsics.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package author

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

// PendingExtrinsics returns all pending extrinsics, potentially grouped by sender
Expand Down
2 changes: 1 addition & 1 deletion rpc/author/pending_extrinsics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package author
import (
"testing"

"github.com/centrifuge/go-substrate-rpc-client/types"
"github.com/centrifuge/go-substrate-rpc-client/v2/types"
"github.com/stretchr/testify/assert"
)

Expand Down
6 changes: 3 additions & 3 deletions rpc/author/submit_and_watch_extrinsic.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"context"
"sync"

"github.com/centrifuge/go-substrate-rpc-client/config"
gethrpc "github.com/centrifuge/go-substrate-rpc-client/gethrpc"
"github.com/centrifuge/go-substrate-rpc-client/types"
"github.com/centrifuge/go-substrate-rpc-client/v2/config"
gethrpc "github.com/centrifuge/go-substrate-rpc-client/v2/gethrpc"
"github.com/centrifuge/go-substrate-rpc-client/v2/types"
)

// ExtrinsicStatusSubscription is a subscription established through one of the Client's subscribe methods.
Expand Down
2 changes: 1 addition & 1 deletion rpc/author/submit_extrinsic.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package author

import "github.com/centrifuge/go-substrate-rpc-client/types"
import "github.com/centrifuge/go-substrate-rpc-client/v2/types"

// SubmitExtrinsic will submit a fully formatted extrinsic for block inclusion
func (a *Author) SubmitExtrinsic(xt types.Extrinsic) (types.Hash, error) {
Expand Down
2 changes: 1 addition & 1 deletion rpc/author/submit_extrinsic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package author
import (
"testing"

"github.com/centrifuge/go-substrate-rpc-client/types"
"github.com/centrifuge/go-substrate-rpc-client/v2/types"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion rpc/chain/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package chain

import (
"github.com/centrifuge/go-substrate-rpc-client/client"
"github.com/centrifuge/go-substrate-rpc-client/v2/client"
)

// Chain exposes methods for retrieval of chain data
Expand Down
6 changes: 3 additions & 3 deletions rpc/chain/chain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"os"
"testing"

"github.com/centrifuge/go-substrate-rpc-client/client"
"github.com/centrifuge/go-substrate-rpc-client/rpcmocksrv"
"github.com/centrifuge/go-substrate-rpc-client/types"
"github.com/centrifuge/go-substrate-rpc-client/v2/client"
"github.com/centrifuge/go-substrate-rpc-client/v2/rpcmocksrv"
"github.com/centrifuge/go-substrate-rpc-client/v2/types"
)

var chain *Chain
Expand Down
4 changes: 2 additions & 2 deletions rpc/chain/get_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package chain

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

// GetBlock returns the header and body of the relay chain block with the given hash
Expand Down
2 changes: 1 addition & 1 deletion rpc/chain/get_block_hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package chain

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

// GetBlockHash returns the block hash for a specific block height
Expand Down
2 changes: 1 addition & 1 deletion rpc/chain/get_block_hash_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package chain
import (
"testing"

"github.com/centrifuge/go-substrate-rpc-client/types"
"github.com/centrifuge/go-substrate-rpc-client/v2/types"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion rpc/chain/get_finalized_head.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package chain

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

// GetFinalizedHead returns the hash of the last finalized block in the canon chain
Expand Down
2 changes: 1 addition & 1 deletion rpc/chain/get_finalized_head_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package chain
import (
"testing"

"github.com/centrifuge/go-substrate-rpc-client/types"
"github.com/centrifuge/go-substrate-rpc-client/v2/types"
"github.com/stretchr/testify/assert"
)

Expand Down
4 changes: 2 additions & 2 deletions rpc/chain/get_header.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package chain

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

// GetHeader retrieves the header for the specific block
Expand Down
6 changes: 3 additions & 3 deletions rpc/chain/subscribe_finalized_heads.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"context"
"sync"

"github.com/centrifuge/go-substrate-rpc-client/config"
gethrpc "github.com/centrifuge/go-substrate-rpc-client/gethrpc"
"github.com/centrifuge/go-substrate-rpc-client/types"
"github.com/centrifuge/go-substrate-rpc-client/v2/config"
gethrpc "github.com/centrifuge/go-substrate-rpc-client/v2/gethrpc"
"github.com/centrifuge/go-substrate-rpc-client/v2/types"
)

// FinalizedHeadsSubscription is a subscription established through one of the Client's subscribe methods.
Expand Down
6 changes: 3 additions & 3 deletions rpc/chain/subscribe_new_heads.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"context"
"sync"

"github.com/centrifuge/go-substrate-rpc-client/config"
gethrpc "github.com/centrifuge/go-substrate-rpc-client/gethrpc"
"github.com/centrifuge/go-substrate-rpc-client/types"
"github.com/centrifuge/go-substrate-rpc-client/v2/config"
gethrpc "github.com/centrifuge/go-substrate-rpc-client/v2/gethrpc"
"github.com/centrifuge/go-substrate-rpc-client/v2/types"
)

// NewHeadsSubscription is a subscription established through one of the Client's subscribe methods.
Expand Down
12 changes: 6 additions & 6 deletions rpc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
package rpc

import (
"github.com/centrifuge/go-substrate-rpc-client/client"
"github.com/centrifuge/go-substrate-rpc-client/rpc/author"
"github.com/centrifuge/go-substrate-rpc-client/rpc/chain"
"github.com/centrifuge/go-substrate-rpc-client/rpc/state"
"github.com/centrifuge/go-substrate-rpc-client/rpc/system"
"github.com/centrifuge/go-substrate-rpc-client/types"
"github.com/centrifuge/go-substrate-rpc-client/v2/client"
"github.com/centrifuge/go-substrate-rpc-client/v2/rpc/author"
"github.com/centrifuge/go-substrate-rpc-client/v2/rpc/chain"
"github.com/centrifuge/go-substrate-rpc-client/v2/rpc/state"
"github.com/centrifuge/go-substrate-rpc-client/v2/rpc/system"
"github.com/centrifuge/go-substrate-rpc-client/v2/types"
)

type RPC struct {
Expand Down
4 changes: 2 additions & 2 deletions rpc/state/get_child_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package state

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

// GetChildKeys retreives the keys with the given prefix of a specific child storage
Expand Down
2 changes: 1 addition & 1 deletion rpc/state/get_child_keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package state
import (
"testing"

"github.com/centrifuge/go-substrate-rpc-client/types"
"github.com/centrifuge/go-substrate-rpc-client/v2/types"
"github.com/stretchr/testify/assert"
)

Expand Down
4 changes: 2 additions & 2 deletions rpc/state/get_child_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package state

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

// GetChildStorage retreives the child storage for a key and decodes them into the provided interface. Ok is true if the
Expand Down
4 changes: 2 additions & 2 deletions rpc/state/get_child_storage_hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package state

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

// GetChildStorageHash retreives the child storage hash for the given key
Expand Down
2 changes: 1 addition & 1 deletion rpc/state/get_child_storage_hash_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package state
import (
"testing"

"github.com/centrifuge/go-substrate-rpc-client/types"
"github.com/centrifuge/go-substrate-rpc-client/v2/types"
"github.com/stretchr/testify/assert"
)

Expand Down
4 changes: 2 additions & 2 deletions rpc/state/get_child_storage_size.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package state

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

// GetChildStorageSize retreives the child storage size for the given key
Expand Down
2 changes: 1 addition & 1 deletion rpc/state/get_child_storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package state
import (
"testing"

"github.com/centrifuge/go-substrate-rpc-client/types"
"github.com/centrifuge/go-substrate-rpc-client/v2/types"
"github.com/stretchr/testify/assert"
)

Expand Down
4 changes: 2 additions & 2 deletions rpc/state/get_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package state

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

// GetKeys retreives the keys with the given prefix
Expand Down
2 changes: 1 addition & 1 deletion rpc/state/get_keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package state
import (
"testing"

"github.com/centrifuge/go-substrate-rpc-client/types"
"github.com/centrifuge/go-substrate-rpc-client/v2/types"
"github.com/stretchr/testify/assert"
)

Expand Down
4 changes: 2 additions & 2 deletions rpc/state/get_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package state

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

// GetMetadata returns the metadata at the given block
Expand Down
4 changes: 2 additions & 2 deletions rpc/state/get_runtime_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package state

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

// GetRuntimeVersion returns the runtime version at the given block
Expand Down
4 changes: 2 additions & 2 deletions rpc/state/get_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package state

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

// GetStorage retreives the stored data and decodes them into the provided interface. Ok is true if the value is not
Expand Down
Loading

0 comments on commit 3b7101e

Please sign in to comment.