-
Notifications
You must be signed in to change notification settings - Fork 0
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
Luiz/KOKU-118 fold #45
Conversation
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.
- Please just move it to final version of futuresMarket.clar since it looks like almost complete part of "position updating" in the tech document description. And the rest of business logic will be based on this data structures. So lets start creating basement this way.
- Rename accordingly to data structures in our tech description instead of "a", "b" for example it will be get-position-size instead of get-a, get-position-holder instead of get-b, etc.
- Minor refactoring if possible, to introduce definition of data structure if possible separately, if language does allow it somehow. It is not complain about workability, the architecture is correct. It is rather about human readability and possible future refactoring (imagine what would happen if you want to introduce the 3rd field "c" in this data structure? you have to go through all the file to make it compilable). But as I said if language does not allow it somehow it is fine, because the data structure itself is correct.
That is currently not possible. Refer to stacks-network/stacks-core#1171 to see the progress of such a feature proposal. |
760d926
to
3b38afc
Compare
Yes, that is a good idea. Let me see if I got it clearly:
That is achievable as I have described. Is that the same you have proposed? |
This is implemented in commits ranging from 7e3018e to 8032337 |
position by index
instead of indices list to be updated. Saves storage and writing operation/gas fees
… block it was created
only should worry about position update and its public callers shoud be worried only about collecting fees and providing executor rewards
for updating positions
dependency DAG: sources on the top, sinks on the bottom, a contract must appear only after all of its dependencies.
getter function for retrieving the timestamp of the block in which a position was updated for the last time
cooldown inside position-maintenance. Also brings further adjustments to update-position
d60c5bc
to
6dbfa5c
Compare
This PR brings a contract illustrating a simple usage of fold over some indexed data stored as a map.
Unit tests are provided.