-
Notifications
You must be signed in to change notification settings - Fork 12
Add AVL Tree serialization #201
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: 3acfa64 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 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 ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #201 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 123 124 +1
Lines 14059 14157 +98
Branches 1740 1760 +20
=========================================
+ Hits 14059 14157 +98 ☔ 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
Adds end-to-end support for serializing and deserializing AVL Tree constants.
- Introduces
SAvlTreeTypeandSAvlTreeas a new monomorphic type - Registers AVL Tree handling in descriptors, type/data serializers, and wire formats
- Provides low-level
serializeAvlTree/deserializeAvlTree, test vectors, and round-trip tests
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| monomorphics.ts | Added SAvlTreeType |
| index.ts | Exported SAvlTree |
| descriptors.ts | Registered avlTree descriptor |
| constructors.ts | Defined SAvlTree constructor proxy |
| typeSerializer.ts | Handled avlTree in type serialization and deserialization |
| dataSerializer.ts | Plugged in serializeAvlTree/deserializeAvlTree branches |
| avlTreeSerializer.ts | Implemented flag parsing and (de)serialization of AVL data |
| sigmaByteWriter.ts | Added writeOption for optional values |
| sigmaByteReader.ts | Added readOption complement |
| constantVectors.ts | Added test vectors for AVL Tree |
| sigmaConstant.spec.ts | Added AVL Tree round-trip and flag tests |
| biome.json | Allowed use of const enum |
| .changeset/thirty-pears-listen.md | Documented feature bump |
Comments suppressed due to low confidence (4)
packages/serializer/src/serializers/avlTreeSerializer.ts:10
- [nitpick] Consider adding JSDoc comments to
AvlTreeFlagsandAvlTreeDatainterfaces to explain each property (e.g., bit meanings, expected digest format) and improve maintainability.
export interface AvlTreeData extends AvlTreeFlags {
packages/serializer/src/serializers/avlTreeSerializer.ts:18
- [nitpick] The
const enum AvlTreeFlagname is very similar to theAvlTreeFlagsinterface. Renaming it to something likeAvlTreeFlagEnumcould reduce confusion and clarify intent.
const enum AvlTreeFlag {
packages/serializer/src/serializers/avlTreeSerializer.ts:24
- It would be valuable to add direct unit tests for
serializeAvlTreeanddeserializeAvlTreeto cover flag combinations and optional valueLength encoding separately from the SConstant round-trip tests.
export function serializeAvlTree(
packages/serializer/src/types/monomorphics.ts:25
- The generic parameter for
SAvlTreeTypecurrently mirrorsBox<bigint>. It should reflect the actualAvlTreeDataconstant type (e.g.SMonomorphicType<SConstant<AvlTreeData>>) and importAvlTreeDataaccordingly to keep type signatures correct.
export class SAvlTreeType extends SMonomorphicType<SConstant<Box<bigint>>> {
No description provided.