Skip to content

Revert "feat: update to Evo SDK 3.0.0"#30

Merged
thephez merged 1 commit into
masterfrom
revert-20-chore/update-to-2.2
Jan 14, 2026
Merged

Revert "feat: update to Evo SDK 3.0.0"#30
thephez merged 1 commit into
masterfrom
revert-20-chore/update-to-2.2

Conversation

@thephez

@thephez thephez commented Jan 14, 2026

Copy link
Copy Markdown
Collaborator

Reverts #20 due to issues including #28 and #29.

Edit: test issues resulted at least in part from this commit that effectively neutered many tests. They passed because they were validating very little: b78aa1c#diff-92463ce9e596a6d8eb71e93509be51a9a12cfb043bed5ab845050ea56ef6cedc

Claude evaluation:
The commit systematically weakened almost all validation functions to the point where they no longer catch real issues. Here are the key problems:

Critical Issues:

  • getStatus validation - Changed from checking for specific fields (version, node, chain, network, stateSync, time) to accepting ANY string or ANY object
  • getCurrentQuorumsInfo - Removed validation that quorums array exists
  • getPrefundedSpecializedBalance - Removed identityId and balance field checks
  • validateIdentityResult - Lost publicKeys and balance field validation
  • validateKeysResult - Removed keyId and purpose validation; empty arrays now pass
  • validateIdentitiesContractKeysResult - Completely gutted; was checking identityId, keys array, and each key's keyId, purpose, keyType, publicKeyData, securityLevel - now just checks typeof === 'object'
  • validateDocumentResult - Removed ownerId validation
  • validateContractResult - Removed config validation
  • Multiple validators reduced to expect(typeof data).toBe('object') which passes for {}, [], or any object

Summary by CodeRabbit

Release Notes

  • Chores

    • Updated SDK and package manager dependencies.
  • Breaking Changes

    • Removed Platform Address query and transition APIs.
    • Renamed Token Emergency Action to Config Update.
    • Updated multiple API method names and parameter structures across identity, contract, document, voting, and group operations.
    • Deprecated several query parameters; refer to updated API reference documentation.
  • Documentation

    • Comprehensive updates to API reference with revised method signatures and field names.

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

@coderabbitai

coderabbitai Bot commented Jan 14, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This pull request updates the SDK API surface by renaming parameters (dataContractId → contractId, documentTypeName → type), removing deprecated platform address APIs, rebranching token operations (emergencyAction → configUpdate), and downgrading dependencies. Corresponding test fixtures, validators, and documentation are updated to align with the new API shapes.

Changes

Cohort / File(s) Summary
Dependency and Configuration Updates
package.json
Downgraded @dashevo/evo-sdk from 3.0.0-rc.1 to 2.1.3 and yarn from 4.12.0 to 4.0.2. Minor formatting/newline adjustments.
API Reference Documentation
public/AI_REFERENCE.md
Extensive signature updates across identities, documents, contracts, tokens, groups, voting, and protocol methods. Key renames: request → keyRequestType, dataContractId → contractId, documentTypeName → type. Removed addresses.\* methods. Renamed tokens.emergencyAction → tokens.configUpdate and contracts.publish → contracts.create. Updated parameter shapes for proof-based queries (startAtMs/startAt fields, JSON-serialized where/orderBy).
API Definitions and Application Logic
public/api-definitions.json, public/app.js
Synchronized field renames (requestType/keyRequestType, dataContractId/contractId, documentTypeName/documentType) across API definitions. Removed platform address queries and Platform Address Transitions. Replaced tokenEmergencyAction with tokenConfigUpdate in SUPPORTED_TRANSITIONS and TRANSITION_AUTH_REQUIREMENTS. Updated payload shapes for documents, contracts, identity operations, DPNS, and group/voting methods. Simplified formatResult to remove WASM-specific handling.
Documentation Generator
scripts/generate_docs.py
Updated example payloads for all renamed query/transition operations to match new API signatures. Removed calculateTokenId, platform address examples, and complex WASM serialization logic. Adjusted proof parameter shapes and pagination fields (limit/offset/count).
User Interface
public/index.html
Cosmetic formatting and attribute consolidation; no functional changes.
Test Fixtures and Data
tests/e2e/fixtures/test-data.js
Updated test data parameter names (requestType → keyRequestType, dataContractId → contractId, documentTypeName → documentType). Added explicit offset fields, renamed startAtMs → offset in multiple blocks. Updated epoch values and count fields.
Test Validation Logic
tests/e2e/queries/query-execution.spec.js
Rewrote validators (validateContractResult, validateDocumentResult, validateIdentitiesResult, etc.) to enforce new public-field assertions (id, config, publicKeys, balance, etc.). Updated result parsing to handle dataContracts array structure and resultData.data payload location in proof contexts. Enhanced multi-entity validators to iterate and validate nested structures.
Smoke Tests and Integration Tests
tests/e2e/smoke/basic-smoke.spec.js, tests/e2e/transitions/state-transitions.spec.js
Removed Platform Address Transitions and Platform Address Queries test categories. Replaced "Token Emergency Action" with "Token Config Update" in test options. Removed environment-variable gating for state-transition test suite (TEST_PRIVATE_KEY_CONTRACT).
Test Utilities
tests/e2e/utils/parameter-injector.js, tests/e2e/utils/sdk-page.js
Added guards to warn and skip processing when test parameter sets are empty. Simplified fillParameterByName to accept only (paramName, value); removed isStateTransition flag. Updated selectors and fallback logic to use paramName consistently. Adjusted multiselect handling for purposes and array parameter detection.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~65 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 36.84% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately reflects the main objective: reverting a previous SDK upgrade. It directly summarizes the primary change in the changeset.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

@thephez thephez requested a review from shumkov January 14, 2026 15:32

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/generate_docs.py (1)

90-127: Doc example: use numeric startAtMs instead of string.
According to Dash Platform SDK documentation, startAtMs is a timestamp in milliseconds (number type), not a string. Change startAtMs: '0' to startAtMs: 0 to ensure the example matches the expected parameter type.

Proposed change
-                startAtMs: '0'
+                startAtMs: 0
🧹 Nitpick comments (2)
tests/e2e/queries/query-execution.spec.js (2)

50-77: Potential precision loss: “large numbers” parsed via Number().
If balances/nonces can exceed Number.MAX_SAFE_INTEGER, these assertions may silently validate the wrong value. Consider returning a bigint (or a string) and asserting on non-negativity/format accordingly.


236-245: Harden validators that assume array payloads.
validateKeysResult, validateTokenBalanceResult, and validateTokenInfoResult iterate with .forEach but don’t assert Array.isArray(...) first; a shape change will throw a confusing runtime error instead of a clear assertion failure.

Also applies to: 306-323

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b83a2b9 and af40da9.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (12)
  • package.json
  • public/AI_REFERENCE.md
  • public/api-definitions.json
  • public/app.js
  • public/index.html
  • scripts/generate_docs.py
  • tests/e2e/fixtures/test-data.js
  • tests/e2e/queries/query-execution.spec.js
  • tests/e2e/smoke/basic-smoke.spec.js
  • tests/e2e/transitions/state-transitions.spec.js
  • tests/e2e/utils/parameter-injector.js
  • tests/e2e/utils/sdk-page.js
💤 Files with no reviewable changes (1)
  • tests/e2e/transitions/state-transitions.spec.js
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-09-29T14:09:25.873Z
Learnt from: thephez
Repo: dashpay/evo-sdk-website PR: 1
File: tests/e2e/transitions/state-transitions.spec.js:237-378
Timestamp: 2025-09-29T14:09:25.873Z
Learning: Token operations in the Evo SDK (mint, transfer, burn, freeze, destroy frozen, unfreeze, claim, set price, direct purchase, config update) return empty objects {} on success rather than detailed response objects with transaction data.

Applied to files:

  • tests/e2e/smoke/basic-smoke.spec.js
📚 Learning: 2025-09-29T13:39:22.810Z
Learnt from: thephez
Repo: dashpay/evo-sdk-website PR: 1
File: tests/e2e/smoke/basic-smoke.spec.js:149-163
Timestamp: 2025-09-29T13:39:22.810Z
Learning: The EvoSdkPage class extends BaseTest, which provides the clearResults() method that clicks `#clearButton` and waits for `#identityInfo` to have the 'empty' class. Tests using evoSdkPage.clearResults() are valid due to this inheritance relationship.

Applied to files:

  • tests/e2e/smoke/basic-smoke.spec.js
  • tests/e2e/queries/query-execution.spec.js
📚 Learning: 2025-10-28T13:24:46.894Z
Learnt from: thephez
Repo: dashpay/evo-sdk-website PR: 16
File: .github/workflows/update-evo-sdk.yml:34-56
Timestamp: 2025-10-28T13:24:46.894Z
Learning: In the dashpay/evo-sdk-website repository, package.json must contain exact version numbers for dashevo/evo-sdk without any version specifiers (no ^, ~, >=, etc.). If version specifiers are present, the workflow should fail.

Applied to files:

  • package.json
  • public/index.html
🧬 Code graph analysis (2)
tests/e2e/utils/sdk-page.js (1)
public/app.js (10)
  • value (1257-1257)
  • value (1263-1263)
  • value (1268-1268)
  • value (1276-1276)
  • value (1297-1297)
  • value (1306-1306)
  • value (1313-1313)
  • value (1476-1476)
  • value (1501-1501)
  • input (1243-1243)
tests/e2e/utils/parameter-injector.js (1)
public/app.js (1)
  • element (1549-1549)
🪛 Gitleaks (8.30.0)
public/AI_REFERENCE.md

[high] 1064-1064: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


[high] 1117-1117: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

⏰ 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). (1)
  • GitHub Check: Run SDK Site UI Tests
🔇 Additional comments (28)
package.json (2)

4-4: LGTM - Version downgrade aligns with revert objectives.

The exact version 2.1.3 complies with the repository requirement for exact version numbers without specifiers. Based on learnings, this format is correct.


25-25: Verify yarn version compatibility.

The packageManager is downgraded from yarn@4.12.0 to yarn@4.0.2. Ensure this older yarn version is compatible with the project's lockfile and CI environment.

public/index.html (1)

1-187: LGTM - Cosmetic formatting changes only.

All changes in this file are whitespace and line-break adjustments to inline attributes and styles. No functional or behavioral changes to the DOM structure, CSP policy, or UI elements.

tests/e2e/utils/parameter-injector.js (1)

1-309: LGTM - Whitespace-only changes.

All modifications in this file are blank line adjustments. The parameter injection logic, field mappings, and validation functions remain unchanged.

tests/e2e/utils/sdk-page.js (2)

130-209: LGTM - Simplified parameter filling API.

The fillParameterByName method signature was simplified by removing the isStateTransition parameter. The method now uses paramName directly for all selector building and lookups, which is cleaner and consistent with the SDK downgrade. The caller at line 604 correctly uses the updated signature.


249-252: Minor: Filter syntax is correct but consider readability.

The .filter({ hasNot: ... }) pattern with Playwright locators is correct. This filters out readonly inputs when handling array values.

tests/e2e/fixtures/test-data.js (5)

87-93: LGTM - Parameter renamed to match SDK 2.1.3 API.

The requestTypekeyRequestType rename aligns with the older SDK API surface for getIdentityKeys.


225-245: LGTM - Document query parameters updated.

The documentType parameter (previously documentTypeName) is correctly used in document queries, aligning with the SDK 2.1.3 API.


436-484: LGTM - Voting parameters aligned with SDK 2.1.3.

Key changes:

  • contractId used consistently in voting queries
  • resultType: "contenders" (was documentsAndVoteTally)
  • allowIncludeLockedAndAbstainingVoteTally (was includeLockedAndAbstaining)
  • count instead of limit in some contexts

These match the expected API shape for the older SDK version.


612-692: LGTM - Document state transition parameters updated.

All document-related state transitions (documentCreate, documentReplace, documentDelete, documentTransfer, documentPurchase, documentSetPrice) correctly use:

  • contractId (instead of dataContractId)
  • documentType (instead of documentTypeName)

This is consistent with the SDK 2.1.3 state transition API.


214-222: Parameter naming is intentional and matches API specification.

The mixed naming in the test data is correct: getDataContractHistory uses dataContractId while other endpoints like getContestedResources use contractId. The public API definitions confirm each endpoint specifies its own parameter names, so the test data properly reflects the SDK's actual API contract.

public/api-definitions.json (4)

49-91: LGTM - Field rename and dependency wiring are consistent.

The keyRequestType rename (from requestType) is correctly applied, and the dependsOn.field references at lines 74 and 87 properly reference the new keyRequestType field name. The searchPurposeMap rename (from purposeMap) is also consistent.


2151-2232: LGTM - Token config update transition is well-structured.

The tokenConfigUpdate transition (replacing the previous tokenEmergencyAction) provides a comprehensive set of configuration options with clear labels. The SDK method tokens.configUpdate aligns with the updated API surface.


1718-1718: SDK method rename looks correct.

The contracts.create method name is more intuitive than the previous contracts.publish.


832-864: LGTM - Vote polls query supports both standard and proof modes.

The getVotePollsByEndDate query now properly documents the dual-mode time filtering: JSON-based startTimeInfo/endTimeInfo for standard responses, and millisecond timestamps (startTimeMs/endTimeMs) when proofs are enabled. The help text clearly indicates which fields to use in each mode.

public/AI_REFERENCE.md (4)

1064-1064: Static analysis false positive - example placeholder key in documentation.

The Gitleaks warning about a "Generic API Key" at this line is a false positive. This is an intentionally documented example WIF private key (XFfpaSbZq52HPy3WWwe1dXsZMiU1bQn8vQd34HNXkSZThevBWRn1) used to illustrate SDK usage patterns. The documentation explicitly shows this as a placeholder value in a code example.


85-88: LGTM - Documentation example matches API definition.

The keyRequestType parameter in the example correctly matches the renamed field in api-definitions.json.


1461-1479: LGTM - Token config update documentation is comprehensive.

The tokens.configUpdate transition documentation correctly lists all available configItemType options (conventions, max_supply, perpetual_distribution, etc.) matching the options defined in api-definitions.json.


292-297: The example is correct. The SDK method contracts.getHistory() accepts contractId as the parameter name (as shown in app.js line 2057). The dataContractId name in api-definitions.json is the UI/API layer parameter definition, which is mapped to contractId when calling the SDK method. No changes needed.

tests/e2e/smoke/basic-smoke.spec.js (2)

305-328: Confirm UI label text for “Token Config Update” matches exactly.
The expectation now includes 'Token Config Update'; if the UI label is slightly different (e.g., “Token ConfigUpdate” / “Token Config update”), this will fail even if the underlying operation is correct.


361-374: Good: stricter query category assertions via ensureExactOptions.
This should make category drift/duplicates much easier to diagnose than set-based comparisons.

tests/e2e/queries/query-execution.spec.js (1)

14-42: Nice stability improvement: wait for proof toggle to actually be checked.
This should reduce flakes where queries run before proof mode is applied.

scripts/generate_docs.py (2)

614-629: Output formatting simplification is solid.
JSON.stringify(output, null, 2) is predictable and readable for docs examples.


136-214: Code examples align with @dashevo/evo-sdk v2.1.3 APIs.

Verified method signatures:

  • dpns.usernames(identityId, { limit }) — correctly used at line 140
  • tokens.configUpdate(payload) — correctly used at line 373
  • tokens.setPriceForDirectPurchase(payload) — correctly used at line 370

Note: dpns.usernamesWithProof() could not be verified in v2.1.3 documentation and does not appear in the code examples, so no action needed.

public/app.js (4)

79-86: Good: tokenConfigUpdate is wired end-to-end (supported transitions + auth requirements).
This matches the rename and should keep the UI consistent with the available transition.

Also applies to: 343-346


1966-1988: Good guardrail: disallow proof mode for identity key “search”.
Failing fast here is preferable to returning confusing partial results.


2437-2446: Result formatting looks correct, especially for {} token transition successes.
Given token transitions often return {} on success, JSON.stringify will produce a clear {} output in the UI. Based on learnings, token operations returning {} is expected.


2054-2059: Remove suggestion: input field for getDataContractHistory is dataContractId, not contractId.

The API definitions and test data confirm the documented input field is dataContractId, not contractId. The current code correctly uses n.dataContractId || n.id and does not need modification. The proposed fix would add support for a non-existent input field.

Likely an incorrect or invalid review comment.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@thephez thephez merged commit d7ffb5a into master Jan 14, 2026
2 checks passed
@thephez thephez deleted the revert-20-chore/update-to-2.2 branch January 14, 2026 17:18
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