From 301181dc30a774530c2840d4a38e49313a7594ec Mon Sep 17 00:00:00 2001 From: Dev Date: Fri, 5 Apr 2024 22:28:26 +0200 Subject: [PATCH] fix some semantics to pass the coding style test --- domain/consensus/utils/constants/constants.go | 6 ++++-- domain/consensus/utils/pow/pow.go | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/domain/consensus/utils/constants/constants.go b/domain/consensus/utils/constants/constants.go index d2eb4a66f7..30eae8226c 100644 --- a/domain/consensus/utils/constants/constants.go +++ b/domain/consensus/utils/constants/constants.go @@ -3,9 +3,11 @@ package constants import "math" const ( - // BlockVersion represents the current block version + // BlockVersionBeforeHF represents the block version before HF BlockVersionBeforeHF uint16 = 1 - BlockVersionAfterHF uint16 = 2 + + // BlockVersionAfterHF represents the block version after HF + BlockVersionAfterHF uint16 = 2 // MaxTransactionVersion is the current latest supported transaction version. MaxTransactionVersion uint16 = 0 diff --git a/domain/consensus/utils/pow/pow.go b/domain/consensus/utils/pow/pow.go index 37b9276382..94ab63a544 100644 --- a/domain/consensus/utils/pow/pow.go +++ b/domain/consensus/utils/pow/pow.go @@ -106,16 +106,17 @@ func NewState(header externalapi.MutableBlockHeader, generatedag bool) *State { } } +// Return the current hashing algo used func GetHashingAlgoVersion() string { return hashingAlgoVersion } +// Return the readiness state of the context func (state *State) IsContextReady() bool { if state != nil && &state.context != nil { return state.context.ready - } else { - return false } + return false } // CalculateProofOfWorkValue hashes the internal header and returns its big.Int value