-
Notifications
You must be signed in to change notification settings - Fork 30
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
Unexpected behavior for nested tuple keys #59
Comments
This was fixed in #34 and #36 already on main, but not released yet because the fix contains a breaking change to the cw-storage-plus = { git = "https://github.com/CosmWasm/cw-storage-plus.git", rev = "cc67d423d1dc0dd5f7eeec6da26d7f0268388fd0" } That will give you the current latest version from main. |
Ah interesting! That sadly won't work for us as we want to publish our crates. We just swapped the tuple order so our nested key is the last element of the tuple. Looking forward to 2.0 :) Edit: Would have been helpful to add a warning to in the doc-comment of the implementation to warn users of the issue. Would have saved me from spending time on it. |
done in #65 |
for those who will search, it gave me error about slice / array covert |
Tuples that contain objects that themselves are composite objects cause issues during deserialization.
Example
Let's say we have a map like below:
Great, now we can use
(String, u16), String)
as a key. An example value:Now there's a test-case that fails:
The resulting error is:
This error is a result of the deserialization attempt of
((X,Y),Z)
.The raw key that's attempted to deserialize (like showed above) is:
In the deserialization logic the first element is assumed to be length-prefixed with the length for the complete element T where T is (X,Y).
We ran into this issue with a custom struct as part of a tuple key. So any tuple value T that has a
Vec<Key>
length != 1 is effected.The text was updated successfully, but these errors were encountered: