Skip to content

Commit c54bb4a

Browse files
Merge pull request #39 from no-witness-labs/feat/upgrade-modules-8
feat/upgrade modules 8
2 parents e0bc87b + aecf79e commit c54bb4a

26 files changed

+640
-421
lines changed

packages/evolution/src/core/Bytes128.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,9 @@ export class Bytes128Error extends Data.TaggedError("Bytes128Error")<{
2727
*/
2828
export const BYTES_LENGTH = 128
2929

30-
export const BytesSchema = Schema.Uint8ArrayFromSelf.pipe(
31-
Bytes.bytesLengthEquals(BYTES_LENGTH)
32-
)
30+
export const BytesSchema = Schema.Uint8ArrayFromSelf.pipe(Bytes.bytesLengthEquals(BYTES_LENGTH))
3331

34-
export const HexSchema = Bytes.HexSchema.pipe(
35-
Bytes.hexLengthEquals(BYTES_LENGTH)
36-
)
32+
export const HexSchema = Bytes.HexSchema.pipe(Bytes.hexLengthEquals(BYTES_LENGTH))
3733

3834
/**
3935
* Schema transformation for fixed-length bytes
@@ -49,9 +45,7 @@ export const FromHex = Bytes.makeBytesTransformation({
4945
encode: Bytes.toHexUnsafe
5046
})
5147

52-
export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(
53-
Bytes.bytesLengthBetween(0, BYTES_LENGTH)
54-
)
48+
export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(Bytes.bytesLengthBetween(0, BYTES_LENGTH))
5549

5650
/**
5751
* Schema transformation for variable-length bytes (0..BYTES_LENGTH).
@@ -61,9 +55,7 @@ export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(
6155
*/
6256
export const VariableBytesFromHex = Bytes.makeBytesTransformation({
6357
id: `Bytes${BYTES_LENGTH}.VariableBytes${BYTES_LENGTH}FromHex`,
64-
stringSchema: Bytes.HexLenientSchema.pipe(
65-
Bytes.hexLengthBetween(0, BYTES_LENGTH)
66-
),
58+
stringSchema: Bytes.HexLenientSchema.pipe(Bytes.hexLengthBetween(0, BYTES_LENGTH)),
6759
uint8ArraySchema: VariableBytes,
6860
decode: Bytes.fromHexLenient,
6961
encode: Bytes.toHexLenientUnsafe

packages/evolution/src/core/Bytes16.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,9 @@ export class Bytes16Error extends Data.TaggedError("Bytes16Error")<{
2727
*/
2828
export const BYTES_LENGTH = 16
2929

30-
export const BytesSchema = Schema.Uint8ArrayFromSelf.pipe(
31-
Bytes.bytesLengthEquals(BYTES_LENGTH)
32-
)
30+
export const BytesSchema = Schema.Uint8ArrayFromSelf.pipe(Bytes.bytesLengthEquals(BYTES_LENGTH))
3331

34-
export const HexSchema = Bytes.HexSchema.pipe(
35-
Bytes.hexLengthEquals(BYTES_LENGTH)
36-
)
32+
export const HexSchema = Bytes.HexSchema.pipe(Bytes.hexLengthEquals(BYTES_LENGTH))
3733

3834
/**
3935
* Schema transformation for fixed-length bytes
@@ -49,9 +45,7 @@ export const FromHex = Bytes.makeBytesTransformation({
4945
encode: Bytes.toHexUnsafe
5046
})
5147

52-
export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(
53-
Bytes.bytesLengthBetween(0, BYTES_LENGTH)
54-
)
48+
export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(Bytes.bytesLengthBetween(0, BYTES_LENGTH))
5549

5650
/**
5751
* Schema transformation for variable-length bytes (0..BYTES_LENGTH).
@@ -61,9 +55,7 @@ export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(
6155
*/
6256
export const VariableBytesFromHex = Bytes.makeBytesTransformation({
6357
id: `Bytes${BYTES_LENGTH}.VariableBytes${BYTES_LENGTH}FromHex`,
64-
stringSchema: Bytes.HexLenientSchema.pipe(
65-
Bytes.hexLengthBetween(0, BYTES_LENGTH)
66-
),
58+
stringSchema: Bytes.HexLenientSchema.pipe(Bytes.hexLengthBetween(0, BYTES_LENGTH)),
6759
uint8ArraySchema: VariableBytes,
6860
decode: Bytes.fromHexLenient,
6961
encode: Bytes.toHexLenientUnsafe

packages/evolution/src/core/Bytes29.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,9 @@ export class Bytes29Error extends Data.TaggedError("Bytes29Error")<{
2727
*/
2828
export const BYTES_LENGTH = 29
2929

30-
export const BytesSchema = Schema.Uint8ArrayFromSelf.pipe(
31-
Bytes.bytesLengthEquals(BYTES_LENGTH)
32-
)
30+
export const BytesSchema = Schema.Uint8ArrayFromSelf.pipe(Bytes.bytesLengthEquals(BYTES_LENGTH))
3331

34-
export const HexSchema = Bytes.HexSchema.pipe(
35-
Bytes.hexLengthEquals(BYTES_LENGTH)
36-
)
32+
export const HexSchema = Bytes.HexSchema.pipe(Bytes.hexLengthEquals(BYTES_LENGTH))
3733

3834
/**
3935
* Schema transformation for fixed-length bytes
@@ -49,9 +45,7 @@ export const FromHex = Bytes.makeBytesTransformation({
4945
encode: Bytes.toHexUnsafe
5046
})
5147

52-
export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(
53-
Bytes.bytesLengthBetween(0, BYTES_LENGTH)
54-
)
48+
export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(Bytes.bytesLengthBetween(0, BYTES_LENGTH))
5549

5650
/**
5751
* Schema transformation for variable-length bytes (0..BYTES_LENGTH).
@@ -61,9 +55,7 @@ export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(
6155
*/
6256
export const VariableBytesFromHex = Bytes.makeBytesTransformation({
6357
id: `Bytes${BYTES_LENGTH}.VariableBytes${BYTES_LENGTH}FromHex`,
64-
stringSchema: Bytes.HexLenientSchema.pipe(
65-
Bytes.hexLengthBetween(0, BYTES_LENGTH)
66-
),
58+
stringSchema: Bytes.HexLenientSchema.pipe(Bytes.hexLengthBetween(0, BYTES_LENGTH)),
6759
uint8ArraySchema: VariableBytes,
6860
decode: Bytes.fromHexLenient,
6961
encode: Bytes.toHexLenientUnsafe

packages/evolution/src/core/Bytes32.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,9 @@ export class Bytes32Error extends Data.TaggedError("Bytes32Error")<{
2727
*/
2828
export const BYTES_LENGTH = 32
2929

30-
export const BytesSchema = Schema.Uint8ArrayFromSelf.pipe(
31-
Bytes.bytesLengthEquals(BYTES_LENGTH)
32-
)
30+
export const BytesSchema = Schema.Uint8ArrayFromSelf.pipe(Bytes.bytesLengthEquals(BYTES_LENGTH))
3331

34-
export const HexSchema = Bytes.HexSchema.pipe(
35-
Bytes.hexLengthEquals(BYTES_LENGTH)
36-
)
32+
export const HexSchema = Bytes.HexSchema.pipe(Bytes.hexLengthEquals(BYTES_LENGTH))
3733

3834
/**
3935
* Schema transformation for fixed-length bytes
@@ -49,9 +45,7 @@ export const FromHex = Bytes.makeBytesTransformation({
4945
encode: Bytes.toHexUnsafe
5046
})
5147

52-
export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(
53-
Bytes.bytesLengthBetween(0, BYTES_LENGTH)
54-
)
48+
export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(Bytes.bytesLengthBetween(0, BYTES_LENGTH))
5549

5650
/**
5751
* Schema transformation for variable-length bytes (0..BYTES_LENGTH).
@@ -61,9 +55,7 @@ export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(
6155
*/
6256
export const VariableBytesFromHex = Bytes.makeBytesTransformation({
6357
id: `Bytes${BYTES_LENGTH}.VariableBytes${BYTES_LENGTH}FromHex`,
64-
stringSchema: Bytes.HexLenientSchema.pipe(
65-
Bytes.hexLengthBetween(0, BYTES_LENGTH)
66-
),
58+
stringSchema: Bytes.HexLenientSchema.pipe(Bytes.hexLengthBetween(0, BYTES_LENGTH)),
6759
uint8ArraySchema: VariableBytes,
6860
decode: Bytes.fromHexLenient,
6961
encode: Bytes.toHexLenientUnsafe

packages/evolution/src/core/Bytes4.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,9 @@ export class Bytes4Error extends Data.TaggedError("Bytes4Error")<{
2727
*/
2828
export const BYTES_LENGTH = 4
2929

30-
export const BytesSchema = Schema.Uint8ArrayFromSelf.pipe(
31-
Bytes.bytesLengthEquals(BYTES_LENGTH)
32-
)
30+
export const BytesSchema = Schema.Uint8ArrayFromSelf.pipe(Bytes.bytesLengthEquals(BYTES_LENGTH))
3331

34-
export const HexSchema = Bytes.HexSchema.pipe(
35-
Bytes.hexLengthEquals(BYTES_LENGTH)
36-
)
32+
export const HexSchema = Bytes.HexSchema.pipe(Bytes.hexLengthEquals(BYTES_LENGTH))
3733

3834
/**
3935
* Schema transformation for fixed-length bytes
@@ -49,9 +45,7 @@ export const FromHex = Bytes.makeBytesTransformation({
4945
encode: Bytes.toHexUnsafe
5046
})
5147

52-
export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(
53-
Bytes.bytesLengthBetween(0, BYTES_LENGTH)
54-
)
48+
export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(Bytes.bytesLengthBetween(0, BYTES_LENGTH))
5549

5650
/**
5751
* Schema transformation for variable-length bytes (0..BYTES_LENGTH).
@@ -61,9 +55,7 @@ export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(
6155
*/
6256
export const VariableBytesFromHex = Bytes.makeBytesTransformation({
6357
id: `Bytes${BYTES_LENGTH}.VariableBytes${BYTES_LENGTH}FromHex`,
64-
stringSchema: Bytes.HexLenientSchema.pipe(
65-
Bytes.hexLengthBetween(0, BYTES_LENGTH)
66-
),
58+
stringSchema: Bytes.HexLenientSchema.pipe(Bytes.hexLengthBetween(0, BYTES_LENGTH)),
6759
uint8ArraySchema: VariableBytes,
6860
decode: Bytes.fromHexLenient,
6961
encode: Bytes.toHexLenientUnsafe

packages/evolution/src/core/Bytes448.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,9 @@ export class Bytes448Error extends Data.TaggedError("Bytes448Error")<{
2727
*/
2828
export const BYTES_LENGTH = 448
2929

30-
export const BytesSchema = Schema.Uint8ArrayFromSelf.pipe(
31-
Bytes.bytesLengthEquals(BYTES_LENGTH)
32-
)
30+
export const BytesSchema = Schema.Uint8ArrayFromSelf.pipe(Bytes.bytesLengthEquals(BYTES_LENGTH))
3331

34-
export const HexSchema = Bytes.HexSchema.pipe(
35-
Bytes.hexLengthEquals(BYTES_LENGTH)
36-
)
32+
export const HexSchema = Bytes.HexSchema.pipe(Bytes.hexLengthEquals(BYTES_LENGTH))
3733

3834
/**
3935
* Schema transformation for fixed-length bytes
@@ -49,9 +45,7 @@ export const FromHex = Bytes.makeBytesTransformation({
4945
encode: Bytes.toHexUnsafe
5046
})
5147

52-
export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(
53-
Bytes.bytesLengthBetween(0, BYTES_LENGTH)
54-
)
48+
export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(Bytes.bytesLengthBetween(0, BYTES_LENGTH))
5549

5650
/**
5751
* Schema transformation for variable-length bytes (0..BYTES_LENGTH).
@@ -61,9 +55,7 @@ export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(
6155
*/
6256
export const VariableBytesFromHex = Bytes.makeBytesTransformation({
6357
id: `Bytes${BYTES_LENGTH}.VariableBytes${BYTES_LENGTH}FromHex`,
64-
stringSchema: Bytes.HexLenientSchema.pipe(
65-
Bytes.hexLengthBetween(0, BYTES_LENGTH)
66-
),
58+
stringSchema: Bytes.HexLenientSchema.pipe(Bytes.hexLengthBetween(0, BYTES_LENGTH)),
6759
uint8ArraySchema: VariableBytes,
6860
decode: Bytes.fromHexLenient,
6961
encode: Bytes.toHexLenientUnsafe

packages/evolution/src/core/Bytes57.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,9 @@ export class Bytes57Error extends Data.TaggedError("Bytes57Error")<{
2727
*/
2828
export const BYTES_LENGTH = 57
2929

30-
export const BytesSchema = Schema.Uint8ArrayFromSelf.pipe(
31-
Bytes.bytesLengthEquals(BYTES_LENGTH)
32-
)
30+
export const BytesSchema = Schema.Uint8ArrayFromSelf.pipe(Bytes.bytesLengthEquals(BYTES_LENGTH))
3331

34-
export const HexSchema = Bytes.HexSchema.pipe(
35-
Bytes.hexLengthEquals(BYTES_LENGTH)
36-
)
32+
export const HexSchema = Bytes.HexSchema.pipe(Bytes.hexLengthEquals(BYTES_LENGTH))
3733

3834
/**
3935
* Schema transformation for fixed-length bytes
@@ -49,9 +45,7 @@ export const FromHex = Bytes.makeBytesTransformation({
4945
encode: Bytes.toHexUnsafe
5046
})
5147

52-
export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(
53-
Bytes.bytesLengthBetween(0, BYTES_LENGTH)
54-
)
48+
export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(Bytes.bytesLengthBetween(0, BYTES_LENGTH))
5549

5650
/**
5751
* Schema transformation for variable-length bytes (0..BYTES_LENGTH).
@@ -61,9 +55,7 @@ export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(
6155
*/
6256
export const VariableBytesFromHex = Bytes.makeBytesTransformation({
6357
id: `Bytes${BYTES_LENGTH}.VariableBytes${BYTES_LENGTH}FromHex`,
64-
stringSchema: Bytes.HexLenientSchema.pipe(
65-
Bytes.hexLengthBetween(0, BYTES_LENGTH)
66-
),
58+
stringSchema: Bytes.HexLenientSchema.pipe(Bytes.hexLengthBetween(0, BYTES_LENGTH)),
6759
uint8ArraySchema: VariableBytes,
6860
decode: Bytes.fromHexLenient,
6961
encode: Bytes.toHexLenientUnsafe

packages/evolution/src/core/Bytes64.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,9 @@ export class Bytes64Error extends Data.TaggedError("Bytes64Error")<{
1616
*/
1717
export const BYTES_LENGTH = 64
1818

19-
export const BytesSchema = Schema.Uint8ArrayFromSelf.pipe(
20-
Bytes.bytesLengthEquals(BYTES_LENGTH)
21-
)
19+
export const BytesSchema = Schema.Uint8ArrayFromSelf.pipe(Bytes.bytesLengthEquals(BYTES_LENGTH))
2220

23-
export const HexSchema = Bytes.HexSchema.pipe(
24-
Bytes.hexLengthEquals(BYTES_LENGTH)
25-
)
21+
export const HexSchema = Bytes.HexSchema.pipe(Bytes.hexLengthEquals(BYTES_LENGTH))
2622

2723
export const FromHex = Bytes.makeBytesTransformation({
2824
id: `Bytes${BYTES_LENGTH}.Bytes${BYTES_LENGTH}FromHex`,
@@ -32,9 +28,7 @@ export const FromHex = Bytes.makeBytesTransformation({
3228
encode: Bytes.toHexUnsafe
3329
})
3430

35-
export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(
36-
Bytes.bytesLengthBetween(0, BYTES_LENGTH)
37-
)
31+
export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(Bytes.bytesLengthBetween(0, BYTES_LENGTH))
3832

3933
/**
4034
* Schema transformation for variable-length bytes (0..BYTES_LENGTH).
@@ -44,9 +38,7 @@ export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(
4438
*/
4539
export const VariableBytesFromHex = Bytes.makeBytesTransformation({
4640
id: `Bytes${BYTES_LENGTH}.VariableBytes${BYTES_LENGTH}FromHex`,
47-
stringSchema: Bytes.HexLenientSchema.pipe(
48-
Bytes.hexLengthBetween(0, BYTES_LENGTH)
49-
),
41+
stringSchema: Bytes.HexLenientSchema.pipe(Bytes.hexLengthBetween(0, BYTES_LENGTH)),
5042
uint8ArraySchema: VariableBytes,
5143
decode: Bytes.fromHexLenient,
5244
encode: Bytes.toHexLenientUnsafe

packages/evolution/src/core/Bytes80.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,9 @@ export class Bytes80Error extends Data.TaggedError("Bytes32Error")<{
2727
*/
2828
export const BYTES_LENGTH = 80
2929

30-
export const BytesSchema = Schema.Uint8ArrayFromSelf.pipe(
31-
Bytes.bytesLengthEquals(BYTES_LENGTH)
32-
)
30+
export const BytesSchema = Schema.Uint8ArrayFromSelf.pipe(Bytes.bytesLengthEquals(BYTES_LENGTH))
3331

34-
export const HexSchema = Bytes.HexSchema.pipe(
35-
Bytes.hexLengthEquals(BYTES_LENGTH)
36-
)
32+
export const HexSchema = Bytes.HexSchema.pipe(Bytes.hexLengthEquals(BYTES_LENGTH))
3733

3834
/**
3935
* Schema transformation for fixed-length bytes
@@ -57,12 +53,8 @@ export const FromHex = Bytes.makeBytesTransformation({
5753
*/
5854
export const VariableBytesFromHex = Bytes.makeBytesTransformation({
5955
id: `Bytes${BYTES_LENGTH}.VariableBytes${BYTES_LENGTH}FromHex`,
60-
stringSchema: Bytes.HexLenientSchema.pipe(
61-
Bytes.hexLengthBetween(0, BYTES_LENGTH)
62-
),
63-
uint8ArraySchema: Schema.Uint8ArrayFromSelf.pipe(
64-
Bytes.bytesLengthBetween(0, BYTES_LENGTH)
65-
),
56+
stringSchema: Bytes.HexLenientSchema.pipe(Bytes.hexLengthBetween(0, BYTES_LENGTH)),
57+
uint8ArraySchema: Schema.Uint8ArrayFromSelf.pipe(Bytes.bytesLengthBetween(0, BYTES_LENGTH)),
6658
decode: Bytes.fromHexLenient,
6759
encode: Bytes.toHexLenientUnsafe
6860
})

packages/evolution/src/core/Bytes96.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,9 @@ export class Bytes96Error extends Data.TaggedError("Bytes96Error")<{
2727
*/
2828
export const BYTES_LENGTH = 96
2929

30-
export const BytesSchema = Schema.Uint8ArrayFromSelf.pipe(
31-
Bytes.bytesLengthEquals(BYTES_LENGTH)
32-
)
30+
export const BytesSchema = Schema.Uint8ArrayFromSelf.pipe(Bytes.bytesLengthEquals(BYTES_LENGTH))
3331

34-
export const HexSchema = Bytes.HexSchema.pipe(
35-
Bytes.hexLengthEquals(BYTES_LENGTH)
36-
)
32+
export const HexSchema = Bytes.HexSchema.pipe(Bytes.hexLengthEquals(BYTES_LENGTH))
3733

3834
/**
3935
* Schema transformation for fixed-length bytes
@@ -49,9 +45,7 @@ export const FromHex = Bytes.makeBytesTransformation({
4945
encode: Bytes.toHexUnsafe
5046
})
5147

52-
export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(
53-
Bytes.bytesLengthBetween(0, BYTES_LENGTH)
54-
)
48+
export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(Bytes.bytesLengthBetween(0, BYTES_LENGTH))
5549

5650
/**
5751
* Schema transformation for variable-length bytes (0..BYTES_LENGTH).
@@ -61,9 +55,7 @@ export const VariableBytes = Schema.Uint8ArrayFromSelf.pipe(
6155
*/
6256
export const VariableBytesFromHex = Bytes.makeBytesTransformation({
6357
id: `Bytes${BYTES_LENGTH}.VariableBytes${BYTES_LENGTH}FromHex`,
64-
stringSchema: Bytes.HexLenientSchema.pipe(
65-
Bytes.hexLengthBetween(0, BYTES_LENGTH)
66-
),
58+
stringSchema: Bytes.HexLenientSchema.pipe(Bytes.hexLengthBetween(0, BYTES_LENGTH)),
6759
uint8ArraySchema: VariableBytes,
6860
decode: Bytes.fromHexLenient,
6961
encode: Bytes.toHexLenientUnsafe

0 commit comments

Comments
 (0)