clean_revert_reason_message#

API documentation for tradeexecutor.ethereum.revert.clean_revert_reason_message Python function.

clean_revert_reason_message(msg)[source]#

Clean up Enzyme’s mangling of the revert reason.

  • Clean everything with NULs at start and end based on what we have seen Enzyme tx spit out.

  • Non-enzyme revert messages are untouched.

Parameters:

msg (str | None) – Raw revert reason message from JSON-RPC API

Returns:

Revert reason cleaned up from whatever binary Enzyme inserts there.

If revert reason is None return empty string.

Return type:

str