-
-
Notifications
You must be signed in to change notification settings - Fork 8
Add support for more transactions, emit events #271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
infiniteflower
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just had some small comments
mcmire
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, I suspect there are plans here for events, but I've seen similar events in TransactionController as those you're adding here, so I'm curious how we intend to use them? Thanks.
|
|
||
| Object.entries(data).forEach(([uuid, stxStatus]) => { | ||
| const transactionHash = stxStatus?.minedHash; | ||
| this.eventEmitter.emit(`${uuid}:status`, stxStatus); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where will this event be used if eventEmitter is private?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The extension is able to use it. It's an easy way to see what is going on with an STX status in Console. @matthewwalsh0 actually wrote most of the code in this PR and I suppose he added the events module usage into the TransactionController, so he might elaborate on intended use a bit more.
More about the events node module here: https://www.npmjs.com/package/events
src/SmartTransactionsController.ts
Outdated
|
|
||
| private trackMetaMetricsEvent: any; | ||
|
|
||
| private eventEmitter: any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we give this property a type? Perhaps:
| private eventEmitter: any; | |
| private eventEmitter: EventEmitter; |
Description
This PR does 2 things:
Testing