Skip to content

ci(changesets): version packages#67

Merged
solidsnakedev merged 1 commit into
mainfrom
changeset-release/main
Nov 21, 2025
Merged

ci(changesets): version packages#67
solidsnakedev merged 1 commit into
mainfrom
changeset-release/main

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@evolution-sdk/evolution@0.2.3

Patch Changes

  • #66 29c3e4d Thanks @solidsnakedev! - Fixed field ordering bug in TSchema.Struct encode function that caused fields to be swapped during CBOR encoding when using NullOr/UndefinedOr.

    Before:

    const CredentialSchema = TSchema.Union(
      TSchema.Struct({ pubKeyHash: TSchema.ByteArray }, { flatFields: true }),
      TSchema.Struct({ scriptHash: TSchema.ByteArray }, { flatFields: true })
    )
    
    const AddressSchema = TSchema.Struct({
      paymentCredential: CredentialSchema,
      stakeCredential: TSchema.NullOr(TSchema.Integer)
    })
    
    const Foo = TSchema.Union(TSchema.Struct({ foo: AddressSchema }, { flatFields: true }))
    
    const input = {
      foo: {
        paymentCredential: { pubKeyHash: fromHex("deadbeef") },
        stakeCredential: null
      }
    }
    
    const encoded = Data.withSchema(Foo).toData(input)
    // BUG: Fields were swapped in innerStruct!
    // innerStruct.fields[0] = Constr(1, [])      // stakeCredential (null) - WRONG!
    // innerStruct.fields[1] = Constr(0, [...])   // paymentCredential - WRONG!

    After:

    const CredentialSchema = TSchema.Union(
      TSchema.Struct({ pubKeyHash: TSchema.ByteArray }, { flatFields: true }),
      TSchema.Struct({ scriptHash: TSchema.ByteArray }, { flatFields: true })
    )
    
    const AddressSchema = TSchema.Struct({
      paymentCredential: CredentialSchema,
      stakeCredential: TSchema.NullOr(TSchema.Integer)
    })
    
    const Foo = TSchema.Union(TSchema.Struct({ foo: AddressSchema }, { flatFields: true }))
    
    const input = {
      foo: {
        paymentCredential: { pubKeyHash: fromHex("deadbeef") },
        stakeCredential: null
      }
    }
    
    const encoded = Data.withSchema(Foo).toData(input)
    // FIXED: Fields now in correct order matching schema!
    // innerStruct.fields[0] = Constr(0, [...])   // paymentCredential - CORRECT!
    // innerStruct.fields[1] = Constr(1, [])      // stakeCredential (null) - CORRECT!

docs@0.0.3

Patch Changes

  • Updated dependencies [29c3e4d]:
    • @evolution-sdk/evolution@0.2.3

@solidsnakedev solidsnakedev merged commit 793c4d4 into main Nov 21, 2025
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.

1 participant