-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add oracle Request/Response event #2036
Conversation
I think you can get the responses from transactions. No notification is needed. https://github.com/neo-project/neo/blob/master/src/neo/Network/P2P/Payloads/OracleResponse.cs |
I think notification will be easy for users to record it, just extend the ApplicationLog plugin, since we have unified transaction types. |
After |
Co-authored-by: Erik Zhang <erik@neo.org>
Co-authored-by: Erik Zhang <erik@neo.org>
@@ -161,6 +208,8 @@ private void Request(ApplicationEngine engine, string url, string filter, string | |||
if (list.Count >= 256) | |||
throw new InvalidOperationException("There are too many pending responses for this url"); | |||
list.Add(id); | |||
|
|||
engine.SendNotification(Hash, "Request", new VM.Types.Array { id, url, filter }); |
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.
Maybe this event's can be done by the project.
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.
?
Co-authored-by: Erik Zhang <erik@neo.org>
* add event * add Request event * move Reponse into Finish method * format * optimize * Update src/neo/SmartContract/Native/Oracle/OracleContract.cs Co-authored-by: Erik Zhang <erik@neo.org> * Update src/neo/SmartContract/Native/Oracle/OracleContract.cs Co-authored-by: Erik Zhang <erik@neo.org> * fix * apply erik's feedback * add RequestContract * Update src/neo/SmartContract/Native/Oracle/OracleContract.cs Co-authored-by: Erik Zhang <erik@neo.org> Co-authored-by: Tommo-L <luchuan@neo.org> Co-authored-by: Erik Zhang <erik@neo.org> Co-authored-by: Shargon <shargon@gmail.com>
* add event * add Request event * move Reponse into Finish method * format * optimize * Update src/neo/SmartContract/Native/Oracle/OracleContract.cs Co-authored-by: Erik Zhang <erik@neo.org> * Update src/neo/SmartContract/Native/Oracle/OracleContract.cs Co-authored-by: Erik Zhang <erik@neo.org> * fix * apply erik's feedback * add RequestContract * Update src/neo/SmartContract/Native/Oracle/OracleContract.cs Co-authored-by: Erik Zhang <erik@neo.org> Co-authored-by: Tommo-L <luchuan@neo.org> Co-authored-by: Erik Zhang <erik@neo.org> Co-authored-by: Shargon <shargon@gmail.com>
User need some way to query the oracle response tx.