Conversation
3a0b46f to
a7e9925
Compare
a7e9925 to
e38738c
Compare
6d3b05d to
dd186b0
Compare
|
This is now "rebased", and properly supporting the no-iterator feature. |
ethanfrey
left a comment
There was a problem hiding this comment.
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.
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
rangeand promotingrange_deas the standard case (I would almost be in favor of just renaming them now and break everything once...range->range_rawandrange_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_detypes to "Map-like" structs (Indexed, Snapshot) - Simplify usage in many contracts where we use
rangeand 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 |
ethanfrey
left a comment
There was a problem hiding this comment.
looks good.
let's merge
| Some(StdError::GenericErr { .. }) | ||
| )); | ||
|
|
||
| // More bytes fails too |
ethanfrey
left a comment
There was a problem hiding this comment.
Another approval in case the last one was marked as stale
Closes #198.
First (working) attempt at deserializing range result keys.
TODO:
rangeandPrefixfunctionality. Perhapsrange_de,PrefixDe?Pair2. Perhaps consolidatingPair2andPairinto 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).Prefix2into its own module? ConsolidatePrefixandPrefix2(defaultK = Vec<u8>) (Follow-up PR Prefix consolidation #439)?keys()deserialization (keys_de).range_defor the other iterables (IndexedMap,IndexedSnapshotMap, and the indexes). (Addrange_detoMap-like structs #461)prefix_dedeserialization (i.e. suffixes deserialization) work. (Follow-up PR Workingprefix_de#434).serde's approach here). (Add non-ownedrange_de#463)Deserializablefor other types.