Skip to content

Conversation

@theref
Copy link
Contributor

@theref theref commented Nov 4, 2025

Summary

Implement new variable operations to match the operators added in nucypher/nucypher#3664.

Changes

This PR adds 5 new unary operators to the condition language:

JSON Conversion

  • fromJson - Parses JSON strings to objects/arrays
  • toJson - Serializes objects/arrays to JSON strings

Hex Conversion

  • fromHex - Converts hex strings to bytes
  • toHex - Converts bytes/strings/integers to hex format with '0x' prefix

Hashing

  • keccak - Computes keccak-256 hashes of strings, bytes, or integers

Testing

Related

This maintains consistency between the nucypher and taco-web codebases, ensuring the condition language is properly reflected between both repositories as mentioned in nucypher/nucypher#3664.

Note

The integration tests are currently skipped in CI (they only run when RUNNING_IN_CI is set). Once the Lynx network is updated to include the new operators from nucypher/nucypher#3664, the integration tests will validate end-to-end functionality.

@netlify
Copy link

netlify bot commented Nov 4, 2025

Deploy Preview for taco-nft-demo ready!

Name Link
🔨 Latest commit ef859d1
🔍 Latest deploy log https://app.netlify.com/projects/taco-nft-demo/deploys/6909ff1531856500089c5972
😎 Deploy Preview https://deploy-preview-734--taco-nft-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Nov 4, 2025

Deploy Preview for taco-demo ready!

Name Link
🔨 Latest commit ef859d1
🔍 Latest deploy log https://app.netlify.com/projects/taco-demo/deploys/6909ff1577e8f400081562dd
😎 Deploy Preview https://deploy-preview-734--taco-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@derekpierre derekpierre changed the base branch from main to signing-epic November 4, 2025 13:27
@codecov-commenter
Copy link

codecov-commenter commented Nov 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (signing-epic@5d49643). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff               @@
##             signing-epic     #734   +/-   ##
===============================================
  Coverage                ?   90.14%           
===============================================
  Files                   ?       97           
  Lines                   ?     8463           
  Branches                ?      523           
===============================================
  Hits                    ?     7629           
  Misses                  ?      791           
  Partials                ?       43           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@derekpierre derekpierre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to re-run generate-zod-docs now that you've added more operations.

That also reminds me that the list gets truncated, #727, (cc @Muhammad-Altabba ).

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for new variable operation functions including JSON conversion (toJson, fromJson), hex conversion (toHex, fromHex), and keccak hashing (keccak). All new operators are configured as unary operators that don't require a second value parameter.

  • Added 5 new operators to both OPERATOR_FUNCTIONS and UNARY_OPERATOR_FUNCTIONS arrays
  • Added schema validation tests for the new operators
  • Organized operators with inline comments for better code organization

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/taco/src/conditions/schemas/variable-operation.ts Added new operators for JSON/hex conversion and keccak hashing to the operator arrays with organized comments
packages/taco/test/conditions/variable-operation.test.ts Added schema validation tests for the new operators grouped by functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@theref
Copy link
Contributor Author

theref commented Nov 5, 2025

@derekpierre I ran the docs generation but the list was truncated and so there's no change to the docs

Copy link
Contributor

@Muhammad-Altabba Muhammad-Altabba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
However, just would like to see one of the new operators used in some of the other encrypt or sign integration tests as hinted in #734 (comment). And to delay merging till lynx got updated and so all the integration tests passed.

Copy link
Contributor

@manumonti manumonti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I assume the CI tests will be failing until the changes on nucypher are merged and the Lynx nodes are updated, right?

@derekpierre
Copy link
Member

LGTM! I assume the CI tests will be failing until the changes on nucypher are merged and the Lynx nodes are updated, right?

I think this PR just needs to be rebased over #737 (cc @theref ).

@derekpierre derekpierre mentioned this pull request Nov 11, 2025
30 tasks
theref and others added 4 commits November 26, 2025 08:31
Implement new variable operations to match nucypher/nucypher#3664:
- JSON conversion: fromJson, toJson
- Hex conversion: fromHex, toHex
- Hashing: keccak

All operators are unary (don't require a value parameter).
Maintains consistency between nucypher and taco-web codebases.
Remove duplicate unit tests already covered by parametrized tests.
Add integration test validating JSON, hex, and keccak operations.
@derekpierre
Copy link
Member

LGTM! I assume the CI tests will be failing until the changes on nucypher are merged and the Lynx nodes are updated, right?

I think this PR just needs to be rebased over #737 (cc @theref ).

✔️ - Rebased

@derekpierre
Copy link
Member

CI tests rely on nucypher/nucypher#3672 whose code is now running on lynx.

Copy link
Member

@derekpierre derekpierre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎸

@derekpierre derekpierre merged commit 7cc3d47 into nucypher:signing-epic Nov 26, 2025
4 checks passed
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.

6 participants