Skip to content

Commit

Permalink
fix: feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
shuffledex committed Jun 23, 2020
1 parent 0c2189f commit c4cce2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/Polymesh.ts
Expand Up @@ -257,11 +257,10 @@ export class Polymesh {
}

/**
* Check if a ticker is available
* Check if a ticker hasn't been reserved
*/
public async isTickerAvailable(args: { ticker: string }): Promise<boolean> {
const { ticker } = args;
const reservation = new TickerReservation({ ticker }, this.context);
const reservation = new TickerReservation(args, this.context);
const { status } = await reservation.details();

return status === TickerReservationStatus.Free;
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/Polymesh.ts
Expand Up @@ -320,7 +320,7 @@ describe('Polymesh Class', () => {

describe('method: isTickerAvailable', () => {
beforeAll(() => {
entityMockUtils.initMocks({ identityOptions: { did: 'someOtherDid' } });
entityMockUtils.initMocks();
});

afterEach(() => {
Expand Down Expand Up @@ -348,7 +348,7 @@ describe('Polymesh Class', () => {
expect(isTickerAvailable).toBeTruthy();
});

test('should return true if ticker is available to reserve it', async () => {
test('should return false if ticker is available to reserve it', async () => {
entityMockUtils.getTickerReservationDetailsStub().resolves({
owner: entityMockUtils.getIdentityInstance(),
expiryDate: new Date(),
Expand Down

0 comments on commit c4cce2f

Please sign in to comment.