(payload: Any)
| 97 | |
| 98 | |
| 99 | def _json_bytes(payload: Any) -> bytes: |
| 100 | try: |
| 101 | encoded = json.dumps(payload, allow_nan=False, indent=2, sort_keys=True) |
| 102 | except ValueError as exc: |
| 103 | raise ContractError(f"cannot encode canonical JSON: {exc}") from exc |
| 104 | return (encoded + "\n").encode("utf-8") |
| 105 | |
| 106 | |
| 107 | def _sha256_text(value: str) -> str: |
no test coverage detected