-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[cdac] Read/store globals from contract descriptor #101450
Conversation
Tagging subscribers to this area: @tommcdon |
value = pointerData[value].Value; | ||
} | ||
|
||
globals[name] = (value, global.Type); |
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.
This is just using the (optional) type string for now. I expect we'll do some mapping that isn't just string-based once we also read in the types.
a6c9402
to
03ab101
Compare
Co-authored-by: Aaron Robinson <[email protected]>
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.
Mostly LGTM
- I'm not sure we want to do global type validation on every read. But it doesn't seem like we have enough info to know if there's a better place to do it in contracts. ok for now.
- nit: I like validation methods in unit tests to include the name of the failing test (and possibly line info) of the actual test, not just the validation method, right in the message, not only in the stack trace
Co-authored-by: Aaron Robinson <[email protected]>
- Map indirect global values to corresponding values in `pointer_data` array from contract descriptor - Add `[Try]Read<T>`, `[Try]ReadPointer`, `[Try]ReadGlobal<T>` and `[Try]ReadGlobalPointer` to `Target` - Make cDAC implementation of `ISOSDacInterface9.GetBreakingChangeVersion` read value from globals - Create test helpers for mocking out reading from the target and providing a contract descriptor for different bitness/endianness - Add unit tests for reading global values (direct and indirect)
- Map indirect global values to corresponding values in `pointer_data` array from contract descriptor - Add `[Try]Read<T>`, `[Try]ReadPointer`, `[Try]ReadGlobal<T>` and `[Try]ReadGlobalPointer` to `Target` - Make cDAC implementation of `ISOSDacInterface9.GetBreakingChangeVersion` read value from globals - Create test helpers for mocking out reading from the target and providing a contract descriptor for different bitness/endianness - Add unit tests for reading global values (direct and indirect)
pointer_data
array from contract descriptor[Try]Read<T>
,[Try]ReadPointer
,[Try]ReadGlobal<T>
and[Try]ReadGlobalPointer
toTarget
ISOSDacInterface9.GetBreakingChangeVersion
read value from globalsContributes to #99298