Closed siman closed 5 years ago
You are using usize here. In native it is u64, in WASM it is u32. So there is native/WASM mismatch. Be explicit, converting to either u64 or u32 depending on what you want.
(The polkadot-js/api will not actually support constructing usize going forward, so you can still use it in back-end code, but the API will not allow construction - specifically due to the fact it causes mismatches)
Good to know this pitfall! Need to check it by updating to u32
or u16
.
We observe a strange panic error in Substrate from the code that verifies the length of input of type
Vec<u8>
. The validation code is relatively simple.The code that makes Substrate to panic:
The actual code is here: https://github.com/Joystream/substrate-forum-module/blob/development/src/lib.rs#L671
Below is a part of it that, I believe, is related to this panic error:
The log with Substrate panic: