Make client.Context implement gRPC ClientConn (#6342)

* Add QueryConn to client.Context

* Add integration test

* imports

* spelling

* Make client.Context implement grpc ClientConn

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
Aaron Craelius
2020-06-08 13:41:30 +00:00
committed by GitHub
co-authored by Alexander Bezobchuk Federico Kunze
parent c44813bcdf
commit 4e0a475751
6 changed files with 87 additions and 18 deletions
+28
View File
@@ -0,0 +1,28 @@
// +build cli_test
package cli
import (
"context"
"testing"
"github.com/stretchr/testify/require"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec/testdata"
)
func TestCliQueryConn(t *testing.T) {
t.Parallel()
f := NewFixtures(t)
// start simd server
proc := f.SDStart()
t.Cleanup(func() { proc.Stop(false) })
ctx := client.NewContext()
testClient := testdata.NewTestServiceClient(ctx)
res, err := testClient.Echo(context.Background(), &testdata.EchoRequest{Message: "hello"})
require.NoError(t, err)
require.Equal(t, "hello", res.Message)
}