Finschia / cosmwasm

Fast and reusable WebAssembly smart contract runtime(and library) for finschia-sdk.
Apache License 2.0
27 stars 14 forks source link

Should not use cosmwasm_std::{to_vec, from_slice} other than WASM target #277

Closed loloicci closed 1 year ago

loloicci commented 1 year ago

cosmwasm_std::{to_vec, from_slice} seems to use serde-json-wasm and it seems to have some bug.

error: entered unreachable code', /XXXXXXXX/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-json-wasm-0.4.1/src/de/mod.rs:586:9

(It is caused by deserializing a slice to HashMap<String, CalleeProperty>)

So we should not use cosmwasm_std::{to_vec, from_slice} other than WASM target, for example, cosmwasm_vm. We need to check and fix it is not used other than WASM target. For other than WASM target, use serde_json::{to_vec, from_slice} instead.

loloicci commented 1 year ago

closed via #288