mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-08 14:21:14 +00:00
proto: deduplicate consensus params (#9287)
This commit is contained in:
@@ -233,7 +233,7 @@ func (c *Client) ConsensusParams(ctx context.Context, height *int64) (*ctypes.Re
|
||||
}
|
||||
|
||||
// Validate res.
|
||||
if err := types.ValidateConsensusParams(res.ConsensusParams); err != nil {
|
||||
if err := res.ConsensusParams.ValidateBasic(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if res.BlockHeight <= 0 {
|
||||
@@ -247,7 +247,7 @@ func (c *Client) ConsensusParams(ctx context.Context, height *int64) (*ctypes.Re
|
||||
}
|
||||
|
||||
// Verify hash.
|
||||
if cH, tH := types.HashConsensusParams(res.ConsensusParams), l.ConsensusHash; !bytes.Equal(cH, tH) {
|
||||
if cH, tH := res.ConsensusParams.Hash(), l.ConsensusHash; !bytes.Equal(cH, tH) {
|
||||
return nil, fmt.Errorf("params hash %X does not match trusted hash %X",
|
||||
cH, tH)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user