-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
the doublemap value allways return 0 or null #2007
Comments
but why my struct value allways uncorrect? Vec cause ? |
So what is Vec in this case? That is not a valid Rust type unless an alias. (You need type info for a vector) |
i use u8 in vec |
i am sure that vec <u8> be used for the second key in doublemap, the value can't show correctly in Chain state. there are my code https://github.com/TransactionX/TransX/blob/master/bin/node/runtime/src/register.rs. |
when use 'TokenInfo: double_map T::AccountId, blake2_256(u32) => Vec<u8>;' replace 'TokenInfo: double_map T::AccountId, blake2_256(Vec<u8>) => Vec<u8>;' , it show correctly value. |
So my confusion was around this above - So in all cases the variable-length items are encoded (in SCALE), with a length prefix. It could very well be that for storage keys one side does not apply it with the prefix, so could be missing in the API or on the node side. (I(n which case items suck as Since this requires customisation of entries to replicate, cannot promise I'll be able to take a look immediately, but added to the queue to look at as soon as there is an open spot to customize and build. |
so if i think that the value can show correctly, the doublemap key should use array replace Vec<u8>? |
thanks very much. i use [u8;16] replace it, show correctly. |
Glad you are sorted. We will still have to investigate, since something is weird here - as soon as there is a gap, will delve in deep. (Making "unconfirmed" to investigate) |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query. |
there are my doublemap in substrate:
TokenInfo: double_map T::AccountId, blake2_256(Vec) => Vec;
TokenInfo: double_map T::AccountId, blake2_256(Vec) => u32;
i update the doublemap's key and value successful. but in https://polkadot.js.org/apps/#/chainstate, my doublemap values can't show correctly, allway 0x00. then i change the value type to u32, it allway return 0.
but on the console, return correct Vec or u32.
tell me what can i do? thanks.
The text was updated successfully, but these errors were encountered: