Merge pull request #757 from tendermint/756-specification-validators

correct an error in validator's specification [ci skip] (Refs #756)
This commit is contained in:
Zach 2017-10-18 13:02:13 -04:00 committed by GitHub
commit a2dc53d43d
6 changed files with 21 additions and 44 deletions

View File

@ -4,7 +4,7 @@ Validators
Validators are responsible for committing new blocks in the blockchain.
These validators participate in the consensus protocol by broadcasting
*votes* which contain cryptographic signatures signed by each
validator's public key.
validator's private key.
Some Proof-of-Stake consensus algorithms aim to create a "completely"
decentralized system where all stakeholders (even those who are not

View File

@ -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

View File

@ -41,13 +41,10 @@ func NewLocal(node *nm.Node) Local {
}
}
func (c Local) _assertIsClient() Client {
return c
}
func (c Local) _assertIsNetworkClient() NetworkClient {
return c
}
var (
_ Client = Local{}
_ NetworkClient = Local{}
)
func (c Local) Status() (*ctypes.ResultStatus, error) {
return core.Status()

View File

@ -16,9 +16,11 @@ type ABCIApp struct {
App abci.Application
}
func (a ABCIApp) _assertABCIClient() client.ABCIClient {
return a
}
var (
_ client.ABCIClient = ABCIApp{}
_ client.ABCIClient = ABCIMock{}
_ client.ABCIClient = (*ABCIRecorder)(nil)
)
func (a ABCIApp) ABCIInfo() (*ctypes.ResultABCIInfo, error) {
return &ctypes.ResultABCIInfo{a.App.Info(abci.RequestInfo{version.Version})}, nil
@ -71,10 +73,6 @@ type ABCIMock struct {
Broadcast Call
}
func (m ABCIMock) _assertABCIClient() client.ABCIClient {
return m
}
func (m ABCIMock) ABCIInfo() (*ctypes.ResultABCIInfo, error) {
res, err := m.Info.GetResponse(nil)
if err != nil {
@ -134,10 +132,6 @@ func NewABCIRecorder(client client.ABCIClient) *ABCIRecorder {
}
}
func (r *ABCIRecorder) _assertABCIClient() client.ABCIClient {
return r
}
type QueryArgs struct {
Path string
Data data.Bytes

View File

@ -37,9 +37,7 @@ type Client struct {
types.EventSwitch
}
func (c Client) _assertIsClient() client.Client {
return c
}
var _ client.Client = Client{}
// Call is used by recorders to save a call and response.
// It can also be used to configure mock responses.

View File

@ -10,9 +10,10 @@ type StatusMock struct {
Call
}
func (m *StatusMock) _assertStatusClient() client.StatusClient {
return m
}
var (
_ client.StatusClient = (*StatusMock)(nil)
_ client.StatusClient = (*StatusRecorder)(nil)
)
func (m *StatusMock) Status() (*ctypes.ResultStatus, error) {
res, err := m.GetResponse(nil)
@ -36,10 +37,6 @@ func NewStatusRecorder(client client.StatusClient) *StatusRecorder {
}
}
func (r *StatusRecorder) _assertStatusClient() client.StatusClient {
return r
}
func (r *StatusRecorder) addCall(call Call) {
r.Calls = append(r.Calls, call)
}