Skip to content

Commit

Permalink
feat(identity): move all CurrentIdentity functionality to Identity
Browse files Browse the repository at this point in the history
The CurrentIdentity entity no longer exists

BREAKING CHANGE: Remove the `CurrentIdentity` entity and move all of its functionality to the
`Identity` entity
  • Loading branch information
monitz87 committed Aug 13, 2021
1 parent 1cf2a78 commit 7f73017
Show file tree
Hide file tree
Showing 21 changed files with 626 additions and 655 deletions.
3 changes: 1 addition & 2 deletions src/Polymesh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import { Settlements } from '~/Settlements';
import {
AccountBalance,
CommonKeyring,
CurrentIdentity,
ErrorCode,
MiddlewareConfig,
NetworkProperties,
Expand Down Expand Up @@ -448,7 +447,7 @@ export class Polymesh {
/**
* Retrieve the Identity associated to the current Account (null if there is none)
*/
public getCurrentIdentity(): Promise<CurrentIdentity | null> {
public getCurrentIdentity(): Promise<Identity | null> {
return this.context.getCurrentAccount().getIdentity();
}

Expand Down
6 changes: 3 additions & 3 deletions src/api/entities/CurrentAccount.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { UniqueIdentifiers } from '~/api/entities/Account';
import { Account, Context, CurrentIdentity, leaveIdentity } from '~/internal';
import { Account, Context, Identity, leaveIdentity } from '~/internal';
import { ProcedureMethod } from '~/types';
import { createProcedureMethod } from '~/utils/internal';

Expand Down Expand Up @@ -27,9 +27,9 @@ export class CurrentAccount extends Account {
/**
* Retrieve the current Identity (null if there is none)
*/
public async getIdentity(): Promise<CurrentIdentity | null> {
public async getIdentity(): Promise<Identity | null> {
const identity = await super.getIdentity();

return identity && new CurrentIdentity({ did: identity.did }, this.context);
return identity && new Identity({ did: identity.did }, this.context);
}
}
116 changes: 0 additions & 116 deletions src/api/entities/CurrentIdentity.ts

This file was deleted.

0 comments on commit 7f73017

Please sign in to comment.