From 2c9a5472a62283da1d18638c37cc93a34dd6572b Mon Sep 17 00:00:00 2001 From: carlos-romano Date: Wed, 15 Jan 2025 13:21:14 +0100 Subject: [PATCH] lint --- internal/statetransition/state_transition.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/internal/statetransition/state_transition.go b/internal/statetransition/state_transition.go index bdaef33..0164d36 100644 --- a/internal/statetransition/state_transition.go +++ b/internal/statetransition/state_transition.go @@ -703,7 +703,7 @@ func CalculateNewCoreAuthorizations(header block.Header, guarantees block.Guaran newAuths := make([]crypto.Hash, len(currentAuthorizations[c])) copy(newAuths, currentAuthorizations[c]) - //// TODO: For some reason test vectors don't expect this to happen, although it's on the spec. + //// TODO: [Issue 223] For some reason test vectors don't expect this to happen, although it's on the spec. //// F(c) - Remove authorizer if it was used in a guarantee for this core. 8.3 Graypaper 0.5.4 //for _, guarantee := range guarantees.Guarantees { // if guarantee.WorkReport.CoreIndex == c { @@ -731,6 +731,8 @@ func CalculateNewCoreAuthorizations(header block.Header, guarantees block.Guaran } // removeAuthorizer removes an authorizer from a list while maintaining order +// +//lint:ignore U1000 func removeAuthorizer(auths []crypto.Hash, toRemove crypto.Hash) []crypto.Hash { for i := 0; i < len(auths); i++ { if auths[i] == toRemove { @@ -1798,7 +1800,7 @@ func CalculateWorkReportsAndAccumulate(header *block.Header, currentState *state slices.Concat( slices.Concat(currentState.AccumulationQueue[timeslotPerEpoch:]...), // ⋃(ϑm...) slices.Concat(currentState.AccumulationQueue[:timeslotPerEpoch]...), // ⋃(ϑ...m) - queuedWorkReports, // WQ + queuedWorkReports, // WQ ), getWorkPackageHashes(immediatelyAccWorkReports), // P(W!) ) @@ -2429,10 +2431,10 @@ func (a *Accumulator) ParallelDelta( workReports []block.WorkReport, privilegedGas map[block.ServiceId]uint64, // D⟨NS → NG⟩ ) ( - uint64, // total gas used - state.AccumulationState, // updated context + uint64, // total gas used + state.AccumulationState, // updated context []service.DeferredTransfer, // all transfers - ServiceHashPairs, // accumulation outputs + ServiceHashPairs, // accumulation outputs ) { // Get all unique service indices involved (s) // s = {rs S w ∈ w, r ∈ wr} ∪ K(f) @@ -2548,7 +2550,7 @@ func (a *Accumulator) Delta1( accumulationState state.AccumulationState, workReports []block.WorkReport, privilegedGas map[block.ServiceId]uint64, // D⟨NS → NG⟩ - serviceIndex block.ServiceId, // NS + serviceIndex block.ServiceId, // NS ) (state.AccumulationState, []service.DeferredTransfer, *crypto.Hash, uint64) { // Calculate gas limit (g) gasLimit := uint64(0)