Skip to content

Commit 9ea1ac0

Browse files
committed
test: update 'tssPubKeyUtils' and test
1 parent e78bf4f commit 9ea1ac0

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/helpers/tssPubKeyUtils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
// Note: Endpoints should be the sss node endpoints along with path
2-
import { Some } from "@toruslabs/common-lib";
2+
import { normalizeKeysResult, Some, thresholdSame } from "@toruslabs/common-lib";
33
import { JRPCResponse, KEY_TYPE } from "@toruslabs/constants";
44
import { generateJsonRPCObject, post } from "@toruslabs/http-helpers";
55
import log from "loglevel";
66

77
import { JRPC_METHODS } from "../constants";
88
import { GetORSetKeyResponse, KeyType } from "../interfaces";
9-
import { normalizeKeysResult, thresholdSame } from "./common";
109

1110
// for ex: [https://node-1.node.web3auth.io/sss/jrpc, https://node-2.node.web3auth.io/sss/jrpc ....]
1211
export const GetOrSetTssDKGPubKey = async (params: {

test/sapphire_devnet.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { faker } from "@faker-js/faker";
2+
import { generate32BytesPrivateKeyBuffer, keccak256 } from "@toruslabs/common-lib";
23
import { TORUS_LEGACY_NETWORK, TORUS_SAPPHIRE_NETWORK } from "@toruslabs/constants";
34
import { NodeDetailManager } from "@toruslabs/fetch-node-details";
45
import BN from "bn.js";
56
import { expect } from "chai";
67
import { ec as EC } from "elliptic";
78

8-
import { generatePrivateKey, keccak256 } from "../src";
99
import TorusUtils from "../src/torus";
1010
import { generateIdToken, getImportKeyParams, getRetrieveSharesParams, lookupVerifier } from "./helpers";
1111

@@ -587,7 +587,7 @@ describe("torus utils sapphire devnet", function () {
587587
const email = faker.internet.email();
588588
const token = generateIdToken(email, "ES256");
589589
const ec = new EC("secp256k1");
590-
const privKeyBuffer = generatePrivateKey(ec, Buffer);
590+
const privKeyBuffer = generate32BytesPrivateKeyBuffer(ec);
591591
const privHex = privKeyBuffer.toString("hex");
592592
const nodeDetails = await TORUS_NODE_MANAGER.getNodeDetails({ verifier: TORUS_TEST_VERIFIER, verifierId: email });
593593
const torusNodeEndpoints = nodeDetails.torusNodeSSSEndpoints;
@@ -604,7 +604,7 @@ describe("torus utils sapphire devnet", function () {
604604
);
605605
expect(result.finalKeyData.privKey).to.be.equal(privHex);
606606
const result1 = await torus.getPublicAddress(torusNodeEndpoints, nodeDetails.torusNodePub, { verifier: TORUS_TEST_VERIFIER, verifierId: email });
607-
expect(result1.finalKeyData.walletAddress).to.be.equal(result.finalKeyData.walletAddress);
607+
expect(result1.finalKeyData.walletAddress.toLowerCase()).to.be.equal(result.finalKeyData.walletAddress.toLowerCase());
608608
});
609609

610610
it("should fetch pub address of tss verifier id", async function () {

0 commit comments

Comments
 (0)