Skip to content

Commit

Permalink
Merge pull request #191 from ainblockchain/release/v1.10.2
Browse files Browse the repository at this point in the history
Upgrade version to 1.10.2
  • Loading branch information
platfowner committed Jun 12, 2024
2 parents 4924cf6 + cf1c440 commit b82320c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions __tests__/event_manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ describe('Event Handler', function() {
ain.em.disconnect();
});

describe('Channel connection', () => {
it('isConnected()', () => {
expect(ain.em.isConnected()).toBe(true);
});
});

describe('BLOCK_FINALIZED', () => {
it('Subscribe to BLOCK_FINALIZED', (done) => {
eventFilterId = ain.em.subscribe('BLOCK_FINALIZED', {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ainblockchain/ain-js",
"version": "1.10.1",
"version": "1.10.2",
"description": "",
"main": "lib/ain.js",
"scripts": {
Expand Down
7 changes: 7 additions & 0 deletions src/event-manager/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ export default class EventManager {
this._eventChannelClient = new EventChannelClient(ain, this._eventCallbackManager);
}

/**
* Returns whether the client in connection.
*/
isConnected(): boolean {
return this._eventChannelClient.isConnected;
}

/**
* Opens a new event channel.
* @param {DisconnectionCallback} disconnectionCallback The disconnection callback function.
Expand Down

0 comments on commit b82320c

Please sign in to comment.