Add ergoc JSON output ErgoTree construction#202
Conversation
🦋 Changeset detectedLatest commit: b41cc45 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #202 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 124 124
Lines 14157 14204 +47
Branches 1762 1776 +14
=========================================
+ Hits 14157 14204 +47 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@fleet-sdk/blockchain-providers
@fleet-sdk/common
@fleet-sdk/compiler
@fleet-sdk/core
@fleet-sdk/crypto
@fleet-sdk/mock-chain
@fleet-sdk/serializer
@fleet-sdk/wallet
@fleet-sdk/ageusd-plugin
@fleet-sdk/babel-fees-plugin
commit: |
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for constructing ErgoTree instances from ergoc compiler JSON output and enables replacing constants by name. The changes allow developers to work with compiler output more directly and manage constants using meaningful names instead of just numeric indices.
- Add
ErgoTree.from()static method to construct from JSON compiler output - Extend
replaceConstant()to accept string names in addition to numeric indices - Add named constant mapping functionality with private
#nameConstant()method
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/core/src/models/ergoTree.ts | Core implementation of JSON construction and named constant support |
| packages/core/src/models/ergoTree.spec.ts | Comprehensive test coverage for new functionality |
| .changeset/sour-ideas-flow.md | Changelog entry for JSON construction feature |
| .changeset/loose-ears-cheat.md | Changelog entry for named constants feature |
This PR introduces ErgoTree construction from ergoc JSON output and named constant replacement.
Example
Given the following output: