Skip to content

Fix some bugs when integrating cached reset branch #582

Fix some bugs when integrating cached reset branch

Fix some bugs when integrating cached reset branch #582

GitHub Actions / golangci failed Oct 28, 2023 in 1s

reviewdog [golangci] report

reported by reviewdog 🐶

Findings (12)

pkg/storage/storage_prunable.go|43 col 12| Error return value of s.Rollback is not checked (errcheck)
pkg/storage/prunable/prunable.go|153 col 9| indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
pkg/storage/prunable/prunable.go|159 col 9| indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
pkg/storage/prunable/prunable.go|165 col 9| indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
pkg/storage/prunable/prunable.go|171 col 9| indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
pkg/protocol/network_clock.go|25 col 11| indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive)
pkg/protocol/chain.go|234 col 9| indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
pkg/protocol/chain_manager.go|267 col 16| superfluous-else: if block ends with call to panic function, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
pkg/protocol/commitment_verifier.go|40 col 55| unnecessary conversion (unconvert)
pkg/protocol/protocol_warp_sync.go|102 col 51| unnecessary conversion (unconvert)
pkg/protocol/protocol_warp_sync.go|113 col 59| unnecessary conversion (unconvert)
pkg/protocol/chain.go|229 col 17| func (*Chain).earliestUncommittedSlot is unused (unused)

Filtered Findings (0)

Annotations

Check failure on line 43 in pkg/storage/storage_prunable.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] pkg/storage/storage_prunable.go#L43

Error return value of `s.Rollback` is not checked (errcheck)
Raw output
pkg/storage/storage_prunable.go:43:12: Error return value of `s.Rollback` is not checked (errcheck)
	s.Rollback(s.Settings().LatestCommitment().Slot())
	          ^

Check failure on line 153 in pkg/storage/prunable/prunable.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] pkg/storage/prunable/prunable.go#L153

indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
Raw output
pkg/storage/prunable/prunable.go:153:9: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
	} else {
		lastPrunedEpoch = max(lastPrunedEpoch, lastPrunedCommitteeEpoch)
	}

Check failure on line 159 in pkg/storage/prunable/prunable.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] pkg/storage/prunable/prunable.go#L159

indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
Raw output
pkg/storage/prunable/prunable.go:159:9: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
	} else {
		lastPrunedEpoch = max(lastPrunedEpoch, lastPrunedPoolStatsEpoch)
	}

Check failure on line 165 in pkg/storage/prunable/prunable.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] pkg/storage/prunable/prunable.go#L165

indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
Raw output
pkg/storage/prunable/prunable.go:165:9: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
	} else {
		lastPrunedEpoch = max(lastPrunedEpoch, lastPrunedDecidedUpgradeSignalsEpoch)
	}

Check failure on line 171 in pkg/storage/prunable/prunable.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] pkg/storage/prunable/prunable.go#L171

indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
Raw output
pkg/storage/prunable/prunable.go:171:9: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
	} else {
		lastPrunedEpoch = max(lastPrunedEpoch, lastPrunedPoolRewardsEpoch)
	}

Check failure on line 25 in pkg/protocol/network_clock.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] pkg/protocol/network_clock.go#L25

indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive)
Raw output
pkg/protocol/network_clock.go:25:11: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive)
			} else {
				return newValue
			}

Check failure on line 234 in pkg/protocol/chain.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] pkg/protocol/chain.go#L234

indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
Raw output
pkg/protocol/chain.go:234:9: indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
	} else {
		return 0
	}

Check failure on line 267 in pkg/protocol/chain_manager.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] pkg/protocol/chain_manager.go#L267

superfluous-else: if block ends with call to panic function, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
Raw output
pkg/protocol/chain_manager.go:267:16: superfluous-else: if block ends with call to panic function, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (revive)
								} else {
									publishCommitment(commitmentToPublish)
								}

Check failure on line 40 in pkg/protocol/commitment_verifier.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] pkg/protocol/commitment_verifier.go#L40

unnecessary conversion (unconvert)
Raw output
pkg/protocol/commitment_verifier.go:40:55: unnecessary conversion (unconvert)
	if !iotago.VerifyProof(merkleProof, iotago.Identifier(tree.Root()), commitment.RootsID()) {
	                                                     ^

Check failure on line 102 in pkg/protocol/protocol_warp_sync.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] pkg/protocol/protocol_warp_sync.go#L102

unnecessary conversion (unconvert)
Raw output
pkg/protocol/protocol_warp_sync.go:102:51: unnecessary conversion (unconvert)
			if !iotago.VerifyProof(proof, iotago.Identifier(acceptedBlocks.Root()), commitment.RootsID()) {
			                                               ^

Check failure on line 113 in pkg/protocol/protocol_warp_sync.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] pkg/protocol/protocol_warp_sync.go#L113

unnecessary conversion (unconvert)
Raw output
pkg/protocol/protocol_warp_sync.go:113:59: unnecessary conversion (unconvert)
			if !iotago.VerifyProof(mutationProof, iotago.Identifier(acceptedTransactionIDs.Root()), commitment.RootsID()) {
			                                                       ^

Check failure on line 229 in pkg/protocol/chain.go

See this annotation in the file changed.

@github-actions github-actions / golangci

[golangci] pkg/protocol/chain.go#L229

func `(*Chain).earliestUncommittedSlot` is unused (unused)
Raw output
pkg/protocol/chain.go:229:17: func `(*Chain).earliestUncommittedSlot` is unused (unused)
func (c *Chain) earliestUncommittedSlot() iotago.SlotIndex {
                ^