Skip to content

Conversation

@Unisay
Copy link
Contributor

@Unisay Unisay commented Dec 23, 2025

Context

What is the goal of this PR?
Add end-to-end tests for three new Plutus V3 array manipulation builtins (indexArray, lengthOfArray, and listToArray) that were introduced in protocol version 11.

Why is this change necessary?
These builtins are part of the batch6 enhancements for Plutus V3, enabling more efficient array operations in smart contracts. Without E2E tests, we cannot verify that these builtins work correctly in a real on-chain environment with cardano-node.

Approach

This PR follows the existing Plutus V3 testing pattern:

  • Adds three new minting policy scripts to tests/data/plutus/v3/batch6/1.1.0/
  • Each script exercises one of the new array builtins
  • Scripts are compiled with Plinth/PlutusTx and serialized to CBOR format
  • Scripts are registered in the batch6 test suite via plutus_common.py
  • Tests run through the existing batch6 test infrastructure, which executes minting transactions and verifies successful on-chain execution

The scripts use a succeeding (positive test) approach - they demonstrate that the builtins execute without errors when called with valid inputs.

Changes

Array Builtin Test Scripts

  • succeedingIndexArrayPolicyScript_V3_110.plutus: Tests indexArray builtin for accessing array elements by index
  • succeedingLengthOfArrayPolicyScript_V3_110.plutus: Tests lengthOfArray builtin for determining array size
  • succeedingListToArrayPolicyScript_V3_110.plutus: Tests listToArray builtin for converting lists to arrays

Test Registration

  • plutus_common.py:490-492: Added three new scripts to SUCCEEDING_BATCH6_SCRIPT_FILES_V3 tuple, integrating them with the existing batch6 test suite

Add E2E tests for indexArray, lengthOfArray, and listToArray builtins introduced in Plutus V3 protocol version 11. These builtins are part of batch6 enhancements that enable efficient array operations in smart contracts.

Tests verify successful execution of array operations through minting policy scripts integrated with the batch6 test suite.
@Unisay Unisay self-assigned this Dec 23, 2025
@Unisay Unisay requested review from ana-pantilie and kwxm December 23, 2025 12:54
@mkoura mkoura merged commit f540c11 into master Dec 23, 2025
3 checks passed
@mkoura mkoura deleted the yura/issue-1921-array-builtin-e2e-tests branch December 23, 2025 20:58
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.

3 participants