foundry_cheatcodes::json

Function json_value_to_token

Source
pub(crate) fn json_value_to_token(value: &Value) -> Result<DynSolValue>
Expand description

Converts a JSON Value to a [DynSolValue] by trying to guess encoded type. For safer decoding, use parse_json_as.

The function is designed to run recursively, so that in case of an object it will call itself to convert each of it’s value and encode the whole as a Tuple