Skip to content

Commit

Permalink
fix: imrpove code and fix tedt
Browse files Browse the repository at this point in the history
  • Loading branch information
shuffledex committed Jun 26, 2020
1 parent 9ac5289 commit b75d02a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/api/entities/SecurityToken/TokenHolders.ts
Expand Up @@ -49,7 +49,7 @@ export class TokenHolders extends Namespace<SecurityToken> {

const securityToken = new SecurityToken({ ticker }, context);

const areFrozen = opts?.mintStatus ? await securityToken.transfers.areFrozen() : true;
const areFrozen = opts?.mintStatus ? await securityToken.transfers.areFrozen() : undefined;

if (opts?.mintStatus && !areFrozen) {
const entriesChunks = chunk(entries, 10);
Expand Down Expand Up @@ -86,7 +86,7 @@ export class TokenHolders extends Namespace<SecurityToken> {
),
balance: balanceToBigNumber(balance),
};
if (opts && opts.mintStatus && areFrozen) {
if (opts?.mintStatus) {
return { ...entrie, canMint: false };
}
return entrie;
Expand Down
22 changes: 0 additions & 22 deletions src/api/entities/SecurityToken/__tests__/TokenHolders.ts
Expand Up @@ -112,17 +112,6 @@ describe('TokenHolders class', () => {
test('should retrieve all the token holders with balance and mint status in false', async () => {
dsMockUtils.createQueryStub('asset', 'balanceOf');

const fakeData = [
{
identity: 'someIdentity',
value: 1000,
},
{
identity: 'otherIdentity',
value: 2000,
},
];

const expectedHolders: IdentityBalance[] = [];

entityMockUtils.configureMocks({
Expand Down Expand Up @@ -167,17 +156,6 @@ describe('TokenHolders class', () => {
test('should retrieve all the token holders with balance and canMint attribute setting in true', async () => {
dsMockUtils.createQueryStub('asset', 'balanceOf');

const fakeData = [
{
identity: 'someIdentity',
value: 1000,
},
{
identity: 'otherIdentity',
value: 2000,
},
];

const expectedHolders: IdentityBalance[] = [];

entityMockUtils.configureMocks({
Expand Down

0 comments on commit b75d02a

Please sign in to comment.