fix: remove test with no value

This commit is contained in:
Franck Royer 2022-06-23 16:26:52 +10:00
parent a10d3ae7d3
commit 52d74a74b5
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 0 additions and 37 deletions

View File

@ -1,37 +0,0 @@
import { supportedKeys } from "@libp2p/crypto/keys";
import { peerIdFromKeys } from "@libp2p/peer-id";
import { expect } from "chai";
import {
createPeerIdFromKeypair,
generateKeypair,
KeypairType,
Secp256k1Keypair,
} from "./index";
describe("createPeerIdFromKeypair", function () {
it("should properly create a PeerId from a secp256k1 keypair with private key", async function () {
const keypair = await generateKeypair(KeypairType.secp256k1);
const expectedPeerId = await peerIdFromKeys(
keypair.publicKey,
keypair.privateKey
);
const actualPeerId = await createPeerIdFromKeypair(keypair);
expect(actualPeerId).to.be.deep.equal(expectedPeerId);
});
it("should properly create a PeerId from a secp256k1 keypair without private key", async function () {
const keypair = await generateKeypair(KeypairType.secp256k1);
delete (keypair as Secp256k1Keypair)._privateKey;
const pubKey = new supportedKeys.secp256k1.Secp256k1PublicKey(
keypair.publicKey
);
const expectedPeerId = await peerIdFromKeys(pubKey.bytes);
const actualPeerId = await createPeerIdFromKeypair(keypair);
expect(actualPeerId).to.be.deep.equal(expectedPeerId);
});
});