Clean up package names

This commit is contained in:
Ethan Frey
2017-02-22 17:51:18 +01:00
parent 70f19e809b
commit 26f4b5c98e
8 changed files with 16 additions and 16 deletions

View File

@ -1,4 +1,4 @@
package httpclient_test package http_test
import ( import (
"math/rand" "math/rand"

View File

@ -1,5 +1,5 @@
/* /*
package httpclient returns a Client implementation that communicates package http returns a Client implementation that communicates
with a tendermint node over json rpc and websockets. with a tendermint node over json rpc and websockets.
This is the main implementation you probably want to use in This is the main implementation you probably want to use in
@ -7,7 +7,7 @@ production code. There are other implementations when calling
the tendermint node in-process (local), or when you want to mock the tendermint node in-process (local), or when you want to mock
out the server for test code (mock). out the server for test code (mock).
*/ */
package httpclient package http
import ( import (
"encoding/json" "encoding/json"

View File

@ -1,4 +1,4 @@
package httpclient_test package http_test
import ( import (
"os" "os"

View File

@ -1,4 +1,4 @@
package httpclient_test package http_test
import ( import (
"strings" "strings"
@ -8,15 +8,15 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
merkle "github.com/tendermint/go-merkle" merkle "github.com/tendermint/go-merkle"
httpclient "github.com/tendermint/tendermint/rpc/client/http" "github.com/tendermint/tendermint/rpc/client/http"
rpctest "github.com/tendermint/tendermint/rpc/test" rpctest "github.com/tendermint/tendermint/rpc/test"
"github.com/tendermint/tendermint/types" "github.com/tendermint/tendermint/types"
) )
// GetClient gets a rpc client pointing to the test tendermint rpc // GetClient gets a rpc client pointing to the test tendermint rpc
func GetClient() *httpclient.Client { func GetClient() *http.Client {
rpcAddr := rpctest.GetConfig().GetString("rpc_laddr") rpcAddr := rpctest.GetConfig().GetString("rpc_laddr")
return httpclient.New(rpcAddr, "/websocket") return http.New(rpcAddr, "/websocket")
} }
// Make sure status is correct (we connect properly) // Make sure status is correct (we connect properly)

View File

@ -1,4 +1,4 @@
package localclient_test package local_test
import ( import (
"math/rand" "math/rand"

View File

@ -1,5 +1,5 @@
/* /*
package localclient returns a Client implementation that package local returns a Client implementation that
directly executes the rpc functions on a given node. directly executes the rpc functions on a given node.
This implementation is useful for: This implementation is useful for:
@ -12,7 +12,7 @@ are compiled in process.
For real clients, you probably want the "http" package. For more For real clients, you probably want the "http" package. For more
powerful control during testing, you probably want the "mock" package. powerful control during testing, you probably want the "mock" package.
*/ */
package localclient package local
import ( import (
nm "github.com/tendermint/tendermint/node" nm "github.com/tendermint/tendermint/node"

View File

@ -1,4 +1,4 @@
package localclient_test package local_test
import ( import (
"os" "os"

View File

@ -1,4 +1,4 @@
package localclient_test package local_test
import ( import (
"strings" "strings"
@ -8,14 +8,14 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
merkle "github.com/tendermint/go-merkle" merkle "github.com/tendermint/go-merkle"
localclient "github.com/tendermint/tendermint/rpc/client/local" "github.com/tendermint/tendermint/rpc/client/local"
rpctest "github.com/tendermint/tendermint/rpc/test" rpctest "github.com/tendermint/tendermint/rpc/test"
) )
// GetClient gets a rpc client pointing to the test tendermint rpc // GetClient gets a rpc client pointing to the test tendermint rpc
func GetClient() localclient.Client { func GetClient() local.Client {
node := rpctest.GetNode() node := rpctest.GetNode()
return localclient.New(node) return local.New(node)
} }
// Make sure status is correct (we connect properly) // Make sure status is correct (we connect properly)