@@ -131,7 +131,20 @@ describe("Create TransferLockedPosition instructions", () => {
131131
132132 await sendTransaction ( lockPositionInstruction . instructions ) ;
133133
134- // 2. Then, transfer the position to the new owner
134+ // 2. Then, transfer the position to the signer itself, should failed
135+ const transferLockedPositionInstructionToMyself =
136+ await transferLockedPositionInstructions (
137+ rpc ,
138+ positionMintAddress ,
139+ signer . address ,
140+ signer ,
141+ ) ;
142+
143+ await assert . rejects (
144+ sendTransaction ( transferLockedPositionInstructionToMyself . instructions ) ,
145+ ) ;
146+
147+ // 3. Then, transfer the position to the new owner, should success
135148 const receiver = getNextKeypair ( ) ;
136149 const receiverTokenAccountAddress = await setupAtaTE ( positionMintAddress , {
137150 amount : 0 ,
@@ -147,7 +160,7 @@ describe("Create TransferLockedPosition instructions", () => {
147160
148161 await sendTransaction ( transferLockedPositionInstruction . instructions ) ;
149162
150- // 3 . Verify the position is transferred
163+ // 4 . Verify the position is transferred
151164 const receiverTokenAccount = await fetchToken (
152165 rpc ,
153166 receiverTokenAccountAddress ,
@@ -161,7 +174,7 @@ describe("Create TransferLockedPosition instructions", () => {
161174 "Receiver token account owner is not the same as the receiver" ,
162175 ) ;
163176
164- // 4 . Verify the lock config is still valid
177+ // 5 . Verify the lock config is still valid
165178 const lockConfig = await fetchLockConfig ( rpc , lockConfigAddress ) ;
166179 assert (
167180 lockConfig . data . positionOwner === receiver . address ,
0 commit comments