feat/upgrade modules 8#39
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR upgrades modules to version 8, focusing on standardizing type representations and modernizing import patterns throughout the Evolution SDK.
- Migrates from
nulltoundefinedfor optional values across the codebase - Introduces new SDK modules for better organization (Unit, Label, PolicyId, RewardAddress)
- Updates import patterns to use cleaner module namespacing
Reviewed Changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/evolution/src/sdk/wallet/Wallet.ts | Updates import alias and changes null to undefined for optional fields |
| packages/evolution/src/sdk/provider/types.ts | Changes poolId and assetName types from null to undefined |
| packages/evolution/src/sdk/provider/internal/Ogmios.ts | Major refactor with updated imports, type definitions, and null to undefined migration |
| packages/evolution/src/sdk/provider/Provider.ts | Updates import patterns and return types to use string instead of specific types |
| packages/evolution/src/sdk/provider/Kupmios.ts | Comprehensive refactor with new datum handling, updated imports, and implementation completion |
| packages/evolution/src/sdk/index.ts | New barrel export file for SDK modules |
| packages/evolution/src/sdk/Unit.ts | New module for unit parsing and creation functionality |
| packages/evolution/src/sdk/UTxO.ts | Updates datum types to use discriminated unions and removes undefined option |
| packages/evolution/src/sdk/Script.ts | Adds CBOR encoding utilities for script handling |
| packages/evolution/src/sdk/RewardAddress.ts | New module for reward address operations |
| packages/evolution/src/sdk/PolicyId.ts | New simple type alias for policy IDs |
| packages/evolution/src/sdk/Label.ts | New module implementing CIP-67 label handling with CRC8 checksums |
| packages/evolution/src/sdk/Assets.ts | Significant expansion with new utility functions and core type conversions |
Comments suppressed due to low confidence (2)
packages/evolution/src/sdk/provider/internal/Ogmios.ts:1
- The assignment expression inside the return statement is confusing and potentially error-prone. Should separate the assignment from the return, or clarify the intended behavior.
import type { Record } from "effect"
packages/evolution/src/sdk/provider/Kupmios.ts:1
- Inconsistent null safety: line 202 accesses
utxo.datumOption.typewithout optional chaining, but line 203 uses optional chaining. Both should use optional chaining for consistency.
import { FetchHttpClient } from "@effect/platform"
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| export const isDatumHash = (datum: Datum): datum is { type: "datumHash"; hash: string } => | ||
| datum !== undefined && "hash" in datum | ||
|
|
There was a problem hiding this comment.
The type guards are checking for property existence instead of the discriminating 'type' field. Since Datum is now a discriminated union, these should check datum.type === 'datumHash' and datum.type === 'inlineDatum' respectively.
| export const isDatumHash = (datum: Datum): datum is { type: "datumHash"; hash: string } => | ||
| datum !== undefined && "hash" in datum | ||
|
|
There was a problem hiding this comment.
The type guards are checking for property existence instead of the discriminating 'type' field. Since Datum is now a discriminated union, these should check datum.type === 'datumHash' and datum.type === 'inlineDatum' respectively.
No description provided.