Skip to content

Commit

Permalink
feat: check equality properly
Browse files Browse the repository at this point in the history
  • Loading branch information
monitz87 committed Mar 24, 2020
1 parent 1bec7fa commit 5aa65ea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/api/entities/SecurityToken/Documents.ts
Expand Up @@ -9,7 +9,9 @@ import { SecurityToken } from './';
*/
export class Documents extends Namespace<SecurityToken> {
/**
* Assign a new list of documents to the Security Token. This replaces the existing list of documents with the one passed in the parameters
* Assign a new list of documents to the Security Token by replacing the existing list of documents with the one passed in the parameters
*
* This requires two transactions
*
* @param args.documents - new list of documents
*/
Expand Down
1 change: 1 addition & 0 deletions src/api/entities/SecurityToken/index.ts
Expand Up @@ -50,6 +50,7 @@ export class SecurityToken extends Entity<UniqueIdentifiers> {
public ticker: string;

// Namespaces

public documents: Documents;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/api/procedures/setTokenDocuments.ts
Expand Up @@ -52,7 +52,7 @@ export async function prepareSetTokenDocuments(

if (
!differenceWith(currentDocs, rawDocuments, comparator).length &&
!differenceWith(rawDocuments, currentDocs, comparator).length
currentDocs.length === rawDocuments.length
) {
throw new PolymeshError({
code: ErrorCode.ValidationError,
Expand Down

0 comments on commit 5aa65ea

Please sign in to comment.