Repository navigation
test: lock Receipt text for the packages #178 did not cover - #204
Open
codeswithroh wants to merge 1 commit into
Open
codeswithroh wants to merge 1 commit into
codeswithroh wants to merge 1 commit into
Conversation
nishuzumi#178 pinned the text an Agent reads for erc20, Kuru, PancakeSwap and the template. Ten Receipt-producing packages still had no exact text check, or only substring checks, so a dropped field or reordered interpolation in them would pass every test. Add the same three assertions per package: exact leaf text per Change class, exact top-level Receipt text, and the full ordered leaf-text sequence flattened the way the MCP adapter does it. Covered: ERC721, ERC1155 (including a revoked ApprovalForAll), WMON wrap and unwrap, Aave supply, withdraw, borrow and repay, aPriori stake, unstake and claim (single and multi-ID), Clober, Kintsu, Morpho supply and withdraw, Pendle buy and sell, Uniswap v4 swap and Permit2 approval. Delegated ERC-20 legs are nested Receipts, so the per-position map holds null there and the flattened sequence carries their text. Add the practice to the onboarding tests list, the Protocol definition of done and the PR template so new adapters follow it. No source or format change. Closes nishuzumi#115
Contributor
Author
|
@portdeveloper please take a look |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
#178 pinned the text an Agent reads for erc20, Kuru, PancakeSwap V2/V3 and the template. I checked every Receipt-producing package on
mainafterwards. Ten still had no exact text check, or onlytoContain, so a dropped field, a swapped interpolation or a wrong unit in them would pass every test while changing what the MCP layer shows an Agent.This adds the same three assertions #178 uses, per package:
receiptTextsCovered here:
@themoss/erc@themoss/systemprotocol-aaveprotocol-aprioriprotocol-cloberprotocol-kintsuprotocol-morphoprotocol-pendleprotocol-uniswapMerkl already asserted its text in its own PR, and NadFun and Monad Cards produce no Receipts, so nothing to add there.
Closes #115
Type of change
Framework and package impact
None. No source, format or public type changes. Delegated ERC-20 legs are nested Receipts, so the per-position map holds
nullat those slots while the flattened sequence carries their text. Both are asserted, as in #178.I also added one line each to the onboarding "Tests required for review" list, the Protocol Definition of Done in CONTRIBUTING, and the PR template's Protocol checklist, so new adapters do the same. Those three lines are the only non-test change and can be dropped if you would rather word them differently.
Verification
pnpm buildpnpm typecheckpnpm lintpnpm test:offline, all packages pass (live mainnet cases skipped, offline)Evidence
Every expected string comes from the parser's real output over the file's existing fixtures, not from a format I assumed. No new chain data, no network.
To check the assertions bite, I changed one format string in each package's source, ran that package's tests, and reverted. All ten failed on the changed line:
#toidto/fromorder:to-(fee ...)parenthesesunitstou->to=>