mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-22 17:31:34 +00:00
Merge pull request #741 from tendermint/client-compile-time-assertions
rpc/client: use compile time assertions instead of methods
This commit is contained in:
@ -39,17 +39,12 @@ func NewHTTP(remote, wsEndpoint string) *HTTP {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *HTTP) _assertIsClient() Client {
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *HTTP) _assertIsNetworkClient() NetworkClient {
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *HTTP) _assertIsEventSwitch() types.EventSwitch {
|
||||
return c
|
||||
}
|
||||
var (
|
||||
_ Client = (*HTTP)(nil)
|
||||
_ NetworkClient = (*HTTP)(nil)
|
||||
_ types.EventSwitch = (*HTTP)(nil)
|
||||
_ types.EventSwitch = (*WSEvents)(nil)
|
||||
)
|
||||
|
||||
func (c *HTTP) Status() (*ctypes.ResultStatus, error) {
|
||||
result := new(ctypes.ResultStatus)
|
||||
@ -220,10 +215,6 @@ func newWSEvents(remote, endpoint string) *WSEvents {
|
||||
}
|
||||
}
|
||||
|
||||
func (w *WSEvents) _assertIsEventSwitch() types.EventSwitch {
|
||||
return w
|
||||
}
|
||||
|
||||
// Start is the only way I could think the extend OnStart from
|
||||
// events.eventSwitch. If only it wasn't private...
|
||||
// BaseService.Start -> eventSwitch.OnStart -> WSEvents.Start
|
||||
|
Reference in New Issue
Block a user