New lint version upgrade (#4056)

* New lint version upgrade

- linter was upgraded

Signed-off-by: Marko Baricevic <marbar3778@yahoo.com>

* enable-a;; is deprecated

* minor change

* another try

* some more changes

* some more changes

* reenable prealloc

* add version till bot is fixed
This commit is contained in:
Marko
2019-10-14 17:40:15 +02:00
committed by GitHub
parent aaa060fda4
commit 7edc0601d5
17 changed files with 84 additions and 56 deletions

View File

@@ -639,7 +639,7 @@ func capture() {
// Ensure basic validation of structs is functioning
func TestNewRoundStepMessageValidateBasic(t *testing.T) {
testCases := []struct {
testCases := []struct { // nolint: maligned
expectErr bool
messageRound int
messageLastCommitRound int
@@ -769,7 +769,7 @@ func TestHasVoteMessageValidateBasic(t *testing.T) {
invalidSignedMsgType types.SignedMsgType = 0x03
)
testCases := []struct {
testCases := []struct { // nolint: maligned
expectErr bool
messageRound int
messageIndex int
@@ -814,7 +814,7 @@ func TestVoteSetMaj23MessageValidateBasic(t *testing.T) {
},
}
testCases := []struct {
testCases := []struct { // nolint: maligned
expectErr bool
messageRound int
messageHeight int64
@@ -860,7 +860,7 @@ func TestVoteSetBitsMessageValidateBasic(t *testing.T) {
}
testBitArray := cmn.NewBitArray(1)
testCases := []struct {
testCases := []struct { // nolint: maligned
expectErr bool
messageRound int
messageHeight int64

View File

@@ -13,12 +13,10 @@ import (
// PeerRoundState contains the known state of a peer.
// NOTE: Read-only when returned by PeerState.GetRoundState().
type PeerRoundState struct {
ProposalBlockPartsHeader types.PartSetHeader `json:"proposal_block_parts_header"` //
StartTime time.Time `json:"start_time"` // Estimated start of round 0 at this height
Height int64 `json:"height"` // Height peer is at
Round int `json:"round"` // Round peer is at, -1 if unknown.
Step RoundStepType `json:"step"` // Step peer is at
StartTime time.Time `json:"start_time"` // Estimated start of round 0 at this height
Proposal bool `json:"proposal"` // True if peer has proposal for this round
ProposalBlockPartsHeader types.PartSetHeader `json:"proposal_block_parts_header"` //
ProposalBlockParts *cmn.BitArray `json:"proposal_block_parts"` //
ProposalPOLRound int `json:"proposal_pol_round"` // Proposal's POL round. -1 if none.
ProposalPOL *cmn.BitArray `json:"proposal_pol"` // nil until ProposalPOLMessage received.
@@ -28,6 +26,8 @@ type PeerRoundState struct {
LastCommit *cmn.BitArray `json:"last_commit"` // All commit precommits of commit for last height.
CatchupCommitRound int `json:"catchup_commit_round"` // Round that we have commit for. Not necessarily unique. -1 if none.
CatchupCommit *cmn.BitArray `json:"catchup_commit"` // All commit precommits peer has for this height & CatchupCommitRound
Step RoundStepType `json:"step"` // Step peer is at
Proposal bool `json:"proposal"` // True if peer has proposal for this round
}
// String returns a string representation of the PeerRoundState

View File

@@ -65,11 +65,10 @@ func (rs RoundStepType) String() string {
// NOTE: Not thread safe. Should only be manipulated by functions downstream
// of the cs.receiveRoutine
type RoundState struct {
Height int64 `json:"height"` // Height we are working on
Round int `json:"round"`
Step RoundStepType `json:"step"`
StartTime time.Time `json:"start_time"`
CommitTime time.Time `json:"commit_time"` // Subjective time when +2/3 precommits for Block at Round were found
Height int64 `json:"height"` // Height we are working on
Round int `json:"round"`
Validators *types.ValidatorSet `json:"validators"`
Proposal *types.Proposal `json:"proposal"`
ProposalBlock *types.Block `json:"proposal_block"`
@@ -84,6 +83,7 @@ type RoundState struct {
CommitRound int `json:"commit_round"` //
LastCommit *types.VoteSet `json:"last_commit"` // Last precommits at Height-1
LastValidators *types.ValidatorSet `json:"last_validators"`
Step RoundStepType `json:"step"`
TriggeredTimeoutPrecommit bool `json:"triggered_timeout_precommit"`
}