From f6a79dd7c50c49a3e9ae39bde76af6d1ae773985 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 21 Nov 2017 17:50:06 -0600 Subject: [PATCH] add interface assertions for all clients --- client/grpc_client.go | 2 ++ client/local_client.go | 2 ++ client/socket_client.go | 2 ++ 3 files changed, 6 insertions(+) diff --git a/client/grpc_client.go b/client/grpc_client.go index 524f1f7f..c7a4c2ae 100644 --- a/client/grpc_client.go +++ b/client/grpc_client.go @@ -13,6 +13,8 @@ import ( cmn "github.com/tendermint/tmlibs/common" ) +var _ Client = (*grpcClient)(nil) + // A stripped copy of the remoteClient that makes // synchronous calls using grpc type grpcClient struct { diff --git a/client/local_client.go b/client/local_client.go index 9081406a..2a294f48 100644 --- a/client/local_client.go +++ b/client/local_client.go @@ -7,6 +7,8 @@ import ( cmn "github.com/tendermint/tmlibs/common" ) +var _ Client = (*localClient)(nil) + type localClient struct { cmn.BaseService mtx *sync.Mutex diff --git a/client/socket_client.go b/client/socket_client.go index ef0a6ece..64211979 100644 --- a/client/socket_client.go +++ b/client/socket_client.go @@ -23,6 +23,8 @@ const reqQueueSize = 256 // TODO make configurable // const maxResponseSize = 1048576 // 1MB TODO make configurable const flushThrottleMS = 20 // Don't wait longer than... +var _ Client = (*socketClient)(nil) + // This is goroutine-safe, but users should beware that // the application in general is not meant to be interfaced // with concurrent callers.