ReviewOS

home-lang/home

Port solc standard JSON compile corpus

#308
Closed chris opened this 10 days ago ·
10 days ago

Bun compatibility slice

Port js/third_party/solc/solc.test.ts at exhaustive corpus position 4061.

Required behavior

  • support the default solc import and compile() standard-JSON entry point;
  • parse Solidity source units and return deterministic contracts/sources output for a simple program;
  • report source-level compiler problems in the returned standard JSON rather than throwing;
  • throw a structured, causal, operation-tagged error for malformed API input without exposing source payloads;
  • add focused and permanent regression coverage.

Tracked from #66.

10 days ago

Implemented and pushed in 941fa6134.

Coverage now includes:

  • default solc import and standard-JSON compile() entry point;
  • deterministic source IDs, contract discovery, function ABI entries, metadata, and bytecode/deployed-bytecode objects;
  • in-band standard-JSON diagnostics for unsupported language, malformed sources, and unbalanced Solidity braces;
  • SolcCompileError for malformed API input with code, operation, phase, input length, sanitized cause, and causal stack;
  • source-payload redaction from exception messages and stacks;
  • permanent behavioral proof that compilation returns a populated contract rather than a no-op value.

Verification:

  • focused position 4061: 1 file, 1 passed, 0 failed/todo/unsupported/allowed-empty;
  • positions 4060–4061: 2 files, 1 passed, 1 intentional todo, 0 failed/unsupported/allowed-empty;
  • permanent gRPC error-stack, SQL adapter-contract, third-party corpus, and 38-case behavior/error diagnostic suites all pass.

Sign in to comment on this issue.