Global Functions¶
-
json_dumps
(obj: Any, **kwargs) → str¶ Converts a python object obj to a JSON string
Parameters: - obj – a python object to be converted
- kwargs – json options (see https://docs.python.org/3/library/json.html#json.dumps)
Returns: json string
-
json_loads
(src: str, **kwargs) → Any¶ Parses a JSON string src and converts it to a python object
Parameters: - src – a JSON string to be converted
- kwargs – kwargs: json options (see https://docs.python.org/3/library/json.html#json.loads)
Returns: a python object
-
revert
(message: Optional[str] = None, code: int = <ExceptionCode.SCORE_ERROR: 32100>) → None¶ Reverts the transaction and breaks. All the changes of state DB in current transaction will be rolled back.
Parameters: - message – revert message
- code – code
-
sha3_256
(data: bytes) → bytes¶ Computes hash using the input data
Parameters: data – input data Returns: hashed data in bytes