CryptKeeperZK/crypt-keeper-extension

Rename function names in `Identity` service

0xisk opened this issue · 0 comments

0xisk commented
          Lets remove unneeded Identity from names, just `insert`.
  private insert = async (newIdentity: ZkIdentitySemaphore, urlOrigin?: string): Promise<boolean> => {

The same goes for loadIdentities, createIdentity, createIdentityRequest, deleteIdentity, deleteAllIdentities

  private load = async () => {
  
create = async ({
    walletType,
    messageSignature,
    isDeterministic,
    groups,
    urlOrigin,
    options,
  }: INewIdentityRequest): Promise<string | undefined> => {
  
  createRequest = async ({ urlOrigin }: ICreateIdentityRequestArgs): Promise<void> => {
    await this.browserController.openPopup({ params: { redirect: Paths.CREATE_IDENTITY, urlOrigin } });
  };
  
    delete = async ({ identityCommitment }: IDeleteIdentityArgs): Promise<IDeleteIdentityArgs> => {
    
     deleteAll = async (): Promise<boolean> => {

For this one: writeIdentities could be renamed into save

private save = async (identities: Map<string, string>): Promise<void> => {
    const serializedIdentities = JSON.stringify(Array.from(identities.entries()));
    const ciphertext = this.cryptoService.encrypt(serializedIdentities, { mode: ECryptMode.MNEMONIC });
    await this.identitiesStore.set(ciphertext);
  };

Originally posted by @0xisk in #1102 (comment)