{"record":{"id":"e289ddff1df85154","repo":"FuelLabs/sway","slug":"missing-used-gas-information-from-test-execution","errorCode":null,"errorMessage":"missing used gas information from test execution","messagePattern":"missing used gas information from test execution","errorType":"console","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"forc-test/src/execute.rs","lineNumber":300,"sourceCode":"            file_path,\n            duration,\n            span,\n            state: state.unwrap(),\n            condition,\n            logs,\n            gas_used,\n            ecal: Box::new(self.interpreter.ecal_state().clone()),\n        })\n    }\n\n    fn get_gas_and_receipts(receipts: Vec<Receipt>) -> anyhow::Result<(u64, Vec<Receipt>)> {\n        let gas_used = *receipts\n            .iter()\n            .find_map(|receipt| match receipt {\n                tx::Receipt::ScriptResult { gas_used, .. } => Some(gas_used),\n                _ => None,\n            })\n            .ok_or_else(|| anyhow::anyhow!(\"missing used gas information from test execution\"))?;\n\n        // Only retain `Log` and `LogData` receipts.\n        let logs = receipts\n            .into_iter()\n            .filter(|receipt| {\n                matches!(receipt, tx::Receipt::Log { .. })\n                    || matches!(receipt, tx::Receipt::LogData { .. })\n            })\n            .collect();\n        Ok((gas_used, logs))\n    }\n}\n\nfn find_jump_instruction_index(bytecode: &[u8]) -> usize {\n    // Search first `move $$locbase $sp`\n    // This will be `__entry` for script/predicate/contract using encoding v1;\n    // `main` for script/predicate using encoding v0;\n    // or the first function for libraries","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/FuelLabs/sway/blob/47e5e902faa42baf652dd6a0c88cd23390c1a614/forc-test/src/execute.rs#L282-L318","documentation":"Error \"missing used gas information from test execution\" thrown in FuelLabs/sway.","triggerScenarios":"Thrown at forc-test/src/execute.rs:300 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"47e5e902faa42baf652dd6a0c88cd23390c1a614","analyzedAt":"2026-08-16T07:57:45.555Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}