Skip to content

Commit

Permalink
Include more in the event handler status
Browse files Browse the repository at this point in the history
  • Loading branch information
platfowner committed Aug 8, 2024
1 parent c5f7178 commit 109292a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
20 changes: 12 additions & 8 deletions event-handler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,24 @@ class EventHandler {
getEventHandlerStatus() {
return {
isEnabled: true,
maxNumEventChannels: NodeConfigs.MAX_NUM_EVENT_CHANNELS,
numEventChannels: this.eventChannelManager.getNumEventChannels(),
maxNumEventFilters: NodeConfigs.MAX_NUM_EVENT_FILTERS,
numEventFilters: this.getNumEventFilters(),
networkInfo: this.eventChannelManager.getNetworkInfo(),
filterInfo: this.getFilterInfo(),
channelInfo: this.eventChannelManager.getChannelInfo(),
};
}

static getDefaultEventHandlerStatus() {
return {
isEnabled: false,
maxNumEventChannels: NodeConfigs.MAX_NUM_EVENT_CHANNELS,
numEventChannels: 0,
maxNumEventFilters: NodeConfigs.MAX_NUM_EVENT_FILTERS,
numEventFilters: 0,
networkInfo: {
url: "",
maxNumEventChannels: NodeConfigs.MAX_NUM_EVENT_CHANNELS,
numEventChannels: 0,
maxNumEventFilters: NodeConfigs.MAX_NUM_EVENT_FILTERS,
numEventFilters: 0,
},
filterInfo: {},
channelInfo: {},
};
}

Expand Down
15 changes: 11 additions & 4 deletions test/unit/p2p.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,17 @@ describe("P2p", () => {
},
eventHandlerStatus: {
isEnabled: false,
maxNumEventChannels: 10,
maxNumEventFilters: 20,
numEventChannels: 0,
numEventFilters: 0,
networkInfo: {
url: "",
maxNumEventChannels: 10,
numEventChannels: 0,
maxNumEventFilters: 20,
numEventFilters: 0,
},
filterInfo: {
},
channelInfo: {
},
}
});
});
Expand Down

0 comments on commit 109292a

Please sign in to comment.