diff --git a/CHANGELOG.md b/CHANGELOG.md index cda0890d..3ea25c83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [1.0.2] - 2019-09-16 + +### Fixed + +- api/modules/Event.getEventsByAddress, addressData + ## [1.0.1] - 2019-09-11 ## Changed diff --git a/dist/api/modules/Event.js b/dist/api/modules/Event.js index 88331331..2f76f98c 100644 --- a/dist/api/modules/Event.js +++ b/dist/api/modules/Event.js @@ -2,7 +2,7 @@ class Event extends _DataCollector.DataCollectorItem { constructor(collections, key) { // const sortable = { timestamp: -1 } - const { Events, Addrs } = collections; + const { Events } = collections; super(Events, key); this.publicActions = { /** @@ -108,14 +108,16 @@ class Event extends _DataCollector.DataCollectorItem { if (res.data) { let addresses = new Set(res.data.map(d => d.address)); addresses = [...addresses.values()]; - - let addrData = await Addrs.find({ address: { $in: addresses } }); - let { data } = addrData; - if (data) { - res.data = res.data.map(d => { - d._addressData = data.find(a => a.address === d.address); - return d; - }); + let AddressModule = this.parent.getModule('Address'); + if (AddressModule) { + let addrData = await AddressModule.find({ address: { $in: addresses } }); + let { data } = addrData; + if (data) { + res.data = res.data.map(d => { + d._addressData = data.find(a => a.address === d.address); + return d; + }); + } } } return res; diff --git a/dist/api/modules/Token.js b/dist/api/modules/Token.js index 47d33236..d7e0706f 100644 --- a/dist/api/modules/Token.js +++ b/dist/api/modules/Token.js @@ -3,7 +3,7 @@ var _utils = require("../../lib/utils"); var _bignumber = require("bignumber.js"); class Token extends _DataCollector.DataCollectorItem { - constructor({ TokensAddrs, Addrs }, key) { + constructor({ TokensAddrs }, key) { super(TokensAddrs, key); this.publicActions = { /** diff --git a/package-lock.json b/package-lock.json index d9b11114..53f18aff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "rsk-explorer-api", - "version": "1.0.1", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 457c0bea..53716878 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rsk-explorer-api", - "version": "1.0.1", + "version": "1.0.2", "description": "", "main": "index.js", "scripts": { diff --git a/public/swagger.json b/public/swagger.json index 3124e431..eebd8dd4 100644 --- a/public/swagger.json +++ b/public/swagger.json @@ -1,7 +1,7 @@ { "info": { "title": "rsk-explorer-api", - "version": "1.0.1", + "version": "1.0.2", "description": "explorer API Documentation" }, "swagger": "2.0",