Overview
parse_contract_inspect_result always returns wasm_hash: Some("mock_wasm_hash_placeholder") and empty instance_storage. The ledger_entry_from_xdr_base64 function exists but panics with "XDR decoding not fully implemented". Users running starforge contract inspect get fabricated data.
Resolution
Implement ledger_entry_from_xdr_base64 using LedgerEntry::from_xdr_base64(xdr, Limits::none()) — the stellar-xdr crate already exposes this via the ReadXdr trait. Match the resulting LedgerEntryData::ContractData(entry) and extract entry.val as a ScVal::ContractInstance(instance). From instance.executable, match ContractExecutable::Wasm(hash) to get the real 32-byte hash. Decode instance.storage (an Option<ScMap>) by calling the already-written but dead-code collect_instance_storage. Use the already-written but #[allow(dead_code)] functions: format_scval, format_scaddress, format_hash, describe_executable. They're all there — just not wired in. Also send the correct XDR-encoded LedgerKey in ledger_key_to_xdr_base64 using WriteXdr::to_xdr_base64 instead of the format!("{:?}", key) hack.
Overview
parse_contract_inspect_resultalways returnswasm_hash: Some("mock_wasm_hash_placeholder")and emptyinstance_storage. Theledger_entry_from_xdr_base64function exists but panics with"XDR decoding not fully implemented". Users runningstarforge contract inspectget fabricated data.Resolution
Implement
ledger_entry_from_xdr_base64usingLedgerEntry::from_xdr_base64(xdr, Limits::none())— thestellar-xdrcrate already exposes this via theReadXdrtrait. Match the resultingLedgerEntryData::ContractData(entry)and extractentry.valas aScVal::ContractInstance(instance). Frominstance.executable, matchContractExecutable::Wasm(hash)to get the real 32-byte hash. Decodeinstance.storage(anOption<ScMap>) by calling the already-written but dead-codecollect_instance_storage. Use the already-written but#[allow(dead_code)]functions:format_scval,format_scaddress,format_hash,describe_executable. They're all there — just not wired in. Also send the correct XDR-encodedLedgerKeyinledger_key_to_xdr_base64usingWriteXdr::to_xdr_base64instead of theformat!("{:?}", key)hack.