Skip to content
This repository was archived by the owner on May 24, 2026. It is now read-only.

Fix extractReceiptVerb to read canonical receipt.verb with x402 fallback#27

Closed
GsCommand wants to merge 1 commit into
mainfrom
codex/fix-unit-test-in-pr-#26
Closed

Fix extractReceiptVerb to read canonical receipt.verb with x402 fallback#27
GsCommand wants to merge 1 commit into
mainfrom
codex/fix-unit-test-in-pr-#26

Conversation

@GsCommand
Copy link
Copy Markdown
Contributor

Motivation

  • A unit test expected extractReceiptVerb to read the canonical receipt.verb field but the implementation only inspected legacy receipt.x402.verb, causing CI failures.
  • The change keeps legacy x402 behavior as a fallback while making the canonical path authoritative per the Commons v1.1.0 contract.
  • Running the test cycle also surfaced minor TypeScript typing and naming issues that prevented a clean typecheck/build.

Description

  • Updated extractReceiptVerb to delegate to the existing getReceiptVerb so the function returns receipt.verb first and falls back to receipt.x402.verb if needed (src/index.ts).
  • Introduced the ReceiptProtocolMetadata type and fixed related type/generic usages and naming (receiptIdPresent, signerId) to resolve TypeScript errors (src/index.ts).
  • Adjusted the unit-test fixture to include the canonical verb field so the test extractReceiptVerb reads canonical verb field validates the intended behavior (scripts/unit-tests.mjs).

Testing

  • Ran npm run typecheck and it completed successfully with no type errors.
  • Ran npm run build and the build artifacts were produced successfully.
  • Ran npm run test:unit and all unit tests passed (44 passed, 0 failed).

Codex Task

@GsCommand GsCommand closed this Apr 24, 2026
@GsCommand GsCommand deleted the codex/fix-unit-test-in-pr-#26 branch April 24, 2026 03:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant