types: migrate params to protobuf (#4962)

This commit is contained in:
Marko
2020-06-05 15:29:53 +02:00
committed by GitHub
parent d4f1876d12
commit 9ef266b88f
28 changed files with 494 additions and 867 deletions

View File

@@ -163,7 +163,7 @@ func (c *Client) ConsensusParams(height *int64) (*ctypes.ResultConsensusParams,
}
// Validate res.
if err := res.ConsensusParams.Validate(); err != nil {
if err := types.ValidateConsensusParams(res.ConsensusParams); err != nil {
return nil, err
}
if res.BlockHeight <= 0 {
@@ -177,7 +177,7 @@ func (c *Client) ConsensusParams(height *int64) (*ctypes.ResultConsensusParams,
}
// Verify hash.
if cH, tH := res.ConsensusParams.Hash(), h.ConsensusHash; !bytes.Equal(cH, tH) {
if cH, tH := types.HashConsensusParams(res.ConsensusParams), h.ConsensusHash; !bytes.Equal(cH, tH) {
return nil, fmt.Errorf("params hash %X does not match trusted hash %X",
cH, tH)
}