1
1
require ( "dotenv" ) . config ( ) ;
2
2
import { test , jest } from "@jest/globals" ;
3
3
import { Connection , PublicKey , Transaction } from "@solana/web3.js" ;
4
- import { registerDomainName } from "../src/bindings/registerDomainName" ;
5
4
import { registerDomainNameV2 } from "../src/bindings/registerDomainNameV2" ;
6
5
import { registerWithNft } from "../src/bindings/registerWithNft" ;
7
6
import { randomBytes } from "crypto" ;
8
- import { REFERRERS , USDC_MINT } from "../src/constants" ;
7
+ import { REFERRERS } from "../src/constants" ;
9
8
import { getAssociatedTokenAddressSync } from "@solana/spl-token" ;
10
9
import { getDomainKeySync } from "../src/utils/getDomainKeySync" ;
11
10
import { getReverseKeySync } from "../src/utils/getReverseKeySync" ;
@@ -21,43 +20,6 @@ const VAULT_OWNER = new PublicKey(
21
20
"5D2zKog251d6KPCyFyLMt3KroWwXXPWSgTPyhV22K2gR" ,
22
21
) ;
23
22
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
-
61
23
test ( "Register with NFT" , async ( ) => {
62
24
const tx = new Transaction ( ) ;
63
25
const domain = randomBytes ( 10 ) . toString ( "hex" ) ;
@@ -93,7 +55,7 @@ test("Register with NFT", async () => {
93
55
test ( "Indempotent ATA creation ref" , async ( ) => {
94
56
const tx = new Transaction ( ) ;
95
57
for ( let i = 0 ; i < 3 ; i ++ ) {
96
- const ix = await registerDomainName (
58
+ const ix = await registerDomainNameV2 (
97
59
connection ,
98
60
randomBytes ( 10 ) . toString ( "hex" ) ,
99
61
1_000 ,
0 commit comments