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, useparse_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).
- serialize_
value_ 🔒as_ json - Serializes given [DynSolValue] into a serde_json::Value.