Skip to content

Cip112 one step mint: add new tests and refactored existing ones - #65

Merged
0xNeshi merged 9 commits into
cip112-one-step-mintfrom
cip112-one-step-mint-update
Oct 21, 2026
Merged

0xNeshi merged 9 commits into
cip112-one-step-mintfrom
cip112-one-step-mint-update

Conversation

@0xNeshi

@0xNeshi 0xNeshi commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

Updates for #64

- **New `mintMustFail` helper** in [Guard.daml](test/token-cip112-v1-test/daml/OpenZeppelin/Token/Cip112/V1/Test/Guard.daml), next to `actorsMismatch`. It takes the scenario, expected message, actors and transfer, and submits the mint with the rules disclosed. I also switched `testMintAuthorityAndBounds` to it, so its local `disclosed` and `refused` helpers are gone. The "Authorization failure" case still calls `mustFailWith` directly, because it submits as alice while naming the admin as the actor.
- **`testMintRefusesSpecialReceiverAndInputs` and `testMintRefusesOutOfWindow`** now use `mintMustFail`.
- **`testMintStepsFollowReceiverAccount`**:
  - It uses a local `disclosed` helper and `pendingCid` instead of the inline `case`.
  - It now checks alice's balance is `[3.0]` after the one-step mint to savings, and still `[3.0]` after the offer.
  - Each case has a comment, and I reworded the doc comment to match what the test checks.
- **`testMintToProviderAccount`**:
  - Both bare `submitMustFail` calls now assert `actorsMismatch`: the one-step mint without the provider, and alice accepting alone.
  - The second accept now asserts `"NotActive"`, which is the error for an offer the first accept already consumed.
  - Both accepts go through one local `accept actors` helper.
  - The doc comment now says the provider sees both holdings.
@0xNeshi
0xNeshi force-pushed the cip112-one-step-mint-update branch from 18fb088 to 8cfd667 Compare October 21, 2026 14:02
@0xNeshi
0xNeshi merged commit abc55cb into cip112-one-step-mint Oct 21, 2026
6 of 7 checks passed
@0xNeshi
0xNeshi deleted the cip112-one-step-mint-update branch October 21, 2026 14:05
0xNeshi added a commit that referenced this pull request Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants