Module json

Module json 

Source
Expand description

Implementations of Json cheatcodes.

Functionsยง

canonicalize_json_path ๐Ÿ”’
Canonicalize a json path key to always start from the root of the document. Read more about json path syntax: https://goessner.net/articles/JsonPath/
check_json_key_exists ๐Ÿ”’
encode ๐Ÿ”’
json_to_sol ๐Ÿ”’
json_value_to_token ๐Ÿ”’
Converts a JSON Value to a [DynSolValue] by trying to guess encoded type. For safer decoding, use parse_json_as.
parse_json ๐Ÿ”’
parse_json_array ๐Ÿ”’
parse_json_as ๐Ÿ”’
Parses given serde_json::Value as a [DynSolValue].
parse_json_coerce ๐Ÿ”’
parse_json_keys ๐Ÿ”’
parse_json_map ๐Ÿ”’
parse_json_str ๐Ÿ”’
resolve_type ๐Ÿ”’
Resolves a [DynSolType] from user input.
select ๐Ÿ”’
serialize_json ๐Ÿ”’
Serializes a key:value pair to a specific object. If the key is valueKey, the value is expected to be an object, which will be set as the root object for the provided object key, overriding the whole root object if the object key already exists. By calling this function multiple times, the user can serialize multiple KV pairs to the same object. The value can be of any type, even a new object in itself. The function will return a stringified version of the object, so that the user can use that as a value to a new invocation of the same function with a new object key. This enables the user to reuse the same function to crate arbitrarily complex object structures (JSON).
upsert_json_value ๐Ÿ”’
Upserts a value into a JSON object based on a dot-separated key.