degenbot.dispatch.records¶

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¶

class degenbot.dispatch.records.SubmitSkipReason¶

Bases: enum.StrEnum

The typed SkipReason vocabulary of the Rust submit leaf.

POOLS_CLAIMED = 'pools_claimed'¶
DRY_RUN = 'dry_run'¶
INJECT_CODE = 'inject_code'¶
BROADCAST_FAILED = 'broadcast_failed'¶
class degenbot.dispatch.records.SubmittedRecord¶

The tx was broadcast — the resulting tx_hash + claimed nonce.

path_id: int¶
tx_hash: str¶
nonce: int¶
class degenbot.dispatch.records.SkippedRecord¶

The candidate was skipped — detail set for BROADCAST_FAILED.

path_id: int¶
reason: SubmitSkipReason¶
detail: str | None = None¶
degenbot.dispatch.records.SubmitRecord¶
degenbot.dispatch.records.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.