feat(evm): inspect offline bytecode interfaces through EVMole (#1051)
* feat(evm): inspect offline bytecode interfaces through evmole * fix(evm): distinguish unsupported bytecode targets * style(evm): format verifier string-prefix checks
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
AnalysisCapabilityUnavailableError,
|
||||
AnalysisUnsupportedTargetError,
|
||||
AnalysisInputError,
|
||||
AnalysisOutputError,
|
||||
AnalysisCancelledError,
|
||||
@@ -28,6 +29,32 @@ const retainedOutput = {
|
||||
truncated: true,
|
||||
};
|
||||
|
||||
it("distinguishes unsupported target formats from unavailable provider capabilities", () => {
|
||||
const projected = projectAnalysisError(
|
||||
new AnalysisUnsupportedTargetError(
|
||||
"inspect_evm_interface",
|
||||
"/selected/runtime.hex",
|
||||
"EOF-style EF00 container is unsupported.",
|
||||
{ capturedOutput: retainedOutput },
|
||||
),
|
||||
);
|
||||
expect(projected).toMatchObject({
|
||||
code: "unsupported_target",
|
||||
category: "unsupported_target",
|
||||
retryable: false,
|
||||
details: {
|
||||
operation: "inspect_evm_interface",
|
||||
path: "/selected/runtime.hex",
|
||||
reason: "EOF-style EF00 container is unsupported.",
|
||||
captured_output: retainedOutput,
|
||||
},
|
||||
});
|
||||
expect(projected.message).toContain("EF00");
|
||||
expect(projected.remediation.action).toContain("target format");
|
||||
expect(projected.remediation.action).not.toContain("doctor");
|
||||
expect(analysisErrorProjectionSchema.safeParse(projected).success).toBe(true);
|
||||
});
|
||||
|
||||
it.each([
|
||||
["memory", null],
|
||||
["memory", { address_space_bytes: 67108864 }],
|
||||
|
||||
Reference in New Issue
Block a user