mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-05 04:55:18 +00:00
lint: cleanup pending lint errors (#7237)
This commit is contained in:
@@ -175,8 +175,8 @@ func (state *State) ToProto() (*tmstate.State, error) {
|
||||
return sm, nil
|
||||
}
|
||||
|
||||
// StateFromProto takes a state proto message & returns the local state type
|
||||
func StateFromProto(pb *tmstate.State) (*State, error) { //nolint:golint
|
||||
// FromProto takes a state proto message & returns the local state type
|
||||
func FromProto(pb *tmstate.State) (*State, error) { //nolint:golint
|
||||
if pb == nil {
|
||||
return nil, errors.New("nil State")
|
||||
}
|
||||
|
||||
@@ -1075,7 +1075,7 @@ func TestStateProto(t *testing.T) {
|
||||
assert.NoError(t, err, tt.testName)
|
||||
}
|
||||
|
||||
smt, err := sm.StateFromProto(pbs)
|
||||
smt, err := sm.FromProto(pbs)
|
||||
if tt.expPass2 {
|
||||
require.NoError(t, err, tt.testName)
|
||||
require.Equal(t, tt.state, smt, tt.testName)
|
||||
|
||||
@@ -142,7 +142,7 @@ func (store dbStore) loadState(key []byte) (state State, err error) {
|
||||
%v\n`, err))
|
||||
}
|
||||
|
||||
sm, err := StateFromProto(sp)
|
||||
sm, err := FromProto(sp)
|
||||
if err != nil {
|
||||
return state, err
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ func NewIndexerService(
|
||||
// and indexing them by events.
|
||||
func (is *IndexerService) OnStart() error {
|
||||
// Use SubscribeUnbuffered here to ensure both subscriptions does not get
|
||||
// cancelled due to not pulling messages fast enough. Cause this might
|
||||
// canceled due to not pulling messages fast enough. Cause this might
|
||||
// sometimes happen when there are no other subscribers.
|
||||
blockHeadersSub, err := is.eventBus.SubscribeUnbuffered(
|
||||
context.Background(),
|
||||
|
||||
@@ -240,7 +240,7 @@ func TestValidateBlockEvidence(t *testing.T) {
|
||||
A block with too much evidence fails
|
||||
*/
|
||||
evidence := make([]types.Evidence, 0)
|
||||
var currentBytes int64 = 0
|
||||
var currentBytes int64
|
||||
// more bytes than the maximum allowed for evidence
|
||||
for currentBytes <= maxBytesEvidence {
|
||||
newEv := types.NewMockDuplicateVoteEvidenceWithValidator(height, time.Now(),
|
||||
@@ -260,7 +260,7 @@ func TestValidateBlockEvidence(t *testing.T) {
|
||||
A good block with several pieces of good evidence passes
|
||||
*/
|
||||
evidence := make([]types.Evidence, 0)
|
||||
var currentBytes int64 = 0
|
||||
var currentBytes int64
|
||||
// precisely the amount of allowed evidence
|
||||
for {
|
||||
newEv := types.NewMockDuplicateVoteEvidenceWithValidator(height, defaultEvidenceTime,
|
||||
|
||||
Reference in New Issue
Block a user