fix(contracts)!: return structured workflow failures
Replace prose-encoded partial failures in batch decompilation, call graphs, and named xref lookup with discriminated structured results. BREAKING CHANGE: batch_decompile, get_call_graph, and find_xrefs_to_name now return structured discriminated output shapes.
This commit is contained in:
@@ -185,12 +185,18 @@ const verifyCurrentTarget = async (client, options) => {
|
||||
boundedResult === null ||
|
||||
typeof boundedResult !== "object" ||
|
||||
Array.isArray(boundedResult) ||
|
||||
Object.keys(boundedResult).length !== 1
|
||||
boundedResult.total !== 1 ||
|
||||
boundedResult.succeeded !== 1 ||
|
||||
boundedResult.failed !== 0 ||
|
||||
!Array.isArray(boundedResult.items) ||
|
||||
boundedResult.items.length !== 1 ||
|
||||
boundedResult.items[0]?.address !== firstAddress ||
|
||||
boundedResult.items[0]?.status !== "ok"
|
||||
) {
|
||||
throw new Error("batch_decompile returned an invalid result");
|
||||
}
|
||||
const boundedPseudocode = requirePseudocode(
|
||||
boundedResult[firstAddress],
|
||||
boundedResult.items[0].pseudocode,
|
||||
"batch_decompile",
|
||||
);
|
||||
const dossier = requireFunctionDossier(
|
||||
|
||||
Reference in New Issue
Block a user