-
Notifications
You must be signed in to change notification settings - Fork 12
Add ergoc JSON output ErgoTree construction #202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: