Skip to content

Commit 793c4d4

Browse files
Merge pull request #67 from IntersectMBO/changeset-release/main
ci(changesets): version packages
2 parents 537aff1 + bc983b1 commit 793c4d4

File tree

5 files changed

+71
-66
lines changed

5 files changed

+71
-66
lines changed

.changeset/chilly-brooms-end.md

Lines changed: 0 additions & 64 deletions
This file was deleted.

docs/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# docs
22

3+
## 0.0.3
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [[`29c3e4d`](https://github.com/IntersectMBO/evolution-sdk/commit/29c3e4d3bac9b35c1586c6a94d6aee037aeb6d62)]:
8+
- @evolution-sdk/evolution@0.2.3
9+
310
## 0.0.2
411

512
### Patch Changes

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docs",
3-
"version": "0.0.2",
3+
"version": "0.0.3",
44
"private": true,
55
"type": "module",
66
"scripts": {

packages/evolution/CHANGELOG.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,67 @@
11
# @evolution-sdk/evolution
22

3+
## 0.2.3
4+
5+
### Patch Changes
6+
7+
- [#66](https://github.com/IntersectMBO/evolution-sdk/pull/66) [`29c3e4d`](https://github.com/IntersectMBO/evolution-sdk/commit/29c3e4d3bac9b35c1586c6a94d6aee037aeb6d62) Thanks [@solidsnakedev](https://github.com/solidsnakedev)! - Fixed field ordering bug in TSchema.Struct encode function that caused fields to be swapped during CBOR encoding when using NullOr/UndefinedOr.
8+
9+
**Before:**
10+
11+
```typescript
12+
const CredentialSchema = TSchema.Union(
13+
TSchema.Struct({ pubKeyHash: TSchema.ByteArray }, { flatFields: true }),
14+
TSchema.Struct({ scriptHash: TSchema.ByteArray }, { flatFields: true })
15+
)
16+
17+
const AddressSchema = TSchema.Struct({
18+
paymentCredential: CredentialSchema,
19+
stakeCredential: TSchema.NullOr(TSchema.Integer)
20+
})
21+
22+
const Foo = TSchema.Union(TSchema.Struct({ foo: AddressSchema }, { flatFields: true }))
23+
24+
const input = {
25+
foo: {
26+
paymentCredential: { pubKeyHash: fromHex("deadbeef") },
27+
stakeCredential: null
28+
}
29+
}
30+
31+
const encoded = Data.withSchema(Foo).toData(input)
32+
// BUG: Fields were swapped in innerStruct!
33+
// innerStruct.fields[0] = Constr(1, []) // stakeCredential (null) - WRONG!
34+
// innerStruct.fields[1] = Constr(0, [...]) // paymentCredential - WRONG!
35+
```
36+
37+
**After:**
38+
39+
```typescript
40+
const CredentialSchema = TSchema.Union(
41+
TSchema.Struct({ pubKeyHash: TSchema.ByteArray }, { flatFields: true }),
42+
TSchema.Struct({ scriptHash: TSchema.ByteArray }, { flatFields: true })
43+
)
44+
45+
const AddressSchema = TSchema.Struct({
46+
paymentCredential: CredentialSchema,
47+
stakeCredential: TSchema.NullOr(TSchema.Integer)
48+
})
49+
50+
const Foo = TSchema.Union(TSchema.Struct({ foo: AddressSchema }, { flatFields: true }))
51+
52+
const input = {
53+
foo: {
54+
paymentCredential: { pubKeyHash: fromHex("deadbeef") },
55+
stakeCredential: null
56+
}
57+
}
58+
59+
const encoded = Data.withSchema(Foo).toData(input)
60+
// FIXED: Fields now in correct order matching schema!
61+
// innerStruct.fields[0] = Constr(0, [...]) // paymentCredential - CORRECT!
62+
// innerStruct.fields[1] = Constr(1, []) // stakeCredential (null) - CORRECT!
63+
```
64+
365
## 0.2.2
466

567
### Patch Changes

packages/evolution/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@evolution-sdk/evolution",
3-
"version": "0.2.2",
3+
"version": "0.2.3",
44
"description": "A modern TypeScript SDK for Cardano blockchain development",
55
"type": "module",
66
"main": "./dist/index.js",

0 commit comments

Comments
 (0)