Skip to content

Commit

Permalink
fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev committed Jun 28, 2024
1 parent 5dea9c1 commit e7ce09b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
6 changes: 4 additions & 2 deletions domain/consensus/utils/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ package constants
import "math"

const (
// BlockVersion represents the current block version
// BlockVersionBeforeHF represents the block version before the HF
BlockVersionBeforeHF uint16 = 1
BlockVersionAfterHF uint16 = 2

// BlockVersionAfterHF represents the block version after the HF
BlockVersionAfterHF uint16 = 2

// MaxTransactionVersion is the current latest supported transaction version.
MaxTransactionVersion uint16 = 0
Expand Down
2 changes: 1 addition & 1 deletion domain/consensus/utils/pow/fishhash.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func prebuildDataset(ctx *fishhashContext, numThreads uint32) {
return
}

if ctx.ready == true {
if ctx.ready {
log.Infof("Dataset already generated")
return
}
Expand Down
3 changes: 2 additions & 1 deletion domain/consensus/utils/pow/fishhash_kernel.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package pow

import (
"github.com/karlsen-network/karlsend/domain/consensus/model/externalapi"
"golang.org/x/crypto/sha3"

//"crypto/sha3"
Expand Down Expand Up @@ -69,6 +68,7 @@ func lookup(ctx *fishhashContext, index uint32) hash1024 {
return calculateDatasetItem1024(ctx, index)
}

/*
func fishhashKernel(ctx *fishhashContext, seed hash512) hash256 {
indexLimit := uint32(ctx.FullDatasetNumItems)
mix := mergeHashes(seed, seed)
Expand Down Expand Up @@ -126,3 +126,4 @@ func fishHash(ctx *fishhashContext, hashin *externalapi.DomainHash) *externalapi
copy(outputArray[:], output[:])
return externalapi.NewDomainHashFromByteArray(&outputArray)
}
*/
7 changes: 4 additions & 3 deletions domain/consensus/utils/pow/pow.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,17 @@ func NewState(header externalapi.MutableBlockHeader, generatedag bool) *State {
}
}

// Return the hashing algo version

Check failure on line 110 in domain/consensus/utils/pow/pow.go

View workflow job for this annotation

GitHub Actions / Tests, ubuntu-latest

comment on exported function GetHashingAlgoVersion should be of the form "GetHashingAlgoVersion ..."

Check failure on line 110 in domain/consensus/utils/pow/pow.go

View workflow job for this annotation

GitHub Actions / Tests, windows-latest

comment on exported function GetHashingAlgoVersion should be of the form "GetHashingAlgoVersion ..."

Check failure on line 110 in domain/consensus/utils/pow/pow.go

View workflow job for this annotation

GitHub Actions / Tests, macos-latest

comment on exported function GetHashingAlgoVersion should be of the form "GetHashingAlgoVersion ..."
func GetHashingAlgoVersion() string {
return hashingAlgoVersion
}

// Check the readiness of the context

Check failure on line 115 in domain/consensus/utils/pow/pow.go

View workflow job for this annotation

GitHub Actions / Tests, ubuntu-latest

comment on exported method State.IsContextReady should be of the form "IsContextReady ..."

Check failure on line 115 in domain/consensus/utils/pow/pow.go

View workflow job for this annotation

GitHub Actions / Tests, windows-latest

comment on exported method State.IsContextReady should be of the form "IsContextReady ..."

Check failure on line 115 in domain/consensus/utils/pow/pow.go

View workflow job for this annotation

GitHub Actions / Tests, macos-latest

comment on exported method State.IsContextReady should be of the form "IsContextReady ..."
func (state *State) IsContextReady() bool {
if state != nil && &state.context != nil {
if state != nil {
return state.context.ready
} else {
return false
}
return false
}

// CalculateProofOfWorkValue hashes the internal header and returns its big.Int value
Expand Down

0 comments on commit e7ce09b

Please sign in to comment.