Skip to content

Commit

Permalink
lint and type fix
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech committed Jul 31, 2024
1 parent eb22f06 commit db9bd27
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import {itBench, setBenchOpts} from "@dapplion/benchmark";
import {Map} from "immutable";
import {toBufferBE} from "bigint-buffer";
import {digest} from "@chainsafe/as-sha256";
import type {SecretKey} from "@chainsafe/bls/types";
import bls from "@chainsafe/bls";
import {SecretKey} from "@chainsafe/blst";
import {ssz} from "@lodestar/types";
import {type CachedBeaconStateAllForks, PubkeyIndexMap} from "@lodestar/state-transition";
import {bytesToBigInt, intToBytes} from "@lodestar/utils";
Expand Down Expand Up @@ -106,6 +105,7 @@ describe("updateUnfinalizedPubkeys perf tests", function () {

function generatePrivateKey(index: number): SecretKey {
const secretKeyBytes = toBufferBE(bytesToBigInt(digest(intToBytes(index, 32))) % BigInt("38581184513"), 32);
return bls.SecretKey.fromBytes(secretKeyBytes);
const secret: SecretKey = SecretKey.fromBytes(secretKeyBytes);
return secret;
}
});
2 changes: 1 addition & 1 deletion packages/beacon-node/test/spec/specTestVersioning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {DownloadTestsOptions} from "@lodestar/spec-test-util/downloadTests";
const __dirname = path.dirname(fileURLToPath(import.meta.url));

export const ethereumConsensusSpecsTests: DownloadTestsOptions = {
specVersion: "v1.5.0-alpha.3",
specVersion: "v1.4.0-beta.6",
// Target directory is the host package root: 'packages/*/spec-tests'
outputDir: path.join(__dirname, "../../spec-tests"),
specTestsRepoUrl: "https://github.com/ethereum/consensus-spec-tests",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {BitArray, fromHexString, toHexString} from "@chainsafe/ssz";
import {describe, it, expect, beforeEach, beforeAll, afterEach, vi} from "vitest";
import {SecretKey, Signature, fastAggregateVerify} from "@chainsafe/blst";
import {SecretKey, Signature, fastAggregateVerify, aggregateSignatures} from "@chainsafe/blst";
import {CachedBeaconStateAllForks, newFilledArray} from "@lodestar/state-transition";
import {
FAR_FUTURE_EPOCH,
Expand Down Expand Up @@ -331,9 +331,9 @@ describe("MatchingDataAttestationGroup aggregateInto", function () {
});

describe("aggregateConsolidation", function () {
const sk0 = bls.SecretKey.fromBytes(Buffer.alloc(32, 1));
const sk1 = bls.SecretKey.fromBytes(Buffer.alloc(32, 2));
const sk2 = bls.SecretKey.fromBytes(Buffer.alloc(32, 3));
const sk0 = SecretKey.fromBytes(Buffer.alloc(32, 1));
const sk1 = SecretKey.fromBytes(Buffer.alloc(32, 2));
const sk2 = SecretKey.fromBytes(Buffer.alloc(32, 3));
const skArr = [sk0, sk1, sk2];
const testCases: {
name: string;
Expand Down Expand Up @@ -397,7 +397,7 @@ describe("aggregateConsolidation", function () {
expect(finalAttestation.aggregationBits.uint8Array).toEqual(new Uint8Array(expectedAggregationBits));
expect(finalAttestation.committeeBits.toBoolArray()).toEqual(expectedCommitteeBits);
expect(finalAttestation.data).toEqual(attData);
expect(finalAttestation.signature).toEqual(bls.Signature.aggregate(sigArr).toBytes());
expect(finalAttestation.signature).toEqual(aggregateSignatures(sigArr).toBytes());
});
}
});

0 comments on commit db9bd27

Please sign in to comment.