@@ -15,7 +15,7 @@ import {
1515 wipeKeys ,
1616 wipeSyncServerSessionToken ,
1717} from '../../src/identity/auth-storage.js' ;
18- import { createIdentity } from '../../src/identity/create-identity.js' ;
18+ import { createIdentityKeys } from '../../src/identity/create-identity-keys .js' ;
1919import { decryptIdentity , encryptIdentity } from '../../src/identity/identity-encryption.js' ;
2020import { proveIdentityOwnership , verifyIdentityOwnership } from '../../src/identity/prove-ownership.js' ;
2121import type { Signer } from '../../src/identity/types.js' ;
@@ -48,7 +48,7 @@ const accountSigner = (account: PrivateKeyAccount): Signer => {
4848
4949describe ( 'createIdentity' , ( ) => {
5050 it ( 'should generate an identity with signing and encryption keys' , ( ) => {
51- const id = createIdentity ( ) ;
51+ const id = createIdentityKeys ( ) ;
5252 expect ( id ) . toBeDefined ( ) ;
5353 expect ( id . encryptionPublicKey ) . toBeDefined ( ) ;
5454 expect ( id . encryptionPrivateKey ) . toBeDefined ( ) ;
@@ -60,7 +60,7 @@ describe('createIdentity', () => {
6060 } ) ;
6161 it ( 'should generate an encryption keys able to encrypt and decrypt' , ( ) => {
6262 // Check that we can use the encryption keypair to encrypt and decrypt
63- const id = createIdentity ( ) ;
63+ const id = createIdentityKeys ( ) ;
6464 const nonce = randomBytes ( 24 ) ;
6565 const message = new TextEncoder ( ) . encode ( 'Hello, world!' ) ;
6666
@@ -82,7 +82,7 @@ describe('createIdentity', () => {
8282 } ) ;
8383 it ( 'should generate a signature keys able to sign and verify' , ( ) => {
8484 // Check that we can use the signature keypair to sign and verify
85- const id = createIdentity ( ) ;
85+ const id = createIdentityKeys ( ) ;
8686 const message = new TextEncoder ( ) . encode ( 'Hello, world!' ) ;
8787 const sig = secp256k1 . sign ( message , hexToBytes ( id . signaturePrivateKey ) ) ;
8888 const valid = secp256k1 . verify ( sig , message , hexToBytes ( id . signaturePublicKey ) ) ;
@@ -97,7 +97,7 @@ describe('identity encryption', () => {
9797 const account = privateKeyToAccount ( bytesToHex ( randomBytes ( 32 ) ) as Hex ) ;
9898 const signer = accountSigner ( account ) ;
9999 const accountId = await signer . getAddress ( ) ;
100- const keys = createIdentity ( ) ;
100+ const keys = createIdentityKeys ( ) ;
101101 const { ciphertext, nonce } = await encryptIdentity ( signer , accountId , keys ) ;
102102 const decrypted = await decryptIdentity ( signer , accountId , ciphertext , nonce ) ;
103103
@@ -119,7 +119,7 @@ describe('auth/identity storage', () => {
119119 } ) ;
120120 it ( 'stores, loads and wipes keys' , ( ) => {
121121 expect ( loadKeys ( storageMock , '0x1234' ) ) . toBeNull ( ) ;
122- const keys = createIdentity ( ) ;
122+ const keys = createIdentityKeys ( ) ;
123123 storeKeys ( storageMock , '0x1234' , keys ) ;
124124 expect ( loadKeys ( storageMock , '0x1234' ) ) . toEqual ( keys ) ;
125125 wipeKeys ( storageMock , '0x1234' ) ;
@@ -142,7 +142,7 @@ describe('identity ownership proofs', () => {
142142
143143 const signer = accountSigner ( account ) ;
144144 const accountId = await signer . getAddress ( ) ;
145- const keys = createIdentity ( ) ;
145+ const keys = createIdentityKeys ( ) ;
146146 const { accountProof, keyProof } = await proveIdentityOwnership ( signer , accountId , keys ) ;
147147
148148 const valid = await verifyIdentityOwnership ( accountId , keys . signaturePublicKey , accountProof , keyProof ) ;
@@ -153,14 +153,14 @@ describe('identity ownership proofs', () => {
153153 const account = privateKeyToAccount ( bytesToHex ( randomBytes ( 32 ) ) as Hex ) ;
154154 const signer = accountSigner ( account ) ;
155155 const accountId = await signer . getAddress ( ) ;
156- const keys = createIdentity ( ) ;
156+ const keys = createIdentityKeys ( ) ;
157157 const { accountProof, keyProof } = await proveIdentityOwnership ( signer , accountId , keys ) ;
158158
159159 // Create invalid proofs using a different account
160160 const account2 = privateKeyToAccount ( bytesToHex ( randomBytes ( 32 ) ) as Hex ) ;
161161 const signer2 = accountSigner ( account2 ) ;
162162 const accountId2 = await signer2 . getAddress ( ) ;
163- const keys2 = createIdentity ( ) ;
163+ const keys2 = createIdentityKeys ( ) ;
164164 const { accountProof : accountProof2 , keyProof : keyProof2 } = await proveIdentityOwnership (
165165 signer2 ,
166166 accountId2 ,
0 commit comments