-
Notifications
You must be signed in to change notification settings - Fork 355
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
Full deserialization for range
#432
Conversation
3a0b46f
to
a7e9925
Compare
a7e9925
to
e38738c
Compare
6d3b05d
to
dd186b0
Compare
This is now "rebased", and properly supporting the no-iterator feature. |
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.
Seems like a good implementation.
I would prefer improved names and some other details, but I think you have a few PRs coming on top that will fix that. Approving for merge, with the condition these comments are addressed in a future PR.
Please take a look at #446 I think using I know the crux of your PR is to add more deserialisation (of K), but I think while doing some of you work, and removing EmptyPrefix, you went more in the direction of people just manually appending prefixes. |
dd186b0
to
4b46661
Compare
4b46661
to
ee58948
Compare
Prefix consolidation
Is this ready for a deep review? |
I think so, yes. |
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.
This is a big one!
First, I like the type changes - both KeyDeserializer (nicer naming) and the additions to PrimaryKey.
I also like the addition of key information to Prefix.
Added some cleanup comments, and maybe some redundancy can be removed, but I think just one pass with some polish and this can be merged.
I think there is more than can be done to enhance it (in other PRs).
- properly handling
prefix_range_de
- deprecating
range
and promotingrange_de
as the standard case (I would almost be in favor of just renaming them now and break everything once...range
->range_raw
andrange_de
->range
. - replace
KeyDeserializer::from_slice(&[u8])
withKeyDeserializer::from_vec(Vec<u8>)
. When we call it, we can consume the Vec and save a clone. See deserialize_kv - Add
range_de
types to "Map-like" structs (Indexed, Snapshot) - Simplify usage in many contracts where we use
range
and custom parsing (but could now userange_de
)
No need to handle that in this PR. Tackle what you can and make an issue for the items you will put into other PRs.
I would love to do that renaming. Let's do it in a follow-up, just to better handle the breaking change. (#460).
Will do in a follow-up. (#464)
Another follow-up. (#461)
For sure. I would do this as part of the breaking change from
Good review, thanks. |
Will add unit tests for key deserialization, and I think then we can merge this. |
Sounds good. If you can get a 🟢 from the CI, I'm happy to merge it. Let's do this and
And update to final cosmwasm release. Then we can cut a v0.10.0 |
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.
looks good.
let's merge
Some(StdError::GenericErr { .. }) | ||
)); | ||
|
||
// More bytes fails too |
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.
nice
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.
Another approval in case the last one was marked as stale
Closes #198.
First (working) attempt at deserializing range result keys.
TODO:
range
andPrefix
functionality. Perhapsrange_de
,PrefixDe
?Pair2
. Perhaps consolidatingPair2
andPair
into one (with default args for both key and value). (See Make Pair more extensible cosmwasm#1101)deserialize_kv
- >deserialize_v
, anddeserialize2_kv
->deserialize_kv
.Deserializable
. PerhapsDeserializeOwned
(although confusing withserde
).Prefix2
into its own module? ConsolidatePrefix
andPrefix2
(defaultK = Vec<u8>
) (Follow-up PR Prefix consolidation #439)?keys()
deserialization (keys_de
).range_de
for the other iterables (IndexedMap
,IndexedSnapshotMap
, and the indexes). (Addrange_de
toMap
-like structs #461)prefix_de
deserialization (i.e. suffixes deserialization) work. (Follow-up PR Workingprefix_de
#434).serde
's approach here). (Add non-ownedrange_de
#463)Deserializable
for other types.