Skip to main content

euv_core/dynamic/contract/
enum.rs

1use super::*;
2
3/// Reference strongly-typed event enum emitted by `ProductCardContract` (Sec 11.9).
4#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
5#[serde(tag = "type", rename_all = "snake_case")]
6pub enum ProductCardEvent {
7    /// Emitted when the user updates the requested quantity inside the dynamic card.
8    QuantityChanged {
9        /// Newly requested quantity value.
10        quantity: u32,
11    },
12    /// Emitted when the user submits a save request from the dynamic card.
13    SaveRequested {
14        /// Product identifier being saved.
15        product_id: String,
16        /// Quantity snapshot requested for save.
17        quantity: u32,
18    },
19}
20
21/// Active implementation source resolved for a strongly-typed dynamic component slot.
22#[derive(Clone, Debug, Eq, PartialEq)]
23pub enum DynamicBindingSource {
24    /// Compiled fallback built directly into the host binary.
25    CompiledFallback,
26    /// Sandboxed executable Wasm Component module pinned by release generation.
27    WasmComponent {
28        /// Exact pinned artifact key (`"card@2.0.0"`).
29        artifact_key: String,
30        /// Verified SHA-256 blob digest.
31        sha256: String,
32    },
33    /// Store-compliant Declarative Data specification pinned by release generation.
34    DeclarativeData {
35        /// Exact pinned artifact key (`"card@2.0.0"`).
36        artifact_key: String,
37        /// Verified SHA-256 blob digest.
38        sha256: String,
39    },
40}