feat: add ledger fields to contract-info.json#248
Open
RomarQ wants to merge 7 commits intoLFDT-Minokawa:mainfrom
Open
feat: add ledger fields to contract-info.json#248RomarQ wants to merge 7 commits intoLFDT-Minokawa:mainfrom
RomarQ wants to merge 7 commits intoLFDT-Minokawa:mainfrom
Conversation
Serialize all ledger fields with name, index, export status, storage kind and type parameters. Uses PascalCase ADT names for storage field. Handles B-tree path indices for contracts with >15 ledger fields. Signed-off-by: Rodrigo Quelhas <rodrigo_quelhas@outlook.pt>
Cover all ledger types (Cell, Counter, Map, Set, List, MerkleTree, HistoricMerkleTree), nested ADTs (Map<Field, Map<Field, Counter>>), and B-tree multi-element indices for >15 fields. Signed-off-by: Rodrigo Quelhas <rodrigo_quelhas@outlook.pt>
f8082c2 to
b5a1a98
Compare
Compactc E2E Tests Results 1 files ± 0 48 suites +47 2m 33s ⏱️ - 27m 26s Results for commit 645549e. ± Comparison against base commit fd5310c. This pull request removes 15000 and adds 467 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Plugin Test Summary 1 files 3 suites 1s ⏱️ Results for commit e8c1fff. ♻️ This comment has been updated with latest results. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements LFDT-Minokawa/compact#237
Adds a "ledger" key to contract-info.json containing an array of ledger field descriptors with name, path index, export status, storage kind, and fully-resolved type trees.
{ "ledger": [ { "name": "authority", "index": 0, "exported": false, "storage": "Cell", "type": { "type-name": "Bytes", "length": 32 } }, { "name": "state", "index": 2, "exported": false, "storage": "Cell", "type": { "type-name": "Enum", "name": "STATE", "elements": [ "unset", "set" ] } } ] }This enables language-agnostic tooling to discover a contract's ledger layout from the compiler output alone. One use case for this can be found in midnight-rust-bindgen, which uses the contract-info.json to generate rRust bindings for interacting with the contract from rust projects.