This repository was archived by the owner on Apr 13, 2022. It is now read-only.
Pull Request for Generic Boxes Issue #23#25
Open
zihehuang wants to merge 2 commits intohyperledger-labs:mainfrom
Open
Pull Request for Generic Boxes Issue #23#25zihehuang wants to merge 2 commits intohyperledger-labs:mainfrom
zihehuang wants to merge 2 commits intohyperledger-labs:mainfrom
Conversation
Open
| */ | ||
| trait Box[P <: Proposition] extends BytesSerializable { | ||
| val value: Box.Amount | ||
| trait Box[P <: Proposition, T] extends BytesSerializable { |
Contributor
There was a problem hiding this comment.
What if, instead of making Box more generic by changing the type of value from long to T and carrying T around as a type parameter, we made Box more generic simply by removing value entirely? It would be up to subclasses of Box to have fields that contain content (e.g. values or anything else one might want to add to the box).
@kushti @catena2w @zihehuang , what do you think?
There was a problem hiding this comment.
I know this is a bit old, but that could likely work just fine based on our discussion for #23 . @zihehuang probably had the same mindset I did when we were working on this locally. It's then easy enough to create a parameterised ValueBox if you wanted that field, anyway.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request for Issue #23. I took the liberty of converting
Boxinto a generic type. I had to takevalidateout ofBoxMinimalStatesince the implementation requires theBox's value type to be aLong.