Global Functions

json_dumps(obj: Any, **kwargs) → str

Converts a python object obj to a JSON string

Parameters:
Returns:

json string

json_loads(src: str, **kwargs) → Any

Parses a JSON string src and converts it to a python object

Parameters:
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