{"record":{"id":"394782dd64715a3e","repo":"unionlabs/union","slug":"wasm-packet-send-event-not-found","errorCode":null,"errorMessage":"wasm-packet_send event not found","messagePattern":"wasm-packet_send event not found","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"tools/union-test/src/cosmos.rs","lineNumber":795,"sourceCode":"    ) -> anyhow::Result<(H256, u64)> {\n        let result = self.send_cosmwasm_transaction(contract, msg, signer).await;\n        let tx_result = result.ok_or_else(|| anyhow!(\"failed to send transaction\"))??;\n        let height = tx_result\n            .height\n            .ok_or_else(|| anyhow!(\"transaction height not found\"))?;\n\n        let send_event = tx_result\n            .tx_result\n            .events\n            .into_iter()\n            .find_map(|e| {\n                if e.ty == \"wasm-packet_send\" {\n                    CosmosSdkEvent::<ModuleEvent>::new(e).ok().map(|e| e.event)\n                } else {\n                    None\n                }\n            })\n            .ok_or_else(|| anyhow!(\"wasm-packet_send event not found\"))?;\n\n        Ok(match send_event {\n            ModuleEvent::WasmPacketSend { packet_hash, .. } => (packet_hash, height.get()),\n            _ => bail!(\"unexpected event variant\"),\n        })\n    }\n}\n\n#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]\n#[serde(rename_all = \"snake_case\", tag = \"type\", content = \"attributes\")]\npub enum ModuleEvent {\n    #[serde(rename = \"delegate\")]\n    Delegate { validator: String, amount: String },\n\n    #[serde(rename = \"withdraw_rewards\")]\n    WithdrawRewards { validator: String, amount: String },\n\n    #[serde(rename = \"wasm-packet_send\")]","sourceCodeStart":777,"sourceCodeEnd":813,"githubUrl":"https://github.com/unionlabs/union/blob/031785bb6dc6b957c624e62bc64c184409c97d7b/tools/union-test/src/cosmos.rs#L777-L813","documentation":"`send_ibc_transaction` scans the committed tx's `tx_result.events` for an event of type `wasm-packet_send` to extract the packet hash; if none is found the tx is treated as not having sent an IBC packet. Events that fail to deserialize into ModuleEvent are silently skipped, so schema mismatch can also hide the event.","triggerScenarios":"The execute message ran but did not send a packet: wrong contract address (not the zkgm contract); msg bytes encode a different variant (e.g. a call that doesn't emit packet_send); insufficient funds attached for a transfer-style message; the wasm event's attributes don't fit the ModuleEvent schema this crate version expects, so deserialization fails and the event is skipped.","commonSituations":"Test encodes the wrong ExecuteMsg variant; contract reverts inside a submessage while the outer tx still succeeds; union-test / unionlabs version out of sync with the deployed zkgm contract's event format.","solutions":["Inspect the committed tx's raw events (explorer or /tx RPC) to see what the contract actually emitted","Verify the contract address is the ucs03-zkgm contract and the msg bytes encode the intended variant","Check the funds/denom attached to the execute if the flow requires them","Align union-test/unionlabs versions with the deployed contract's event schema"],"exampleFix":"// before: assume any committed tx sent a packet\nlet (hash, height) = client.send_ibc_transaction(contract, msg, &signer).await?; \n// after: check for the send event before relying on it\nlet sent = tx_result.tx_result.events.iter().any(|e| e.ty == \"wasm-packet_send\");\nif !sent {\n    let tys: Vec<_> = tx_result.tx_result.events.iter().map(|e| e.ty.clone()).collect();\n    tracing::warn!(?tys, \"no packet_send event; tx did not emit one\");\n}","handlingStrategy":"try-catch","validationCode":"// validate before sending: contract is the zkgm contract and the msg is a packet-sending variant\nanyhow::ensure!(is_zkgm_contract(&contract), \"not a ucs03-zkgm contract; tx will not emit wasm-packet_send\");\nanyhow::ensure!(msg_emits_packet(&msg), \"msg variant does not send a packet\");","typeGuard":null,"tryCatchPattern":"match client.send_ibc_transaction(contract, msg, &signer).await {\n    Ok((hash, height)) => Ok((hash, height)),\n    Err(e) if e.to_string().contains(\"wasm-packet_send event not found\") => {\n        // dump the tx's raw events to diagnose which variant actually executed\n        tracing::error!(error = %e, \"tx committed without packet_send; inspect tx events\");\n        Err(e)\n    }\n    Err(e) => Err(e),\n}","preventionTips":["Encode execute msgs from typed structs, not hand-rolled bytes, so the variant is guaranteed","Pin union-test/unionlabs versions to match the deployed zkgm contract's event schema","Verify the target contract address comes from the deployment fixture, not a literal"],"tags":["rust","cosmwasm","ibc","events","union"],"backgroundTag":null,"analyzedSha":"031785bb6dc6b957c624e62bc64c184409c97d7b","analyzedAt":"2026-08-16T06:24:09.996Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}