11import { faker } from "@faker-js/faker" ;
2+ import { generate32BytesPrivateKeyBuffer , keccak256 } from "@toruslabs/common-lib" ;
23import { TORUS_LEGACY_NETWORK , TORUS_SAPPHIRE_NETWORK } from "@toruslabs/constants" ;
34import { NodeDetailManager } from "@toruslabs/fetch-node-details" ;
45import BN from "bn.js" ;
56import { expect } from "chai" ;
67import { ec as EC } from "elliptic" ;
78
8- import { generatePrivateKey , keccak256 } from "../src" ;
99import TorusUtils from "../src/torus" ;
1010import { 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