degenbot.dispatch.records ========================= .. py:module:: degenbot.dispatch.records .. autoapi-nested-parse:: Typed decode of the submit-leaf records crossing dispatch_and_submit. The Rust SubmitRecord enum (degenbot-submission::submit) is the source of truth: Submitted { path_id, tx_hash, nonce } or Skipped { path_id, reason }. Its pyfunction wire flattens those to dicts keyed by a "kind" string plus a "reason" string for skips. This module is the single home for decoding that wire into typed records: an unrecognized kind/reason or missing payload keys is Rust/Python wire drift and RAISES — the driver can no longer silently drop a submission event inside a string "if" chain. Module Contents --------------- .. py:class:: SubmitSkipReason Bases: :py:obj:`enum.StrEnum` The typed SkipReason vocabulary of the Rust submit leaf. .. py:attribute:: POOLS_CLAIMED :value: 'pools_claimed' .. py:attribute:: DRY_RUN :value: 'dry_run' .. py:attribute:: INJECT_CODE :value: 'inject_code' .. py:attribute:: BROADCAST_FAILED :value: 'broadcast_failed' .. py:class:: SubmittedRecord The tx was broadcast — the resulting tx_hash + claimed nonce. .. py:attribute:: path_id :type: int .. py:attribute:: tx_hash :type: str .. py:attribute:: nonce :type: int .. py:class:: SkippedRecord The candidate was skipped — detail set for BROADCAST_FAILED. .. py:attribute:: path_id :type: int .. py:attribute:: reason :type: SubmitSkipReason .. py:attribute:: detail :type: str | None :value: None .. py:data:: SubmitRecord .. py:function:: typed_submit_record(raw: collections.abc.Mapping[str, Any], /) -> SubmitRecord Decode one FFI submit-record dict into a typed record. :returns: The typed record. :raises DegenbotValueError: On an unrecognized or missing "kind", an unknown skip "reason", or missing payload keys — wire drift, loud.