File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export default class Identity {
20
20
* Initializes the class attributes based on the parameters.
21
21
* @param privateKey The secret value used to generate an EdDSA public key.
22
22
*/
23
- constructor ( privateKey : BigNumberish = randomBytes ( 32 ) ) {
23
+ constructor ( privateKey : BigNumberish = BigInt ( `0x ${ randomBytes ( 32 ) . toString ( "hex" ) } ` ) . toString ( ) ) {
24
24
this . _privateKey = privateKey
25
25
this . _secretScalar = deriveSecretScalar ( privateKey )
26
26
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ describe("Identity", () => {
7
7
it ( "Should create a random identity" , ( ) => {
8
8
const identity = new Identity ( )
9
9
10
- expect ( Buffer . isBuffer ( identity . privateKey ) ) . toBeTruthy ( )
10
+ expect ( typeof identity . privateKey ) . toBe ( "string" )
11
11
expect ( typeof identity . secretScalar ) . toBe ( "string" )
12
12
expect ( identity . publicKey ) . toHaveLength ( 2 )
13
13
expect ( typeof identity . commitment ) . toBe ( "string" )
You can’t perform that action at this time.
0 commit comments