Skip to content

feat/upgrade modules 9#41

Merged
solidsnakedev merged 2 commits into
mainfrom
feat/upgrade-modules-9
Sep 9, 2025
Merged

feat/upgrade modules 9#41
solidsnakedev merged 2 commits into
mainfrom
feat/upgrade-modules-9

Conversation

@solidsnakedev
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings September 9, 2025 02:49
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 implements a comprehensive upgrade to the Effect Schema library (module version 9) across the evolution package. The changes modernize the schema definitions, update API usage patterns, and refactor type structures for better consistency and performance.

Key changes include:

  • Migration from legacy schema APIs to newer Schema patterns (e.g., Schema.BigIntFromSelfSchema.BigInt)
  • Consolidation of byte transformation schemas using built-in Schema.Uint8ArrayFromHex patterns
  • Refactoring of native script handling with new TaggedClass structure and improved CBOR encoding
  • Updates to Data module with proper recursive schema handling and runtime type definitions

Reviewed Changes

Copilot reviewed 87 out of 87 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/evolution/src/core/NativeScripts.ts Complete rewrite with TaggedClass structure and improved CBOR handling
packages/evolution/src/core/Data.ts Updated with proper recursive schemas and runtime vs encoded type separation
packages/evolution/src/core/Transaction.ts New complete transaction CBOR serialization implementation
packages/evolution/src/core/Function.ts Enhanced error handling with proper stack traces
packages/evolution/src/core/TransactionWitnessSet.ts Improved CBOR map handling and witness set parsing
Multiple byte modules Simplified to use Schema.Uint8ArrayFromHex instead of custom transformations
Multiple core modules Updated to use Schema.BigInt instead of Schema.BigIntFromSelf

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

it("property: Evolution SDK CBOR matches CML CBOR for any generated TransactionOutput", () => {
FastCheck.assert(
FastCheck.property(TransactionOutput.arbitrary(), (evOut) => {
FastCheck.property(TransactionOutput.arbitrary, (evOut) => {
Copy link

Copilot AI Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function call is missing parentheses. It should be TransactionOutput.arbitrary() to invoke the function that returns the FastCheck.Arbitrary.

Suggested change
FastCheck.property(TransactionOutput.arbitrary, (evOut) => {
FastCheck.property(TransactionOutput.arbitrary(), (evOut) => {

Copilot uses AI. Check for mistakes.
const invalidHexCases = ["not-hex", "xyz", "123g", "deadbeef ", " deadbeef", "0x123456"]

it.each(invalidHexCases)("should fail schema validation on invalid hex string: %s", (input) => {
expect(Data.isBytes(input)).toBe(false)
Copy link

Copilot AI Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is checking Data.isBytes(input) with a raw string input, but according to the updated Data module, isBytes expects a Uint8Array. The test should create a proper Data.bytearray() instance or use a different validation approach.

Suggested change
expect(Data.isBytes(input)).toBe(false)
expect(() => Data.bytearray(input)).toThrow()

Copilot uses AI. Check for mistakes.
@solidsnakedev solidsnakedev merged commit 6533312 into main Sep 9, 2025
3 of 5 checks passed
@solidsnakedev solidsnakedev deleted the feat/upgrade-modules-9 branch September 9, 2025 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants