@@ -2,6 +2,8 @@ import { describe, expect, it } from "@effect/vitest"
22import * as Cluster from "@evolution-sdk/devnet/Cluster"
33import * as Config from "@evolution-sdk/devnet/Config"
44import * as Genesis from "@evolution-sdk/devnet/Genesis"
5+ import { Core } from "@evolution-sdk/evolution"
6+ import * as CoreAddress from "@evolution-sdk/evolution/core/Address"
57import { afterAll , beforeAll } from "vitest"
68
79/**
@@ -50,10 +52,10 @@ describe("Devnet.Genesis", () => {
5052 expect ( utxos . length ) . toBe ( 1 )
5153
5254 const utxo = utxos [ 0 ]
53- expect ( utxo . txHash ) . toBeDefined ( )
54- expect ( utxo . txHash . length ) . toBe ( 64 )
55- expect ( utxo . outputIndex ) . toBe ( 0 )
56- expect ( utxo . address ) . toMatch ( / ^ a d d r _ t e s t / )
55+ expect ( utxo . transactionId ) . toBeDefined ( )
56+ expect ( Core . TransactionHash . toHex ( utxo . transactionId ) . length ) . toBe ( 64 )
57+ expect ( utxo . index ) . toBe ( 0n )
58+ expect ( CoreAddress . toBech32 ( utxo . address ) ) . toMatch ( / ^ a d d r _ t e s t / )
5759 expect ( utxo . assets ) . toBeDefined ( )
5860 } )
5961
@@ -66,10 +68,10 @@ describe("Devnet.Genesis", () => {
6668 expect ( utxos . length ) . toBe ( 1 )
6769
6870 const utxo = utxos [ 0 ]
69- expect ( utxo . txHash ) . toBeDefined ( )
70- expect ( utxo . txHash . length ) . toBe ( 64 )
71- expect ( utxo . outputIndex ) . toBe ( 0 )
72- expect ( utxo . address ) . toMatch ( / ^ a d d r _ t e s t / )
71+ expect ( utxo . transactionId ) . toBeDefined ( )
72+ expect ( Core . TransactionHash . toHex ( utxo . transactionId ) . length ) . toBe ( 64 )
73+ expect ( utxo . index ) . toBe ( 0n )
74+ expect ( CoreAddress . toBech32 ( utxo . address ) ) . toMatch ( / ^ a d d r _ t e s t / )
7375 expect ( utxo . assets ) . toBeDefined ( )
7476 } )
7577
@@ -82,10 +84,10 @@ describe("Devnet.Genesis", () => {
8284 expect ( calculated . length ) . toBe ( queried . length )
8385
8486 for ( let i = 0 ; i < calculated . length ; i ++ ) {
85- expect ( calculated [ i ] . txHash ) . toBe ( queried [ i ] . txHash )
86- expect ( calculated [ i ] . outputIndex ) . toBe ( queried [ i ] . outputIndex )
87- expect ( calculated [ i ] . address ) . toBe ( queried [ i ] . address )
88- expect ( calculated [ i ] . assets ) . toEqual ( queried [ i ] . assets )
87+ expect ( Core . TransactionHash . toHex ( calculated [ i ] . transactionId ) ) . toBe ( Core . TransactionHash . toHex ( queried [ i ] . transactionId ) )
88+ expect ( calculated [ i ] . index ) . toBe ( queried [ i ] . index )
89+ expect ( CoreAddress . toBech32 ( calculated [ i ] . address ) ) . toBe ( CoreAddress . toBech32 ( queried [ i ] . address ) )
90+ expect ( calculated [ i ] . assets . lovelace ) . toEqual ( queried [ i ] . assets . lovelace )
8991 }
9092 } )
9193
@@ -112,14 +114,17 @@ describe("Devnet.Genesis", () => {
112114
113115 expect ( utxos . length ) . toBe ( 3 )
114116
115- // Each genesis UTxO has outputIndex 0
116- expect ( utxos [ 0 ] . outputIndex ) . toBe ( 0 )
117- expect ( utxos [ 1 ] . outputIndex ) . toBe ( 0 )
118- expect ( utxos [ 2 ] . outputIndex ) . toBe ( 0 )
117+ // Each genesis UTxO has index 0n
118+ expect ( utxos [ 0 ] . index ) . toBe ( 0n )
119+ expect ( utxos [ 1 ] . index ) . toBe ( 0n )
120+ expect ( utxos [ 2 ] . index ) . toBe ( 0n )
119121
120122 // Each address gets unique pseudo-TxId
121- expect ( utxos [ 0 ] . txHash ) . not . toBe ( utxos [ 1 ] . txHash )
122- expect ( utxos [ 1 ] . txHash ) . not . toBe ( utxos [ 2 ] . txHash )
123- expect ( utxos [ 0 ] . txHash ) . not . toBe ( utxos [ 2 ] . txHash )
123+ const txHash0 = Core . TransactionHash . toHex ( utxos [ 0 ] . transactionId )
124+ const txHash1 = Core . TransactionHash . toHex ( utxos [ 1 ] . transactionId )
125+ const txHash2 = Core . TransactionHash . toHex ( utxos [ 2 ] . transactionId )
126+ expect ( txHash0 ) . not . toBe ( txHash1 )
127+ expect ( txHash1 ) . not . toBe ( txHash2 )
128+ expect ( txHash0 ) . not . toBe ( txHash2 )
124129 } )
125130} )
0 commit comments