Skip to content

Commit c34d799

Browse files
committed
js: remove deprecated register fn
1 parent 71095b5 commit c34d799

File tree

1 file changed

+2
-40
lines changed

1 file changed

+2
-40
lines changed

js/tests/registration.test.ts

+2-40
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
require("dotenv").config();
22
import { test, jest } from "@jest/globals";
33
import { Connection, PublicKey, Transaction } from "@solana/web3.js";
4-
import { registerDomainName } from "../src/bindings/registerDomainName";
54
import { registerDomainNameV2 } from "../src/bindings/registerDomainNameV2";
65
import { registerWithNft } from "../src/bindings/registerWithNft";
76
import { randomBytes } from "crypto";
8-
import { REFERRERS, USDC_MINT } from "../src/constants";
7+
import { REFERRERS } from "../src/constants";
98
import { getAssociatedTokenAddressSync } from "@solana/spl-token";
109
import { getDomainKeySync } from "../src/utils/getDomainKeySync";
1110
import { getReverseKeySync } from "../src/utils/getReverseKeySync";
@@ -21,43 +20,6 @@ const VAULT_OWNER = new PublicKey(
2120
"5D2zKog251d6KPCyFyLMt3KroWwXXPWSgTPyhV22K2gR",
2221
);
2322

24-
test("Registration", async () => {
25-
const tx = new Transaction();
26-
const ix = await registerDomainName(
27-
connection,
28-
randomBytes(10).toString("hex"),
29-
1_000,
30-
VAULT_OWNER,
31-
getAssociatedTokenAddressSync(USDC_MINT, VAULT_OWNER, true),
32-
USDC_MINT,
33-
);
34-
tx.add(...ix);
35-
const { blockhash } = await connection.getLatestBlockhash();
36-
tx.recentBlockhash = blockhash;
37-
tx.feePayer = VAULT_OWNER;
38-
const res = await connection.simulateTransaction(tx);
39-
expect(res.value.err).toBe(null);
40-
});
41-
42-
test("Registration with ref", async () => {
43-
const tx = new Transaction();
44-
const ix = await registerDomainName(
45-
connection,
46-
randomBytes(10).toString("hex"),
47-
1_000,
48-
VAULT_OWNER,
49-
getAssociatedTokenAddressSync(FIDA_MINT, VAULT_OWNER, true),
50-
FIDA_MINT,
51-
REFERRERS[1],
52-
);
53-
tx.add(...ix);
54-
const { blockhash } = await connection.getLatestBlockhash();
55-
tx.recentBlockhash = blockhash;
56-
tx.feePayer = VAULT_OWNER;
57-
const res = await connection.simulateTransaction(tx);
58-
expect(res.value.err).toBe(null);
59-
});
60-
6123
test("Register with NFT", async () => {
6224
const tx = new Transaction();
6325
const domain = randomBytes(10).toString("hex");
@@ -93,7 +55,7 @@ test("Register with NFT", async () => {
9355
test("Indempotent ATA creation ref", async () => {
9456
const tx = new Transaction();
9557
for (let i = 0; i < 3; i++) {
96-
const ix = await registerDomainName(
58+
const ix = await registerDomainNameV2(
9759
connection,
9860
randomBytes(10).toString("hex"),
9961
1_000,

0 commit comments

Comments
 (0)