fix: getting from value and adding 'track' to events

This commit is contained in:
Richard Ramos 2020-01-22 15:36:42 -04:00
parent f821569301
commit 4c2d4e5b26
1 changed files with 2 additions and 1 deletions

View File

@ -81,7 +81,7 @@ export default class Subspace {
if (!from) {
setTimeout(async () => {
const accounts = await web3.eth.getAccounts();
const accounts = await this.web3.getAccounts();
SubspaceContract.options.from = accounts[0];
}, 100);
}
@ -91,6 +91,7 @@ export default class Subspace {
}
Object.keys(SubspaceContract.events).forEach(ev => {
if(!SubspaceContract.options.jsonInterface.find(x => x.type === 'event' && x.name == ev)) return;
SubspaceContract.events[ev].track = (filterConditionsOrCb) => this.trackEvent(SubspaceContract, ev, filterConditionsOrCb);
});