|
19 | 19 | * Queries the on-chain playground registry to verify deploy outcomes. |
20 | 20 | */ |
21 | 21 |
|
22 | | -import { ContractManager } from "@parity/product-sdk-contracts"; |
23 | | -import { createDevSigner, getDevPublicKey } from "@parity/product-sdk-tx"; |
24 | | -import { ss58Encode } from "@parity/product-sdk-address"; |
25 | 22 | import { getTestClient } from "../helpers/chain.js"; |
26 | | -import { |
27 | | - PLAYGROUND_REGISTRY_CONTRACT, |
28 | | - suppressReviveTraceNoise, |
29 | | - withRequiredLiveContractAddresses, |
30 | | -} from "../../../src/utils/contractManifest.js"; |
| 23 | +import { getReadOnlyRegistryContract } from "../../../src/utils/registry.js"; |
31 | 24 | import { resolveSigner } from "../../../src/utils/signer.js"; |
32 | 25 | import { publishToPlayground } from "../../../src/utils/deploy/playground.js"; |
33 | 26 | import { SIGNER } from "./accounts.js"; |
34 | 27 |
|
35 | | -import cdmJson from "../../../cdm.json"; |
36 | | - |
37 | 28 | export interface AppEntry { |
38 | 29 | domain: string; |
39 | 30 | owner: string; |
40 | 31 | metadataUri: string; |
41 | 32 | } |
42 | 33 |
|
43 | | -type Registry = Awaited<ReturnType<Awaited<ReturnType<typeof ContractManager.fromClient>>["getContract"]>>; |
| 34 | +type Registry = Awaited<ReturnType<typeof getReadOnlyRegistryContract>>; |
44 | 35 |
|
45 | 36 | let registryPromise: Promise<Registry> | null = null; |
46 | 37 |
|
47 | 38 | async function getRegistry(): Promise<Registry> { |
48 | 39 | if (!registryPromise) { |
49 | 40 | registryPromise = (async () => { |
50 | 41 | const client = await getTestClient(); |
51 | | - const aliceSigner = createDevSigner("Alice"); |
52 | | - const aliceAddress = ss58Encode(getDevPublicKey("Alice")); |
53 | | - // Mirror src/utils/registry.ts — query the CDM meta-registry for the |
54 | | - // live address before binding, so the helper reads from the same |
55 | | - // contract `dot mod` and `dot deploy` actually use. Without this, |
56 | | - // reads land on the cdm.json snapshot and silently diverge from the |
57 | | - // command paths after a registry redeploy. See issue #74. |
58 | | - const manifest = await withRequiredLiveContractAddresses(cdmJson, client.raw.assetHub, [ |
59 | | - PLAYGROUND_REGISTRY_CONTRACT, |
60 | | - ]); |
61 | | - const manager = await ContractManager.fromClient(manifest, client.raw.assetHub, { |
62 | | - defaultSigner: aliceSigner, |
63 | | - defaultOrigin: aliceAddress, |
64 | | - }); |
65 | | - return suppressReviveTraceNoise(manager.getContract(PLAYGROUND_REGISTRY_CONTRACT)); |
| 42 | + return getReadOnlyRegistryContract(client.raw.assetHub); |
66 | 43 | })().catch((err) => { |
67 | 44 | // Reset so the next call can retry instead of replaying the error |
68 | 45 | registryPromise = null; |
|
0 commit comments