Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
goran-ethernal committed Jul 11, 2024
1 parent 7283a15 commit 789c8f7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion services/datacom/datacom.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ func (d *Endpoints) SignSequence(signedSequence types.SignedSequence) (interface

// Store off-chain data by hash (hash(L2Data): L2Data)
if err = d.db.StoreOffChainData(context.Background(), signedSequence.Sequence.OffChainData()); err != nil {
return "0x0", rpc.NewRPCError(rpc.DefaultErrorCode, fmt.Errorf("failed to store offchain data. Error: %w", err).Error())
return "0x0", rpc.NewRPCError(rpc.DefaultErrorCode,
fmt.Errorf("failed to store offchain data. Error: %w", err).Error())
}

// Sign
Expand Down
4 changes: 2 additions & 2 deletions synchronizer/batches.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ func (bs *BatchSynchronizer) handleUnresolvedBatches(ctx context.Context) error
}

// Resolve the unresolved data
var data []types.OffChainData
var resolved []types.BatchKey
data := make([]types.OffChainData, 0)
resolved := make([]types.BatchKey, 0)

// Go over existing keys and mark them as resolved if they exist.
// Update the batch number if it is zero.
Expand Down
4 changes: 2 additions & 2 deletions synchronizer/committee_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (t *CommitteeMapSafe) Load(addr common.Address) (etherman.DataCommitteeMemb
if !exists {
return etherman.DataCommitteeMember{}, false
}
return rawValue.(etherman.DataCommitteeMember), exists
return rawValue.(etherman.DataCommitteeMember), exists //nolint:forcetypeassert
}

// Delete deletes the value for a key.
Expand All @@ -57,7 +57,7 @@ func (t *CommitteeMapSafe) Delete(key common.Address) {
func (t *CommitteeMapSafe) AsSlice() []etherman.DataCommitteeMember {
membersSlice := make([]etherman.DataCommitteeMember, 0, atomic.LoadInt32(&t.membersCount))
t.members.Range(func(_, rawMember any) bool {
membersSlice = append(membersSlice, rawMember.(etherman.DataCommitteeMember))
membersSlice = append(membersSlice, rawMember.(etherman.DataCommitteeMember)) //nolint:forcetypeassert

return true
})
Expand Down

0 comments on commit 789c8f7

Please sign in to comment.