@@ -5,6 +5,7 @@ import { createSubdomain, transferSubdomain } from "../src/bindings";
5
5
import { randomBytes } from "crypto" ;
6
6
import { VAULT_OWNER } from "../src/constants" ;
7
7
import { findSubdomains , getDomainKeySync } from "../src/utils" ;
8
+ import { resolve } from "../src/resolve" ;
8
9
9
10
jest . setTimeout ( 20_000 ) ;
10
11
@@ -68,3 +69,26 @@ test("Find sub domain", async () => {
68
69
const expectedSub = [ "dex" , "naming" , "test" ] ;
69
70
subs . sort ( ) . forEach ( ( e , idx ) => expect ( e ) . toBe ( expectedSub [ idx ] ) ) ;
70
71
} ) ;
72
+
73
+ test ( "Create sub - Fee payer " , async ( ) => {
74
+ const sub = "gvbhnjklmjnhb" ;
75
+ const parent = "bonfida.sol" ;
76
+ const feePayer = VAULT_OWNER ;
77
+
78
+ const parentOwner = await resolve ( connection , parent ) ;
79
+ const [ , ix ] = await createSubdomain (
80
+ connection ,
81
+ sub + "." + parent ,
82
+ parentOwner ,
83
+ 1_000 ,
84
+ feePayer ,
85
+ ) ;
86
+ const tx = new Transaction ( ) ;
87
+ tx . add ( ...ix ) ;
88
+ const { blockhash } = await connection . getLatestBlockhash ( ) ;
89
+
90
+ tx . recentBlockhash = blockhash ;
91
+ tx . feePayer = VAULT_OWNER ;
92
+ const res = await connection . simulateTransaction ( tx ) ;
93
+ expect ( res . value . err ) . toBe ( null ) ;
94
+ } ) ;
0 commit comments