Skip to content

test(labelton): bring Labelton.t.sol to parity with repo test bar #50

Description

@abhicris

Labelton.sol landed in #48 without a same-PR test suite. Every other contract in this repo (MUSD / MuzixCatalog / MuzixAIProvenance / MuzixStreamingOracle #36 / MuzixRightsOffering #37) shipped with tests in the same PR. This issue closes that gap.

Scope

test/Labelton.t.sol covering:

  • registerMaster happy path (single + multi-holder cap-table) — verifies storage of all Master fields, _capTables length + content, masterByIsrcRoot / masterByUpc / masterByIswc reverse lookups, dataHash matches keccak256(abi.encode(p, capTable)), root variant minted with ERC-1155 balances == shareBps per holder.
  • registerMaster every revert: LabeltonPaused, CapTableSizeOutOfRange (0 + 65), IsrcRootEmpty, IsrcRootAlreadyRegistered, UpcAlreadyRegistered, IswcAlreadyRegistered, CapTableHolderInvalid, CapTableShareInvalid, CapTableSharesDoNotSum (over + under).
  • mintVariant happy path — variant kind toggle on, cap-table-member call, ERC-1155 balances fanned correctly, variantByIsrc reverse lookup, event emitted.
  • mintVariant every revert: LabeltonPaused, MasterDoesNotExist, VariantKindNotAllowed, NotMasterMember, VariantIsrcAlreadyRegistered.
  • DAO config endpoints: setVariantKindAllowed, setMirVerifier, setLegalIdVerifier, setFinancialIdVerifier, setPaused — owner-only access, event emission, state change observed.
  • Invariants (fuzz where applicable): sum of balanceOf(holder, variantId) across cap-table holders == VARIANT_SUPPLY_BPS (10000); masterOf(variantId) round-trips.
  • capTableOf / capTableOfVariant reads — including the minor nit that capTableOfVariant currently reverts with MasterDoesNotExist when the variant doesn't exist (fix or rename in this PR).

Target: forge suite stays green; new tests pass; no regressions in the 15 existing tests.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions