Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: enable all biomejs recommended rules #7153

Merged
merged 41 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
bc6ea37
Enable recomended correctness/noVoidTypeReturn
nazarhussain Oct 11, 2024
ab71719
Enable recomended rule correctness/useYield
nazarhussain Oct 11, 2024
91f6054
Enable recomended rule performance/noAccumulatingSpread
nazarhussain Oct 11, 2024
6cc060b
Enable recomended rule performance/noDelete
nazarhussain Oct 11, 2024
07f7cd4
Enable recomended rule suspicious/noAsyncPromiseExecutor
nazarhussain Oct 11, 2024
edd44b1
Enable recommended rule suspicious/noDoubleEquals
nazarhussain Oct 11, 2024
3cf245a
Enable recommended rule suspicious/noDuplicateTestHooks
nazarhussain Oct 11, 2024
3d67f6a
Enable recommended rule suspicious/noExportsInTest
nazarhussain Oct 11, 2024
24ebdc0
Enable recommended rule suspicious/noFallthroughSwitchClause
nazarhussain Oct 11, 2024
f2756df
Enable recommended rule suspicious/noGlobalIsFinite
nazarhussain Oct 11, 2024
d6b4206
Enable recommended rule suspicious/noGlobalIsNan
nazarhussain Oct 11, 2024
019c3de
Enable recommended rule suspicious/noPrototypeBuiltins
nazarhussain Oct 11, 2024
2630c5e
Enable recommended rule suspicious/noShadowRestrictedNames
nazarhussain Oct 11, 2024
04a1138
Enable recommended rule suspicious/useDefaultSwitchClauseLast
nazarhussain Oct 11, 2024
65a9d2a
Enable recommended rule suspicious/useGetterReturn
nazarhussain Oct 11, 2024
224a439
Enable recommended rule style/noUnusedTemplateLiteral
nazarhussain Oct 11, 2024
2a5b647
Convert default case to unreachable code
nazarhussain Oct 11, 2024
51c6048
Enable recommended rule complexity/noForEach
nazarhussain Oct 11, 2024
9f526e7
Enable recommended rule complexity/noThisInStatic
nazarhussain Oct 11, 2024
630ce11
Enable recommended rule complexity/useFlatMap
nazarhussain Oct 11, 2024
a0045ea
Enable recommended rule complexity/useOptionalChain
nazarhussain Oct 11, 2024
7a7b367
Enable recommended rule complexity/useRegexLiterals
nazarhussain Oct 11, 2024
7e3d613
Reorganize the config structure
nazarhussain Oct 11, 2024
d96b4d6
Fix few typos
nazarhussain Oct 14, 2024
69b7fa6
Merge branch 'unstable' into nh/biome-rules
nazarhussain Oct 14, 2024
4578725
Revert "Enable recomended rule performance/noDelete"
nazarhussain Oct 14, 2024
a04912c
Fix formatting
nazarhussain Oct 14, 2024
655a4d1
Enable recommended rule style/noUselessElse
nazarhussain Oct 14, 2024
ff5bb90
Enable recommended rule complexity/useLiteralKeys
nazarhussain Oct 14, 2024
dff8184
Enable recommended rule complexity/useArrowFunction
nazarhussain Oct 14, 2024
2309803
Fix few types
nazarhussain Oct 14, 2024
d67458d
Fix a test file
nazarhussain Oct 14, 2024
7cfc88e
Fix formatting
nazarhussain Oct 14, 2024
6472918
Enable recommended rule suspicious/noImplicitAnyLet
nazarhussain Oct 14, 2024
b3243c1
Enable recommended rule complexity/noUselessEmptyExport
nazarhussain Oct 14, 2024
38e0c50
Fix types
nazarhussain Oct 14, 2024
a6531c7
Fix unti tests
nazarhussain Oct 14, 2024
b103cf5
Fix unit test
nazarhussain Oct 14, 2024
384b5cb
Fix lint error
nazarhussain Oct 14, 2024
d449d16
Fix a unit test pattern
nazarhussain Oct 14, 2024
4f31ed9
Fix formatting
nazarhussain Oct 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@
"useAsConstAssertion": "error"
},
"suspicious": {
// `void` as type is useful in our case when used as generic constraint e.g. K extends number | void
"noConfusingVoidType": "off",
"noConsoleLog": "error",
"noDoubleEquals": "off",
"noDuplicateTestHooks": "off",
"noExplicitAny": "error",
"noExportsInTest": "off",
Expand Down
2 changes: 1 addition & 1 deletion packages/api/test/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function getTestServer(): {server: FastifyInstance; start: () => Promise<
const start = (): Promise<string> =>
new Promise<string>((resolve, reject) => {
server.listen({port: 0}, function (err, address) {
if (err !== null && err != undefined) {
if (err !== null && err !== undefined) {
nazarhussain marked this conversation as resolved.
Show resolved Hide resolved
reject(err);
} else {
resolve(address);
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/src/chain/balancesCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class CheckpointBalancesCache {
const epochBoundaryRoot =
epochBoundarySlot === state.slot ? blockRootHex : toRootHex(getBlockRootAtSlot(state, epochBoundarySlot));

const index = this.items.findIndex((item) => item.epoch === epoch && item.rootHex == epochBoundaryRoot);
const index = this.items.findIndex((item) => item.epoch === epoch && item.rootHex === epochBoundaryRoot);
if (index === -1) {
if (this.items.length === MAX_BALANCE_CACHE_SIZE) {
this.items.shift();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export async function writeBlockInputToDb(this: BeaconChain, blocksInput: BlockI

if (blockInput.type === BlockInputType.availableData || blockInput.type === BlockInputType.dataPromise) {
const blobSidecars =
blockInput.type == BlockInputType.availableData
blockInput.type === BlockInputType.availableData
? blockInput.blockData.blobs
: // At this point of import blobs are available and can be safely awaited
(await blockInput.cachedData.availabilityPromise).blobs;
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/src/chain/lightClient/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ export class LightClientServer {
if (
attestedData.isFinalized &&
finalizedHeaderAttested &&
computeSyncPeriodAtSlot(finalizedHeaderAttested.beacon.slot) == syncPeriod
computeSyncPeriodAtSlot(finalizedHeaderAttested.beacon.slot) === syncPeriod
) {
isFinalized = true;
finalityBranch = attestedData.finalityBranch;
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/src/db/buckets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export enum Bucket {
export function getBucketNameByValue<T extends Bucket>(enumValue: T): keyof typeof Bucket {
const keys = Object.keys(Bucket).filter((x) => {
if (isNaN(parseInt(x))) {
return Bucket[x as keyof typeof Bucket] == enumValue;
return Bucket[x as keyof typeof Bucket] === enumValue;
} else {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/src/eth1/eth1MergeBlockTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export class Eth1MergeBlockTracker {
// Persist found merge block here to affect both caller paths:
// - internal searcher
// - external caller if STOPPED
if (mergeBlock && this.status.code != StatusCode.FOUND) {
if (mergeBlock && this.status.code !== StatusCode.FOUND) {
if (this.status.code === StatusCode.SEARCHING) {
this.close();
}
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/src/network/reqresp/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const responseSszTypeByMethod: {[K in ReqRespMethod]: ResponseTypeGetter<
[ReqRespMethod.Status]: () => ssz.phase0.Status,
[ReqRespMethod.Goodbye]: () => ssz.phase0.Goodbye,
[ReqRespMethod.Ping]: () => ssz.phase0.Ping,
[ReqRespMethod.Metadata]: (_, version) => (version == Version.V1 ? ssz.phase0.Metadata : ssz.altair.Metadata),
[ReqRespMethod.Metadata]: (_, version) => (version === Version.V1 ? ssz.phase0.Metadata : ssz.altair.Metadata),
[ReqRespMethod.BeaconBlocksByRange]: blocksResponseType,
[ReqRespMethod.BeaconBlocksByRoot]: blocksResponseType,
[ReqRespMethod.BlobSidecarsByRange]: () => ssz.deneb.BlobSidecar,
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/src/sync/utils/remoteSyncType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function getPeerSyncType(
else if (remote.finalizedEpoch > local.finalizedEpoch) {
if (
// Peer is in next epoch, and head is within range => SYNCED
(local.finalizedEpoch + 1 == remote.finalizedEpoch &&
(local.finalizedEpoch + 1 === remote.finalizedEpoch &&
withinRangeOf(remote.headSlot, local.headSlot, slotImportTolerance)) ||
// Peer's head is known => SYNCED
forkChoice.hasBlock(remote.headRoot)
Expand Down
2 changes: 1 addition & 1 deletion packages/beacon-node/src/util/binarySearch.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function binarySearchLte<T>(items: T[], value: number, getter: (item: T) => number): T {
if (items.length == 0) {
if (items.length === 0) {
throw new ErrorNoValues();
}

Expand Down
6 changes: 3 additions & 3 deletions packages/beacon-node/test/unit/util/array.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import {findLastIndex, LinkedList} from "../../../src/util/array.js";

describe("findLastIndex", () => {
it("should return the last index that matches a predicate", () => {
expect(findLastIndex([1, 2, 3, 4], (n) => n % 2 == 0)).toEqual(3);
expect(findLastIndex([1, 2, 3, 4, 5], (n) => n % 2 == 0)).toEqual(3);
expect(findLastIndex([1, 2, 3, 4], (n) => n % 2 === 0)).toEqual(3);
expect(findLastIndex([1, 2, 3, 4, 5], (n) => n % 2 === 0)).toEqual(3);
expect(findLastIndex([1, 2, 3, 4, 5], () => true)).toEqual(4);
});

it("should return -1 if there are no matches", () => {
expect(findLastIndex([1, 3, 5], (n) => n % 2 == 0)).toEqual(-1);
expect(findLastIndex([1, 3, 5], (n) => n % 2 === 0)).toEqual(-1);
expect(findLastIndex([1, 2, 3, 4, 5], () => false)).toEqual(-1);
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/util/jwt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export function extractJwtHexSecret(jwtSecretContents: string): string {
const hexPattern = new RegExp(/^(0x|0X)?(?<jwtSecret>[a-fA-F0-9]+)$/, "g");
const jwtSecretHexMatch = hexPattern.exec(jwtSecretContents);
const jwtSecret = jwtSecretHexMatch?.groups?.jwtSecret;
if (!jwtSecret || jwtSecret.length != 64) {
if (!jwtSecret || jwtSecret.length !== 64) {
throw Error(`Need a valid 256 bit hex encoded secret ${jwtSecret} ${jwtSecretContents}`);
}
// Return the secret in proper hex format
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const nodeAssertion: Assertion<"node", {health: number; keyManagerKeys: s

let keyManagerKeys: string[];
// There is an authentication issue with the lighthouse keymanager client
if (node.validator.client == ValidatorClient.Lighthouse || getAllKeys(node.validator.keys).length === 0) {
if (node.validator.client === ValidatorClient.Lighthouse || getAllKeys(node.validator.keys).length === 0) {
keyManagerKeys = [];
} else {
const keys = (await node.validator.keyManager.listKeys()).value();
Expand All @@ -30,7 +30,7 @@ export const nodeAssertion: Assertion<"node", {health: number; keyManagerKeys: s
const errors: AssertionResult[] = [];

// There is an authentication issue with the lighthouse keymanager client
if (node.validator?.client == ValidatorClient.Lighthouse) return errors;
if (node.validator?.client === ValidatorClient.Lighthouse) return errors;

const {health, keyManagerKeys} = store[slot];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export const generateGethNode: ExecutionNodeGenerator<ExecutionClient.Geth> = (o
"--verbosity",
"5",
...(mining ? ["--mine", "--miner.etherbase", EL_GENESIS_ACCOUNT] : []),
...(mode == ExecutionStartMode.PreMerge ? ["--nodiscover"] : []),
...(mode === ExecutionStartMode.PreMerge ? ["--nodiscover"] : []),
...clientOptions,
],
env: {},
Expand Down
22 changes: 11 additions & 11 deletions packages/light-client/src/spec/isBetterUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,49 +28,49 @@ export function isBetterUpdate(newUpdate: LightClientUpdateSummary, oldUpdate: L
const oldNumActiveParticipants = oldUpdate.activeParticipants;
const newHasSupermajority = newNumActiveParticipants * 3 >= SYNC_COMMITTEE_SIZE * 2;
const oldHasSupermajority = oldNumActiveParticipants * 3 >= SYNC_COMMITTEE_SIZE * 2;
if (newHasSupermajority != oldHasSupermajority) {
if (newHasSupermajority !== oldHasSupermajority) {
return newHasSupermajority;
}
if (!newHasSupermajority && newNumActiveParticipants != oldNumActiveParticipants) {
if (!newHasSupermajority && newNumActiveParticipants !== oldNumActiveParticipants) {
return newNumActiveParticipants > oldNumActiveParticipants;
}

// Compare presence of relevant sync committee
const newHasRelevantSyncCommittee =
newUpdate.isSyncCommitteeUpdate &&
computeSyncPeriodAtSlot(newUpdate.attestedHeaderSlot) == computeSyncPeriodAtSlot(newUpdate.signatureSlot);
computeSyncPeriodAtSlot(newUpdate.attestedHeaderSlot) === computeSyncPeriodAtSlot(newUpdate.signatureSlot);
const oldHasRelevantSyncCommittee =
oldUpdate.isSyncCommitteeUpdate &&
computeSyncPeriodAtSlot(oldUpdate.attestedHeaderSlot) == computeSyncPeriodAtSlot(oldUpdate.signatureSlot);
if (newHasRelevantSyncCommittee != oldHasRelevantSyncCommittee) {
computeSyncPeriodAtSlot(oldUpdate.attestedHeaderSlot) === computeSyncPeriodAtSlot(oldUpdate.signatureSlot);
if (newHasRelevantSyncCommittee !== oldHasRelevantSyncCommittee) {
return newHasRelevantSyncCommittee;
}

// Compare indication of any finality
const newHasFinality = newUpdate.isFinalityUpdate;
const oldHasFinality = oldUpdate.isFinalityUpdate;
if (newHasFinality != oldHasFinality) {
if (newHasFinality !== oldHasFinality) {
return newHasFinality;
}

// Compare sync committee finality
if (newHasFinality) {
const newHasSyncCommitteeFinality =
computeSyncPeriodAtSlot(newUpdate.finalizedHeaderSlot) == computeSyncPeriodAtSlot(newUpdate.attestedHeaderSlot);
computeSyncPeriodAtSlot(newUpdate.finalizedHeaderSlot) === computeSyncPeriodAtSlot(newUpdate.attestedHeaderSlot);
const oldHasSyncCommitteeFinality =
computeSyncPeriodAtSlot(oldUpdate.finalizedHeaderSlot) == computeSyncPeriodAtSlot(oldUpdate.attestedHeaderSlot);
if (newHasSyncCommitteeFinality != oldHasSyncCommitteeFinality) {
computeSyncPeriodAtSlot(oldUpdate.finalizedHeaderSlot) === computeSyncPeriodAtSlot(oldUpdate.attestedHeaderSlot);
if (newHasSyncCommitteeFinality !== oldHasSyncCommitteeFinality) {
return newHasSyncCommitteeFinality;
}
}

// Tiebreaker 1: Sync committee participation beyond supermajority
if (newNumActiveParticipants != oldNumActiveParticipants) {
if (newNumActiveParticipants !== oldNumActiveParticipants) {
return newNumActiveParticipants > oldNumActiveParticipants;
}

// Tiebreaker 2: Prefer older data (fewer changes to best)
if (newUpdate.attestedHeaderSlot != oldUpdate.attestedHeaderSlot) {
if (newUpdate.attestedHeaderSlot !== oldUpdate.attestedHeaderSlot) {
return newUpdate.attestedHeaderSlot < oldUpdate.attestedHeaderSlot;
}
return newUpdate.signatureSlot < oldUpdate.signatureSlot;
Expand Down
2 changes: 1 addition & 1 deletion packages/prover/src/web3_provider_inspector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class Web3ProviderInspector {
return;
}

const index = this.providerTypes.findIndex((p) => p.name == indexOrName);
const index = this.providerTypes.findIndex((p) => p.name === indexOrName);
if (index < 0) {
throw Error(`Provider type '${indexOrName}' is not registered.`);
}
Expand Down
18 changes: 9 additions & 9 deletions packages/state-transition/src/util/shuffle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function innerShuffleList(input: Shuffleable, seed: Bytes32, dir: boolean): void
// nothing to (un)shuffle
return;
}
if (SHUFFLE_ROUND_COUNT == 0) {
if (SHUFFLE_ROUND_COUNT === 0) {
// no shuffling
return;
}
Expand Down Expand Up @@ -145,20 +145,20 @@ function innerShuffleList(input: Shuffleable, seed: Bytes32, dir: boolean): void
// -- step() fn start
// The pair is i,j. With j being the bigger of the two, hence the "position" identifier of the pair.
// Every 256th bit (aligned to j).
if ((j & 0xff) == 0xff) {
if ((j & 0xff) === 0xff) {
// just overwrite the last part of the buffer, reuse the start (seed, round)
setPositionUint32(j >> 8, buf);
source = digest(buf);
}

// Same trick with byte retrieval. Only every 8th.
if ((j & 0x7) == 0x7) {
if ((j & 0x7) === 0x7) {
byteV = source[(j & 0xff) >> 3];
}

const bitV = (byteV >> (j & 0x7)) & 0x1;

if (bitV == 1) {
if (bitV === 1) {
// swap the pair items
const tmp = input[j];
input[j] = input[i];
Expand All @@ -181,20 +181,20 @@ function innerShuffleList(input: Shuffleable, seed: Bytes32, dir: boolean): void
// -- step() fn start
// The pair is i,j. With j being the bigger of the two, hence the "position" identifier of the pair.
// Every 256th bit (aligned to j).
if ((j & 0xff) == 0xff) {
if ((j & 0xff) === 0xff) {
// just overwrite the last part of the buffer, reuse the start (seed, round)
setPositionUint32(j >> 8, buf);
source = digest(buf);
}

// Same trick with byte retrieval. Only every 8th.
if ((j & 0x7) == 0x7) {
if ((j & 0x7) === 0x7) {
byteV = source[(j & 0xff) >> 3];
}

const bitV = (byteV >> (j & 0x7)) & 0x1;

if (bitV == 1) {
if (bitV === 1) {
// swap the pair items
const tmp = input[j];
input[j] = input[i];
Expand All @@ -207,11 +207,11 @@ function innerShuffleList(input: Shuffleable, seed: Bytes32, dir: boolean): void
if (dir) {
// -> shuffle
r += 1;
if (r == SHUFFLE_ROUND_COUNT) {
if (r === SHUFFLE_ROUND_COUNT) {
break;
}
} else {
if (r == 0) {
if (r === 0) {
break;
}
// -> un-shuffle
Expand Down
4 changes: 2 additions & 2 deletions packages/state-transition/src/util/shufflingDecisionRoot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {computeStartSlotAtEpoch} from "./epoch.js";
*/
export function proposerShufflingDecisionRoot(state: CachedBeaconStateAllForks): Root | null {
const decisionSlot = proposerShufflingDecisionSlot(state);
if (state.slot == decisionSlot) {
if (state.slot === decisionSlot) {
return null;
} else {
return getBlockRootAtSlot(state, decisionSlot);
Expand All @@ -37,7 +37,7 @@ function proposerShufflingDecisionSlot(state: CachedBeaconStateAllForks): Slot {
*/
export function attesterShufflingDecisionRoot(state: CachedBeaconStateAllForks, requestedEpoch: Epoch): Root | null {
const decisionSlot = attesterShufflingDecisionSlot(state, requestedEpoch);
if (state.slot == decisionSlot) {
if (state.slot === decisionSlot) {
return null;
} else {
return getBlockRootAtSlot(state, decisionSlot);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe.skip("shuffle number math ops", () => {

itBench("i == j", () => {
for (let i = 0; i < forRuns; i++) {
i == j;
i === j;
}
});

Expand All @@ -42,13 +42,13 @@ describe.skip("shuffle number math ops", () => {

itBench("bit opts", () => {
for (let i = 0; i < forRuns; i++) {
(j & 0x7) == 0x7;
(j & 0x7) === 0x7;
}
});

itBench("modulo", () => {
for (let i = 0; i < forRuns; i++) {
j % 8 == 0;
j % 8 === 0;
}
});

Expand Down
2 changes: 1 addition & 1 deletion packages/validator/src/buckets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export enum Bucket {
export function getBucketNameByValue<T extends Bucket>(enumValue: T): keyof typeof Bucket {
const keys = Object.keys(Bucket).filter((x) => {
if (isNaN(parseInt(x))) {
return Bucket[x as keyof typeof Bucket] == enumValue;
return Bucket[x as keyof typeof Bucket] === enumValue;
} else {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/validator/src/services/validatorStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ export class ValidatorStore {
}

const isPostElectra = this.config.getForkSeq(data.slot) >= ForkSeq.electra;
if (!isPostElectra && duty.committeeIndex != data.index) {
if (!isPostElectra && duty.committeeIndex !== data.index) {
throw Error(
`Inconsistent duties during signing: duty.committeeIndex ${duty.committeeIndex} != att.committeeIndex ${data.index}`
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class SlashingProtectionAttestationService {
async checkAndInsertAttestation(pubKey: BLSPubkey, attestation: SlashingProtectionAttestation): Promise<void> {
const safeStatus = await this.checkAttestation(pubKey, attestation);

if (safeStatus != SafeStatus.SAME_DATA) {
if (safeStatus !== SafeStatus.SAME_DATA) {
await this.insertAttestation(pubKey, attestation);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/validator/src/slashingProtection/block/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class SlashingProtectionBlockService {
async checkAndInsertBlockProposal(pubkey: BLSPubkey, block: SlashingProtectionBlock): Promise<void> {
const safeStatus = await this.checkBlockProposal(pubkey, block);

if (safeStatus != SafeStatus.SAME_DATA) {
if (safeStatus !== SafeStatus.SAME_DATA) {
await this.insertBlockProposal(pubkey, block);
}

Expand Down