-
Notifications
You must be signed in to change notification settings - Fork 217
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
Factor out pure balanceTransaction logic #2970
Conversation
7ab1661
to
60e2fe8
Compare
Thanks @jonathanknowles, grouping arguments in records probably makes sense. My strategy so far was to make minimal changes and not do any premature abstractions, but I'll have a look. But I might try experimenting with writing actual property tests on top of this first, in case I learn something. |
87c3403
to
d89025c
Compare
b192331
to
73b91f7
Compare
07e0289
to
b3aca28
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.
Hi @Anviking
This PR seems like a very positive step towards making balanceTransaction
more testable. Thank-you for making it! 👍🏻
I only have a few suggestions and requests: some of these apply to code that was moved (and therefore not "changed" by this PR per se), but I think it would still be good to clean up the highlighted areas before merging.
…workLayer Passing the full NetworkLayer seems overkill, and would have required less elegant mocking to property test balanceTransaction (calling selectAssets).
Possible by adding the following function: ``` snapshot :: TimeInterpreter (ExceptT PastHorizonException IO) -> IO (TimeInterpreter (Either PastHorizonException)) ```
Which can be more easily property tested.
513e722
to
c022012
Compare
Co-authored-by: Jonathan Knowles <[email protected]>
In response to: #2970 (comment)
c022012
to
eb00f06
Compare
Thanks @jonathanknowles — I believe I have addressed all suggestions except for #2970 (comment) which I think is invalid and #2970 (comment) which I'd be inclined not to do. |
Given it a good read over. This seems sensible 👍 I'm a bit dubious on the padding and estimation, but I guess we'll catch anything off in our property tests. |
I'm very dubious too 😅 I wouldn't want to start changing it before having property tests, however. |
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.
Hi @Anviking
Many thanks again for making this PR. It looks good to me!
bors r+ |
Build succeeded: |
Motivation
Make property testing of the
balanceTransaction
logic possible.Overview
m
toHasLogger
constraint rather than to assume IOMonadRandom m
rather than IOMonadRandom m
Issue Number
ADP-1182