DoubleDown.Contract.Dispatch.Keys (double_down v0.55.0)

Copy Markdown View Source

Centralised NimbleOwnership key helpers for DoubleDown dispatch.

All test-time state is stored in a single NimbleOwnership GenServer keyed by atoms derived from the contract module. This module provides the canonical key-generation functions so that Dispatch, Double, and Testing all agree on the key scheme.

Key scheme

KeyFunctionPurpose
ownership_server/0Server nameThe NimbleOwnership GenServer registered name
contract module atom(no function)Handler meta + inline state for stateful handlers
log_key/1Per-contractAccumulated {contract, op, args, result} call log
contracts_key/0GlobalSet of contracts with active Double expects

Summary

Functions

NimbleOwnership key for the set of contracts with active Double expects/stubs.

NimbleOwnership key for a contract's dispatch call log.

The registered name of the NimbleOwnership GenServer.

Functions

contracts_key()

@spec contracts_key() :: atom()

NimbleOwnership key for the set of contracts with active Double expects/stubs.

log_key(contract)

@spec log_key(module()) :: atom()

NimbleOwnership key for a contract's dispatch call log.

ownership_server()

@spec ownership_server() :: atom()

The registered name of the NimbleOwnership GenServer.