feat(mock-chain): support sigmastate-js 0.6.0#215
Conversation
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 detectedLatest 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 |
arobsn
left a comment
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
The only 0.6.0 version available in npm registry is 0.6.0-snapshot.d6573ab7c, please set the version to this.
There was a problem hiding this comment.
Is it better if I update the whole repo to that version? Would be great if fleet supports the newer ergotree versions.
There was a problem hiding this comment.
Yeah, that would be great! But Fleet has it's own lightweight serializer implementation, so new types need to be implemented by hand.
In regards to sigmastate-js as a dependency, it's only user in three places;
- top-level
package.jsondev dependency just to have it available in tests; - compiler package; and
- mock-chain package.
Sorry for the delay.
Summary
Updates
@fleet-sdk/mock-chainto supportsigmastate-js0.6.0, which adds v6 ErgoTree features (serialize/deserializeTo).Changes
AvlTree$.fromDigest(hex)withnew AvlTree(hex, false, false, false, 32, undefined)— theAvlTree$companion object andfromDigestfactory were removed in sigmastate-js 0.6.0AvlTree$type declaration fromsigmastate.d.tssigmastate-jsversion constraint to>=0.4.6for backward compatibilityContext
sigmastate-js0.6.0 adds compiler and interpreter support for v6 methods likeserialize()anddeserializeTo(). The only breaking change affecting fleet-sdk is the removal ofAvlTree$.fromDigest(), which was used inmockBlockchainStateContext()to create AvlTree instances for mock block headers.The
AvlTreeconstructor accepts the same parameters directly — digest hex, flags, key length, and optional value length — makingfromDigestunnecessary.