Skip to content

feat(mock-chain): support sigmastate-js 0.6.0#215

Open
Luivatra wants to merge 2 commits intofleet-sdk:masterfrom
Luivatra:feat/sigmastate-js-0.6.0
Open

feat(mock-chain): support sigmastate-js 0.6.0#215
Luivatra wants to merge 2 commits intofleet-sdk:masterfrom
Luivatra:feat/sigmastate-js-0.6.0

Conversation

@Luivatra
Copy link
Copy Markdown

@Luivatra Luivatra commented Apr 6, 2026

Summary

Updates @fleet-sdk/mock-chain to support sigmastate-js 0.6.0, which adds v6 ErgoTree features (serialize/deserializeTo).

Changes

  • Replace AvlTree$.fromDigest(hex) with new AvlTree(hex, false, false, false, 32, undefined) — the AvlTree$ companion object and fromDigest factory were removed in sigmastate-js 0.6.0
  • Remove AvlTree$ type declaration from sigmastate.d.ts
  • Relax sigmastate-js version constraint to >=0.4.6 for backward compatibility

Context

sigmastate-js 0.6.0 adds compiler and interpreter support for v6 methods like serialize() and deserializeTo(). The only breaking change affecting fleet-sdk is the removal of AvlTree$.fromDigest(), which was used in mockBlockchainStateContext() to create AvlTree instances for mock block headers.

The AvlTree constructor accepts the same parameters directly — digest hex, flags, key length, and optional value length — making fromDigest unnecessary.

Replace AvlTree$.fromDigest() (removed in 0.6.0) with the AvlTree
constructor. Remove the AvlTree$ type declaration. Relax the
sigmastate-js version constraint to >=0.4.6.

This enables mock-chain to work with sigmastate-js 0.6.0 which adds
support for v6 ErgoTree features (serialize/deserializeTo).
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 6, 2026

🦋 Changeset detected

Latest commit: 0835212

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Copy Markdown
Member

@arobsn arobsn left a comment

Choose a reason for hiding this comment

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

Hey! Thanks for your PR. CI is failing because you forget to include the updated pnpm-lock.yaml after bumping sigamstate-js version.

"diff": "^8.0.3",
"picocolors": "^1.1.1",
"sigmastate-js": "0.4.6"
"sigmastate-js": ">=0.4.6"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The only 0.6.0 version available in npm registry is 0.6.0-snapshot.d6573ab7c, please set the version to this.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Is it better if I update the whole repo to that version? Would be great if fleet supports the newer ergotree versions.

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