-
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
Asynchronous Oracle #1738
Asynchronous Oracle #1738
Conversation
Ready for review. @neo-project/core @neo-project/ngd-shanghai |
Co-authored-by: Shargon <shargon@gmail.com>
Co-authored-by: Shargon <shargon@gmail.com>
private void Finish(ApplicationEngine engine) | ||
{ | ||
Transaction tx = (Transaction)engine.ScriptContainer; | ||
OracleResponse response = tx.GetAttribute<OracleResponse>(); |
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.
OracleResponse response = tx.GetAttribute<OracleResponse>(); | |
OracleResponse response = tx.GetAttribute<OracleResponse>(); | |
if (response == null) throw new ArgumentException("Oracle response was not found"); |
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.
What's the difference? If response
is null
, it will throw exception in the next line because of response.Id
.
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.
Yes, it's not a fix, its for debugging purpose now that we have the fault exception it's good to provide the specific error.
Transaction tx = (Transaction)engine.ScriptContainer; | ||
OracleResponse response = tx.GetAttribute<OracleResponse>(); | ||
if (response == null) throw new ArgumentException("Oracle response was not found"); | ||
OracleRequest request = GetRequest(engine.Snapshot, response.Id); |
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.
OracleRequest request = GetRequest(engine.Snapshot, response.Id); | |
OracleRequest request = GetRequest(engine.Snapshot, response.Id); | |
if (request == null) throw new ArgumentException("Oracle request was not found"); |
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.
If request
is null
, it will throw exception in the next line because of request.UserData
.
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.
Yes, it's not a fix, its for debugging purpose now that we have the fault exception it's good to provide the specific error.
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.
My unique concern it's #1738 (comment) But we can move on !
No description provided.