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
Added Stack storage. #786
Added Stack storage. #786
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.
Okay, good start, thanks. I think it's still a bit too complicated becasue the type has too many features. Ideally it just does this: https://en.wikipedia.org/wiki/Stack_(abstract_data_type)#/media/File:Lifo_stack.svg, maybe plus len/is_empty/clear methods. But no change or access of data on the middle. That would be an array or linked list implementation, which is a different story.
Can you also check how the Map
type works in this repo? It can be used in const places and is just a configuration how to access the contract storage. I think we should do the same here too.
Nice job including all the tests. I don't fully understand the use case for |
Suffix does what Key() does in Map. Creates new Path |
I'm wondering if it wouldn't make more sense to
That way the new types have clearer purposes and the use case of "one value defined as a constant to manage multiple stacks" is still achieved. With the current |
That could be done as well. Right now, you can have or not have a suffix, it's your choice. I'll be happy to do it using Map's way. Just making sure that everyone is on board with the idea, and then I'll do a coding sprint in the coming days. Just keep on adding any other suggestions and ideas as well. |
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.
I really like the tests.
Please update README with examples and CHANGELOG.
There are plenty of small stuff to go through - please make sure spacing between methods is one line. Currently sometimes there is none.
Co-authored-by: Jakub Bogucki <software-solutions@tuta.io>
Co-authored-by: Jakub Bogucki <software-solutions@tuta.io>
Hey @itsHaseebSaeed! Are you still working on this? |
@uint funnily enough, I just added this to my weekly to-do list just today. It's will be done max by Friday then I'll start working on deque store |
Awesome! No hurry, just wanted to check in. LMK if you need help! |
Hey, @itsHaseebSaeed! We currently have both a need for this functionality and the resources to develop this in-house. Additionally, we might have some ideas around how to make a "map of stacks" functionality better fit our current system. Rather than spam you with change requests, we'd like to take over the implementation. Thank you for your contribution! |
Closing in favor of #807 |
As discussed here. Added stack implementation to storage-plus