From c34d799d00664e27a7a6288b32ade6d8e55d2b9c Mon Sep 17 00:00:00 2001 From: DR497 <47689875+dr497@users.noreply.github.com> Date: Wed, 7 Aug 2024 16:31:32 +0800 Subject: [PATCH] js: remove deprecated register fn --- js/tests/registration.test.ts | 42 ++--------------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) diff --git a/js/tests/registration.test.ts b/js/tests/registration.test.ts index c915009..f2eb7e8 100644 --- a/js/tests/registration.test.ts +++ b/js/tests/registration.test.ts @@ -1,11 +1,10 @@ require("dotenv").config(); import { test, jest } from "@jest/globals"; import { Connection, PublicKey, Transaction } from "@solana/web3.js"; -import { registerDomainName } from "../src/bindings/registerDomainName"; import { registerDomainNameV2 } from "../src/bindings/registerDomainNameV2"; import { registerWithNft } from "../src/bindings/registerWithNft"; import { randomBytes } from "crypto"; -import { REFERRERS, USDC_MINT } from "../src/constants"; +import { REFERRERS } from "../src/constants"; import { getAssociatedTokenAddressSync } from "@solana/spl-token"; import { getDomainKeySync } from "../src/utils/getDomainKeySync"; import { getReverseKeySync } from "../src/utils/getReverseKeySync"; @@ -21,43 +20,6 @@ const VAULT_OWNER = new PublicKey( "5D2zKog251d6KPCyFyLMt3KroWwXXPWSgTPyhV22K2gR", ); -test("Registration", async () => { - const tx = new Transaction(); - const ix = await registerDomainName( - connection, - randomBytes(10).toString("hex"), - 1_000, - VAULT_OWNER, - getAssociatedTokenAddressSync(USDC_MINT, VAULT_OWNER, true), - USDC_MINT, - ); - tx.add(...ix); - const { blockhash } = await connection.getLatestBlockhash(); - tx.recentBlockhash = blockhash; - tx.feePayer = VAULT_OWNER; - const res = await connection.simulateTransaction(tx); - expect(res.value.err).toBe(null); -}); - -test("Registration with ref", async () => { - const tx = new Transaction(); - const ix = await registerDomainName( - connection, - randomBytes(10).toString("hex"), - 1_000, - VAULT_OWNER, - getAssociatedTokenAddressSync(FIDA_MINT, VAULT_OWNER, true), - FIDA_MINT, - REFERRERS[1], - ); - tx.add(...ix); - const { blockhash } = await connection.getLatestBlockhash(); - tx.recentBlockhash = blockhash; - tx.feePayer = VAULT_OWNER; - const res = await connection.simulateTransaction(tx); - expect(res.value.err).toBe(null); -}); - test("Register with NFT", async () => { const tx = new Transaction(); const domain = randomBytes(10).toString("hex"); @@ -93,7 +55,7 @@ test("Register with NFT", async () => { test("Indempotent ATA creation ref", async () => { const tx = new Transaction(); for (let i = 0; i < 3; i++) { - const ix = await registerDomainName( + const ix = await registerDomainNameV2( connection, randomBytes(10).toString("hex"), 1_000,