test: bring MUSD and MuzixCatalog coverage up to repo bar#80
Open
Pattermesh wants to merge 2 commits into
Open
test: bring MUSD and MuzixCatalog coverage up to repo bar#80Pattermesh wants to merge 2 commits into
Pattermesh wants to merge 2 commits into
Conversation
MUSD.t.sol (2 -> 28 tests) and MuzixCatalog.t.sol (2 -> 29 tests), bringing both up to par with sibling suites (27-35 tests each). MUSD: ERC20 metadata, onlyOwner mint, transfer/transferFrom + allowance reverts (IERC6093 custom errors), single (transferWithRoyalty) and batch (batchRoyaltyDistribution) royalty distribution incl. atomic-revert and escrow-remainder edge cases, pull-payment claims (claimPayments) incl. double-claim guard and per-recipient independence, and ERC20Permit. MuzixCatalog: mintMusic + ISRC metadata, setRoyaltySplit validation (owner check, array mismatch, 100% total, overwrite), fractionalize view, depositRevenue/claimStreamingRevenue streaming pull-payments incl. incremental top-up claims and non-stakeholder/zero-revenue reverts, and ERC-2981/ERC-165 introspection. forge build + forge test green: 161 passed, 0 failed across 6 suites. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
MUSD.t.solandMuzixCatalog.t.solhad only ~2 tests each, far below sibling suites (27–35). This PR brings both up to par.What's covered
MUSD (
src/MUSD.sol)minthappy path +onlyOwnerrevert (Ownable.OwnableUnauthorizedAccount)transfer/transferFrom+ allowance accounting, with IERC6093 custom-error reverts (ERC20InsufficientBalance,ERC20InsufficientAllowance)transferWithRoyalty(atomic single distribution): pending-withdrawal crediting, escrow into the contract, event emission, accumulation across calls, single-recipient and partial-split (<100%) remainder behavior, no-split and insufficient-balance revertsbatchRoyaltyDistribution: multi-token splits, aggregateBatchRoyaltyProcessedevent,onlyOwner+ mismatched-array reverts, empty-array no-op, atomic revert when any token lacks a splitclaimPayments: transfer + zeroing of pending,Withdrawalevent, no-funds and double-claim reverts, per-recipient independence, claim across multiple distributionsERC20Permit(EIP-2612) allowance via signedpermitMuzixCatalog (
src/MuzixCatalog.sol)mintMusic: ownership, tokenURI, ISRC/artist metadata, monotonic token ids,onlyOwnerrevert, nonexistent-tokentokenURIrevert, transferabilitysetRoyaltySplit: storage of recipients/shares, ERC-2981 10% pool royalty, and reverts for non-owner / array mismatch / total ≠ 100% / nonexistent token, plus overwritefractionalizeview (multi- vs single-recipient vs no split)depositRevenue/claimStreamingRevenueETH streaming pull-payments: share-weighted payout, incremental claim after top-up, double-claim-without-new-revenue revert, non-stakeholder and zero-revenue reverts, anyone-can-fundsupportsInterface, androyaltyInfozero before any splitTest infra
Uses a configurable
MockCatalogfor MUSD (depends only on theroyaltySplitsABI slice) and aStakeholderreceiver harness for catalog streaming claims, matching the stub-based conventions in the existing sibling suites.Verification
🤖 Generated with Claude Code