mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-21 14:46:15 +00:00
Fix linter errors thrown by lll (#3970)
* Fix long line errors in abci, crypto, and libs packages * Fix long lines in p2p and rpc packages * Fix long lines in abci, state, and tools packages * Fix long lines in behaviour and blockchain packages * Fix long lines in cmd and config packages * Begin fixing long lines in consensus package * Finish fixing long lines in consensus package * Add lll exclusion for lines containing URLs * Fix long lines in crypto package * Fix long lines in evidence package * Fix long lines in mempool and node packages * Fix long lines in libs package * Fix long lines in lite package * Fix new long line in node package * Fix long lines in p2p package * Ignore gocritic warning * Fix long lines in privval package * Fix long lines in rpc package * Fix long lines in scripts package * Fix long lines in state package * Fix long lines in tools package * Fix long lines in types package * Enable lll linter
This commit is contained in:
+4
-2
@@ -4,11 +4,13 @@ Package privval provides different implementations of the types.PrivValidator.
|
||||
|
||||
FilePV
|
||||
|
||||
FilePV is the simplest implementation and developer default. It uses one file for the private key and another to store state.
|
||||
FilePV is the simplest implementation and developer default.
|
||||
It uses one file for the private key and another to store state.
|
||||
|
||||
SignerListenerEndpoint
|
||||
|
||||
SignerListenerEndpoint establishes a connection to an external process, like a Key Management Server (KMS), using a socket.
|
||||
SignerListenerEndpoint establishes a connection to an external process,
|
||||
like a Key Management Server (KMS), using a socket.
|
||||
SignerListenerEndpoint listens for the external KMS process to dial in.
|
||||
SignerListenerEndpoint takes a listener, which determines the type of connection
|
||||
(ie. encrypted over tcp, or unencrypted over unix).
|
||||
|
||||
+14
-2
@@ -96,7 +96,13 @@ func (lss *FilePVLastSignState) CheckHRS(height int64, round int, step int8) (bo
|
||||
|
||||
if lss.Round == round {
|
||||
if lss.Step > step {
|
||||
return false, fmt.Errorf("step regression at height %v round %v. Got %v, last step %v", height, round, step, lss.Step)
|
||||
return false, fmt.Errorf(
|
||||
"step regression at height %v round %v. Got %v, last step %v",
|
||||
height,
|
||||
round,
|
||||
step,
|
||||
lss.Step,
|
||||
)
|
||||
} else if lss.Step == step {
|
||||
if lss.SignBytes != nil {
|
||||
if lss.Signature == nil {
|
||||
@@ -271,7 +277,13 @@ func (pv *FilePV) Reset() {
|
||||
|
||||
// String returns a string representation of the FilePV.
|
||||
func (pv *FilePV) String() string {
|
||||
return fmt.Sprintf("PrivValidator{%v LH:%v, LR:%v, LS:%v}", pv.GetAddress(), pv.LastSignState.Height, pv.LastSignState.Round, pv.LastSignState.Step)
|
||||
return fmt.Sprintf(
|
||||
"PrivValidator{%v LH:%v, LR:%v, LS:%v}",
|
||||
pv.GetAddress(),
|
||||
pv.LastSignState.Height,
|
||||
pv.LastSignState.Round,
|
||||
pv.LastSignState.Step,
|
||||
)
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
|
||||
@@ -11,6 +11,11 @@ import (
|
||||
"github.com/tendermint/tendermint/privval"
|
||||
)
|
||||
|
||||
const lastSignBytes = "750802110500000000000000220B08B398F3E00510F48DA6402A480A20F" +
|
||||
"C258973076512999C3E6839A22E9FBDB1B77CF993E8A9955412A41A59D4" +
|
||||
"CAD312240A20C971B286ACB8AAA6FCA0365EB0A660B189EDC08B46B5AF2" +
|
||||
"995DEFA51A28D215B10013211746573742D636861696E2D533245415533"
|
||||
|
||||
const oldPrivvalContent = `{
|
||||
"address": "1D8089FAFDFAE4A637F3D616E17B92905FA2D91D",
|
||||
"pub_key": {
|
||||
@@ -21,7 +26,7 @@ const oldPrivvalContent = `{
|
||||
"last_round": "0",
|
||||
"last_step": 3,
|
||||
"last_signature": "CTr7b9ZQlrJJf+12rPl5t/YSCUc/KqV7jQogCfFJA24e7hof69X6OMT7eFLVQHyodPjD/QTA298XHV5ejxInDQ==",
|
||||
"last_signbytes": "750802110500000000000000220B08B398F3E00510F48DA6402A480A20FC258973076512999C3E6839A22E9FBDB1B77CF993E8A9955412A41A59D4CAD312240A20C971B286ACB8AAA6FCA0365EB0A660B189EDC08B46B5AF2995DEFA51A28D215B10013211746573742D636861696E2D533245415533",
|
||||
"last_signbytes": "` + lastSignBytes + `",
|
||||
"priv_key": {
|
||||
"type": "tendermint/PrivKeyEd25519",
|
||||
"value": "7MwvTGEWWjsYwjn2IpRb+GYsWi9nnFsw8jPLLY1UtP6vdiDYCENnvjkI1Olq+wZT6ZFnxalFeqgm7KqM3yYmrQ=="
|
||||
|
||||
@@ -7,7 +7,11 @@ import (
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
||||
func DefaultValidationRequestHandler(privVal types.PrivValidator, req SignerMessage, chainID string) (SignerMessage, error) {
|
||||
func DefaultValidationRequestHandler(
|
||||
privVal types.PrivValidator,
|
||||
req SignerMessage,
|
||||
chainID string,
|
||||
) (SignerMessage, error) {
|
||||
var res SignerMessage
|
||||
var err error
|
||||
|
||||
|
||||
Reference in New Issue
Block a user