Shared type definitions for per-operation functions in DoubleDown.Double.
These types describe the function signatures accepted by expect/4,
stub/3, and fake/3 — the per-operation Double API.
Summary
Types
A stateful expect responder with cross-contract state access:
fn [args], state, all_states -> {result, new_state} end.
A per-operation fake function with cross-contract state access:
fn [args], state, all_states -> {result, new_state} end.
Any expect responder (stateless, stateful, or cross-contract).
Any per-operation fake function (stateful or cross-contract).
A stateful expect responder reading the fallback's state:
fn [args], state -> {result, new_state} end.
A per-operation fake function reading the fallback's state:
fn [args], state -> {result, new_state} end.
A stateless expect responder: fn [args] -> result end.
A per-operation stub function: fn [args] -> result end.
Always 1-arity (stateless).
Types
A stateful expect responder with cross-contract state access:
fn [args], state, all_states -> {result, new_state} end.
A per-operation fake function with cross-contract state access:
fn [args], state, all_states -> {result, new_state} end.
@type expect_fun() :: stateless_expect() | stateful_expect() | cross_contract_expect()
Any expect responder (stateless, stateful, or cross-contract).
@type fake_fun() :: stateful_fake() | cross_contract_fake()
Any per-operation fake function (stateful or cross-contract).
A stateful expect responder reading the fallback's state:
fn [args], state -> {result, new_state} end.
A per-operation fake function reading the fallback's state:
fn [args], state -> {result, new_state} end.
A stateless expect responder: fn [args] -> result end.
A per-operation stub function: fn [args] -> result end.
Always 1-arity (stateless).