Skip to content

Conversation

@thephez
Copy link
Collaborator

@thephez thephez commented Jan 6, 2026

Issue being fixed or feature implemented

Re-enables a previously skipped test for V1 data contracts with tokens and groups in the WASM SDK unit tests. The test was disabled due to a serialization issue that has since been fixed. Related to #2803 and #2794.

What was done?

  • Enabled the should create a V1 contract from JSON and expose all properties including tokens and groups test in packages/wasm-sdk/tests/unit/data-contract.spec.mjs
  • Removed the it.skip() and associated TODO comment

How Has This Been Tested?

  • The test passes locally after the serialization fix was merged
  • Run with: yarn workspace @dashevo/wasm-sdk test

Breaking Changes

None

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

Summary by CodeRabbit

  • Tests
    • Restored and enabled a previously skipped test for V1 contract validation to ensure proper verification of contract properties.

✏️ Tip: You can customize this high-level summary in your review settings.

Was previously disabled due to a serialization issue that has been fixed
@github-actions github-actions bot added this to the v3.0.0 milestone Jan 6, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 6, 2026

📝 Walkthrough

Walkthrough

A previously skipped test in the data-contract specification is restored and enabled. The test validates V1 contract property exposure through the fromJSON method. No assertion logic or test implementation changes are included.

Changes

Cohort / File(s) Summary
Test Restoration
packages/wasm-sdk/tests/unit/data-contract.spec.mjs
Enabled previously skipped test for fromJSON V1 contract validation (removed it.skip, converted to active it(...)). Test execution path now includes V1 contract property exposure checks.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Hopping with joy, the test runs free,
V1 contracts now we'll see!
No more skips, just verify,
Properties exposed — oh my, oh my!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: enabling a previously skipped test that validates V1 contract properties including tokens and groups.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b5000ab and b272c06.

📒 Files selected for processing (1)
  • packages/wasm-sdk/tests/unit/data-contract.spec.mjs
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2024-11-06T07:27:01.722Z
Learnt from: shumkov
Repo: dashpay/platform PR: 2314
File: packages/wallet-contract/test/bootstrap.js:14-16
Timestamp: 2024-11-06T07:27:01.722Z
Learning: In `packages/wallet-contract/test/bootstrap.js`, for Mocha tests in Node.js, async functions like `loadWasmDpp` can be assigned directly to `beforeAll` without wrapping them in another async function.

Applied to files:

  • packages/wasm-sdk/tests/unit/data-contract.spec.mjs
📚 Learning: 2025-06-18T03:44:14.385Z
Learnt from: QuantumExplorer
Repo: dashpay/platform PR: 2673
File: packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/identity_update/mod.rs:1164-1197
Timestamp: 2025-06-18T03:44:14.385Z
Learning: QuantumExplorer determined that a CodeRabbit suggestion about fixing signable_bytes calculation in identity update tests with contract-bound keys was incorrect - the code flow is working as intended without the suggested changes.

Applied to files:

  • packages/wasm-sdk/tests/unit/data-contract.spec.mjs
📚 Learning: 2025-12-29T10:53:03.792Z
Learnt from: shumkov
Repo: dashpay/platform PR: 2868
File: packages/wasm-sdk/tests/functional/addresses.spec.mjs:75-95
Timestamp: 2025-12-29T10:53:03.792Z
Learning: In this repository, tests use the dirty-chai plugin for Chai. Write assertions using the function-call style (e.g., expect(...).to.be.ok()) instead of the property-based style. Ensure dirty-chai is loaded in the test setup and documented so new tests conform to this pattern.

Applied to files:

  • packages/wasm-sdk/tests/unit/data-contract.spec.mjs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Rust packages (wasm-sdk) / Linting
  • GitHub Check: Rust packages (wasm-sdk) / Unused dependencies
  • GitHub Check: Rust packages (wasm-sdk) / Tests
  • GitHub Check: Build Docker images (Drive, drive, drive-abci, SDK_TEST_DATA=true
    ) / Build Drive image
  • GitHub Check: Build Docker images (Dashmate helper, dashmate-helper, dashmate-helper) / Build Dashmate helper image
  • GitHub Check: Build Docker images (RS-DAPI, rs-dapi, rs-dapi) / Build RS-DAPI image
  • GitHub Check: Build JS packages / Build JS
  • GitHub Check: Rust crates security audit
🔇 Additional comments (1)
packages/wasm-sdk/tests/unit/data-contract.spec.mjs (1)

79-111: LGTM! Test re-enablement looks good.

The test implementation is comprehensive and correctly validates V1 contract properties including tokens, groups, and keywords. The assertions follow the dirty-chai function-call style pattern, and memory management is properly handled with contract.free().

Since this test was previously skipped due to a serialization issue, please confirm that it passes in CI and not just locally.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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