-
Notifications
You must be signed in to change notification settings - Fork 1
Kwxm/e2e/batch6/drop list #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The content looks good to me,
but I'd like to propose/request a few improvements on top:
- Please consider merging my proposed naming convention change to this PR. My other PR with the array builtins already uses that naming convention. It also addresses your previous version ambiguity concern.
- I noticed the formatting is inconsistent. Please run
treefmtcommand available in the nix shell which appliesfourmoluto all codebase. It will align code formatting of this PR with the rest of the code. It should have made it into a pre-commit hook, really.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider merging my #15 to this PR.
OK, but I've added a comment or two that you might want to address.
OK, I've done that. |
Align dropList with array builtin naming convention:
- Old: V_1_1 → New: V3_110
- Old: V_1_0 → New: V3_100
Uses compacted Plutus Core version digits for clarity:
- Underscore: separates Plutus version from Core version
- No separator: within Core version digits (110, 100)
Changes:
- Rename modules: V_X_Y.hs → V3_{XY0}.hs
- Update identifiers: ...V3 → ..._V3_110
- Update script outputs: ...V3.plutus → ..._V3_110.plutus
- Qualified imports: Batch6_V3_110
- Add CLAUDE.md with naming convention documentation
Generated scripts (6 total):
- succeedingDropListPolicyScript_V3_110.plutus
- expensiveDropListPolicyScript_V3_110_{1-5}.plutus
Benefits:
- Less verbose: V3_110 vs V_1_1 (clearer separation)
- Consistent with array builtins convention (PR #12)
- Clear hierarchy: version concepts (separated) vs digits (compact)
Convention documented in CLAUDE.md for project-wide consistency.
Related: PR #12 (array builtins), issue #14
Move dropList to subdirectory structure for consistency with batch6
organization pattern, following Kenneth's feedback.
Directory structure:
Batch6/
└── DropList/
├── Common.hs (was DropList.hs)
├── V3_100.hs
└── V3_110.hs
Changes:
- DropList.hs → DropList/Common.hs
- V3_100.hs → DropList/V3_100.hs
- V3_110.hs → DropList/V3_110.hs
- Update module paths: Batch6.DropList.V3_110
- Update imports: DropList_V3_110
- Update cabal exposed-modules
This structure enables clean organization of all batch6 builtins
(arrays, dropList, etc.) with each builtin in its own subdirectory.
Generated scripts (6 total):
- succeedingDropListPolicyScript_V3_110.plutus
- expensiveDropListPolicyScript_V3_110_{1-5}.plutus
Related: Kenneth's feedback on PR #15, PR #12 (arrays)
Update examples to reflect reorganization: - PlutusScripts.Batch6.Array.V3_110 - PlutusScripts.Batch6.DropList.V3_110 Matches PR #12 documentation updates.
Remove version suffix from identifiers to avoid repetition: - Old: DropList_V3_110.succeedingDropListPolicyCompiled_V3_110 - New: DropList_V3_110.succeedingDropListPolicy Changes: - Remove version suffix from all exported identifiers - Version info already clear from qualified import Example usage: DropList_V3_110.succeedingDropListPolicy DropList_V3_110.expensiveDropListScriptGroup Benefits: cleaner code, no excessive repetition, version still clear. Matches array builtin pattern from PR #12.
Apply same pattern as array builtins (PR #12) to reduce boilerplate. New pattern: - Added Helpers/Envelopes with VersionedScript types - Created PlutusScripts/Batch6/DropList overarching module - Exports allDropListScripts and allDropListScriptGroups lists - Main.hs: mapM_ writeVersionedScript/writeVersionedScriptGroup Benefits: - Main.hs scales: 2 lines for dropList (not 7 lines) - No version repetition: DropList_V3_110.succeedingDropListPolicy - Type-safe version tracking with proper PlutusCore type - Matches array builtin pattern for consistency Example: Old: writeEnvelopeV3 "succeedingDropListPolicyScript_V3_110" DropList_V3_110.succeedingDropListPolicy writeScriptGroup DropList_V3_110.expensiveDropListScriptGroup New: mapM_ writeVersionedScript DropList.allDropListScripts mapM_ writeVersionedScriptGroup DropList.allDropListScriptGroups Generated scripts (6 total): - succeedingDropListPolicyScript_V3_110.plutus - expensiveDropListPolicyScript_V3_110_{1-5}.plutus Related: PR #12 (array pattern), Kenneth's feedback
Done:
|
refactor: adopt compacted Core version naming (V3_110)
|
I'm going to merge this myself so we can move on. |
This adds some scripts for end-to-end tests for the
dropListbuiltin due to be released at PV11. They're contained in a separateBatch6directory..