-
Notifications
You must be signed in to change notification settings - Fork 462
feat: better introspection for encumbered magnitude #1038
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
feat: better introspection for encumbered magnitude #1038
Conversation
bc82389 to
03e41ea
Compare
03e41ea to
321ff35
Compare
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.
LGTM, one non-blocking nit. Would also be good to have a test confirming expected behavior of the view func
So it doesn't really look like it because the updates I made to tests were very small, but the updated unit tests actually do check that the new function behaves correctly. I was also planning to further dig into this in integration tests -- this version of getting encumbered magnitude makes integration test invariant/assertion writing much easier :) |
8sunyuan
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.
LGTM, the only code smell to me is how these view functions are implemented differently from the internal logic but thats been the case for a while. A bit late for a refactor.
* feat: better introspection for encumbered magnitude * chore: bindings * chore: fix comment and make bindings
* feat: better introspection for encumbered magnitude * chore: bindings * chore: fix comment and make bindings
* feat: better introspection for encumbered magnitude * chore: bindings * chore: fix comment and make bindings
* feat: better introspection for encumbered magnitude * chore: bindings * chore: fix comment and make bindings
* feat: better introspection for encumbered magnitude * chore: bindings * chore: fix comment and make bindings
* feat: better introspection for encumbered magnitude * chore: bindings * chore: fix comment and make bindings
* feat: better introspection for encumbered magnitude * chore: bindings * chore: fix comment and make bindings
* feat: better introspection for encumbered magnitude * chore: bindings * chore: fix comment and make bindings
* feat: better introspection for encumbered magnitude * chore: bindings * chore: fix comment and make bindings
* feat: better introspection for encumbered magnitude * chore: bindings * chore: fix comment and make bindings
* feat: better introspection for encumbered magnitude * chore: bindings * chore: fix comment and make bindings
* feat: better introspection for encumbered magnitude * chore: bindings * chore: fix comment and make bindings
* feat: better introspection for encumbered magnitude * chore: bindings * chore: fix comment and make bindings
* feat: better introspection for encumbered magnitude * chore: bindings * chore: fix comment and make bindings
* feat: better introspection for encumbered magnitude * chore: bindings * chore: fix comment and make bindings
Reasoning: current
encumberedMagnitudeis a public getter that returns the non-updated version of an operator's encumbered magnitude.When actually calling
modifyAllocations, we use the updated version -- so this is probably more relevant to expose.This PR makes the
encumberedMagnitudemappinginternal, and instead exposes a getter (getEncumberedMagnitude) that returns the current encumbered magnitude with completable deallocations included.