Skip to content

Commit f3e5174

Browse files
committed
refactor: update suffix
1 parent d2e7129 commit f3e5174

File tree

6 files changed

+25
-25
lines changed

6 files changed

+25
-25
lines changed

docs/content/docs/devnet/configuration.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ This pattern enables testing multi-party protocols, delegation scenarios, and wa
117117

118118
After creating a genesis configuration, calculate the resulting UTxOs to verify addresses and amounts.
119119

120-
**Important**: Genesis UTxOs do NOT appear in Kupo's index because Kupo reads chain events starting from block 1, while genesis UTxOs exist in block 0 (the genesis block itself). You must use `calculateUtxosFromConfigOrThrow` to derive these UTxOs and provide them to your transaction builder via the `availableUtxos` parameter. After spending a genesis UTxO, the resulting outputs will be indexed normally by Kupo.
120+
**Important**: Genesis UTxOs do NOT appear in Kupo's index because Kupo reads chain events starting from block 1, while genesis UTxOs exist in block 0 (the genesis block itself). You must use `calculateUtxosFromConfig` to derive these UTxOs and provide them to your transaction builder via the `availableUtxos` parameter. After spending a genesis UTxO, the resulting outputs will be indexed normally by Kupo.
121121

122122
```typescript twoslash
123123
import { Config, Genesis } from "@evolution-sdk/devnet";
@@ -131,7 +131,7 @@ const genesisConfig = {
131131
} satisfies Config.ShelleyGenesis;
132132

133133
// Calculate UTxOs before starting the cluster
134-
const genesisUtxos = await Genesis.calculateUtxosFromConfigOrThrow(genesisConfig);
134+
const genesisUtxos = await Genesis.calculateUtxosFromConfig(genesisConfig);
135135

136136
console.log("Genesis UTxOs:", genesisUtxos.length);
137137
genesisUtxos.forEach(utxo => {
@@ -383,7 +383,7 @@ console.log("- Custom protocol parameters");
383383
console.log("- Kupo and Ogmios enabled");
384384

385385
// Calculate and verify genesis UTxOs
386-
const utxos = await Genesis.calculateUtxosFromConfigOrThrow(genesisConfig);
386+
const utxos = await Genesis.calculateUtxosFromConfig(genesisConfig);
387387
console.log(`\nGenesis UTxOs: ${utxos.length}`);
388388
utxos.forEach((utxo, i) => {
389389
console.log(` Address ${i + 1}: ${utxo.assets.lovelace} lovelace`);

docs/content/docs/devnet/integration.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ async function completeWorkflow() {
9393
});
9494

9595
// Step 6: Calculate genesis UTxOs
96-
const genesisUtxos = await Genesis.calculateUtxosFromConfigOrThrow(genesisConfig);
96+
const genesisUtxos = await Genesis.calculateUtxosFromConfig(genesisConfig);
9797

9898
console.log("Genesis UTxOs:", genesisUtxos.length);
9999
console.log("Initial balance:", genesisUtxos[0]?.assets.lovelace, "lovelace");
@@ -155,9 +155,9 @@ The genesis UTxO calculation provides the initial funds for transaction building
155155

156156
Three key integration points connect devnet to the Evolution SDK:
157157

158-
**Genesis to UTxO**: The `calculateUtxosFromConfigOrThrow` function converts genesis configuration into queryable UTxO objects. These UTxOs can be used as transaction inputs immediately after cluster start.
158+
**Genesis to UTxO**: The `calculateUtxosFromConfig` function converts genesis configuration into queryable UTxO objects. These UTxOs can be used as transaction inputs immediately after cluster start.
159159

160-
**Critical: Genesis UTxOs and Kupo**: Genesis UTxOs do NOT appear in Kupo's index. Kupo reads chain events starting from the first block, but genesis UTxOs are created in the genesis block itself (block 0), which has no transaction events. You MUST use `calculateUtxosFromConfigOrThrow` to derive genesis UTxOs and explicitly inject them into your transaction builder using the `availableUtxos` parameter. Once you spend a genesis UTxO in a transaction, the resulting outputs WILL be indexed by Kupo and can be queried normally.
160+
**Critical: Genesis UTxOs and Kupo**: Genesis UTxOs do NOT appear in Kupo's index. Kupo reads chain events starting from the first block, but genesis UTxOs are created in the genesis block itself (block 0), which has no transaction events. You MUST use `calculateUtxosFromConfig` to derive genesis UTxOs and explicitly inject them into your transaction builder using the `availableUtxos` parameter. Once you spend a genesis UTxO in a transaction, the resulting outputs WILL be indexed by Kupo and can be queried normally.
161161

162162
**Provider Configuration**: The client's provider configuration points to the devnet's Kupo and Ogmios services. This enables all blockchain queries (UTxOs, protocol parameters, tip) to target the local network.
163163

@@ -269,7 +269,7 @@ describe("Transaction Tests", () => {
269269
wallet: { type: "seed", mnemonic, accountIndex: 0 }
270270
});
271271

272-
genesisUtxos = await Genesis.calculateUtxosFromConfigOrThrow(
272+
genesisUtxos = await Genesis.calculateUtxosFromConfig(
273273
genesisConfig
274274
);
275275
}, 180_000); // Extended timeout for cluster startup
@@ -405,7 +405,7 @@ const client2 = createClient({
405405
});
406406

407407
// Wallet 1 sends to Wallet 2
408-
const utxos1 = await Genesis.calculateUtxosFromConfigOrThrow(genesisConfig);
408+
const utxos1 = await Genesis.calculateUtxosFromConfig(genesisConfig);
409409
const wallet1Address = await wallet1.address();
410410
const wallet1Utxo = utxos1.find(u => u.address === wallet1Address)!;
411411

@@ -488,7 +488,7 @@ Run this script to start a persistent devnet for manual testing, dApp developmen
488488

489489
**"Cannot connect to provider"**: Ensure sufficient wait time after `Cluster.start()`. Kupo and Ogmios need 6-8 seconds to initialize completely. Increase wait time for slower systems.
490490

491-
**"UTxO not found"**: Remember that genesis UTxOs are NOT indexed by Kupo. Always use `calculateUtxosFromConfigOrThrow` and provide them via `availableUtxos` parameter when building your first transaction. After spending genesis UTxOs, subsequent outputs will be indexed normally.
491+
**"UTxO not found"**: Remember that genesis UTxOs are NOT indexed by Kupo. Always use `calculateUtxosFromConfig` and provide them via `availableUtxos` parameter when building your first transaction. After spending genesis UTxOs, subsequent outputs will be indexed normally.
492492

493493
**"Transaction submission failed"**: Verify network magic matches between genesis configuration and client. Mismatched magic causes address validation failures.
494494

docs/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
import "./out/dev/types/routes.d.ts";
3+
import "./.next/types/routes.d.ts";
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

packages/evolution-devnet/src/Genesis.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ export interface Cluster {
5050
* // ... other genesis config
5151
* }
5252
*
53-
* const utxos = await Devnet.Genesis.calculateUtxosFromConfigOrThrow(
53+
* const utxos = await Devnet.Genesis.calculateUtxosFromConfig(
5454
* genesisConfig
5555
* )
5656
* ```
5757
*
5858
* @since 2.0.0
5959
* @category genesis
6060
*/
61-
export const calculateUtxosFromConfig = (
61+
export const calculateUtxosFromConfigEffect = (
6262
genesisConfig: Config.ShelleyGenesis
6363
): Effect.Effect<ReadonlyArray<UTxO.UTxO>, GenesisError> =>
6464
Effect.gen(function* () {
@@ -104,8 +104,8 @@ export const calculateUtxosFromConfig = (
104104
* @since 2.0.0
105105
* @category genesis
106106
*/
107-
export const calculateUtxosFromConfigOrThrow = (genesisConfig: Config.ShelleyGenesis) =>
108-
Effect.runPromise(calculateUtxosFromConfig(genesisConfig))
107+
export const calculateUtxosFromConfig = (genesisConfig: Config.ShelleyGenesis) =>
108+
Effect.runPromise(calculateUtxosFromConfigEffect(genesisConfig))
109109

110110
/**
111111
* Query genesis UTxOs from the running node using cardano-cli.
@@ -114,7 +114,7 @@ export const calculateUtxosFromConfigOrThrow = (genesisConfig: Config.ShelleyGen
114114
* @since 2.0.0
115115
* @category genesis
116116
*/
117-
export const queryUtxos = (cluster: Cluster): Effect.Effect<ReadonlyArray<UTxO.UTxO>, GenesisError> =>
117+
export const queryUtxosEffect = (cluster: Cluster): Effect.Effect<ReadonlyArray<UTxO.UTxO>, GenesisError> =>
118118
Effect.gen(function* () {
119119
// Need to import Container functions dynamically to avoid circular dependency
120120
const ContainerModule = yield* Effect.promise(() => import("./Container.js"))
@@ -169,4 +169,4 @@ export const queryUtxos = (cluster: Cluster): Effect.Effect<ReadonlyArray<UTxO.U
169169
* @since 2.0.0
170170
* @category genesis
171171
*/
172-
export const queryUtxosOrThrow = (cluster: Cluster) => Effect.runPromise(queryUtxos(cluster))
172+
export const queryUtxos = (cluster: Cluster) => Effect.runPromise(queryUtxosEffect(cluster))

packages/evolution-devnet/test/Client.Devnet.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ describe("Client with Devnet", () => {
7272
}, 60_000)
7373

7474
it("should calculate genesis UTxOs from config", { timeout: 10_000 }, async () => {
75-
const calculatedUtxos = await Genesis.calculateUtxosFromConfigOrThrow(genesisConfig)
75+
const calculatedUtxos = await Genesis.calculateUtxosFromConfig(genesisConfig)
7676

7777
expect(calculatedUtxos).toBeDefined()
7878
expect(calculatedUtxos.length).toBe(1)

packages/evolution-devnet/test/Devnet.Genesis.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe("Devnet.Genesis", () => {
4444
}, 60_000)
4545

4646
it("should calculate genesis UTxOs from config", { timeout: 10_000 }, async () => {
47-
const utxos = await Genesis.calculateUtxosFromConfigOrThrow(genesisConfig)
47+
const utxos = await Genesis.calculateUtxosFromConfig(genesisConfig)
4848

4949
expect(utxos).toBeDefined()
5050
expect(utxos.length).toBe(1)
@@ -60,7 +60,7 @@ describe("Devnet.Genesis", () => {
6060
it("should query genesis UTxOs from node", { timeout: 30_000 }, async () => {
6161
if (!devnetCluster) throw new Error("Devnet not initialized")
6262

63-
const utxos = await Genesis.queryUtxosOrThrow(devnetCluster)
63+
const utxos = await Genesis.queryUtxos(devnetCluster)
6464

6565
expect(utxos).toBeDefined()
6666
expect(utxos.length).toBe(1)
@@ -76,8 +76,8 @@ describe("Devnet.Genesis", () => {
7676
it("should match: calculated === queried", { timeout: 30_000 }, async () => {
7777
if (!devnetCluster) throw new Error("Devnet not initialized")
7878

79-
const calculated = await Genesis.calculateUtxosFromConfigOrThrow(genesisConfig)
80-
const queried = await Genesis.queryUtxosOrThrow(devnetCluster)
79+
const calculated = await Genesis.calculateUtxosFromConfig(genesisConfig)
80+
const queried = await Genesis.queryUtxos(devnetCluster)
8181

8282
expect(calculated.length).toBe(queried.length)
8383

@@ -90,9 +90,9 @@ describe("Devnet.Genesis", () => {
9090
})
9191

9292
it("should be deterministic", { timeout: 10_000 }, async () => {
93-
const result1 = await Genesis.calculateUtxosFromConfigOrThrow(genesisConfig)
94-
const result2 = await Genesis.calculateUtxosFromConfigOrThrow(genesisConfig)
95-
const result3 = await Genesis.calculateUtxosFromConfigOrThrow(genesisConfig)
93+
const result1 = await Genesis.calculateUtxosFromConfig(genesisConfig)
94+
const result2 = await Genesis.calculateUtxosFromConfig(genesisConfig)
95+
const result3 = await Genesis.calculateUtxosFromConfig(genesisConfig)
9696

9797
expect(result1).toEqual(result2)
9898
expect(result2).toEqual(result3)
@@ -108,7 +108,7 @@ describe("Devnet.Genesis", () => {
108108
}
109109
}
110110

111-
const utxos = await Genesis.calculateUtxosFromConfigOrThrow(multiConfig)
111+
const utxos = await Genesis.calculateUtxosFromConfig(multiConfig)
112112

113113
expect(utxos.length).toBe(3)
114114

0 commit comments

Comments
 (0)