@@ -90,63 +90,6 @@ describe('Test smart wallet with default policy', () => {
9090 console . log ( 'result: ' , result ) ;
9191 } ) ;
9292
93- xit ( 'Delete smart wallet successfully' , async ( ) => {
94- // create smart wallet first
95- const privateKey = ECDSA . generateKey ( ) ;
96- const publicKeyBase64 = privateKey . toCompressedPublicKey ( ) ;
97- const passkeyPubkey = asPasskeyPublicKey (
98- Array . from ( Buffer . from ( publicKeyBase64 , 'base64' ) )
99- ) ;
100- const smartWalletId = lazorkitProgram . generateWalletId ( ) ;
101- const smartWallet = lazorkitProgram . getSmartWalletPubkey ( smartWalletId ) ;
102- const credentialId = base64 . encode ( Buffer . from ( 'testing' ) ) ; // random string
103- const credentialHash = asCredentialHash (
104- Array . from (
105- new Uint8Array (
106- require ( 'js-sha256' ) . arrayBuffer ( Buffer . from ( credentialId , 'base64' ) )
107- )
108- )
109- ) ;
110-
111- const { transaction : createSmartWalletTxn } =
112- await lazorkitProgram . createSmartWalletTxn ( {
113- payer : payer . publicKey ,
114- passkeyPublicKey : passkeyPubkey ,
115- credentialIdBase64 : credentialId ,
116- smartWalletId,
117- } ) ;
118-
119- const sig = await anchor . web3 . sendAndConfirmTransaction (
120- connection ,
121- createSmartWalletTxn as anchor . web3 . Transaction ,
122- [ payer ]
123- ) ;
124-
125- console . log ( 'Create smart wallet: ' , sig ) ;
126-
127- const deleteSmartWalletTxn = await lazorkitProgram . program . methods
128- . deleteSmartWallet ( )
129- . accountsPartial ( {
130- payer : payer . publicKey ,
131- smartWallet : smartWallet ,
132- walletState : lazorkitProgram . getWalletStatePubkey ( smartWallet ) ,
133- walletDevice : lazorkitProgram . getWalletDevicePubkey (
134- smartWallet ,
135- credentialHash
136- ) ,
137- systemProgram : anchor . web3 . SystemProgram . programId ,
138- } )
139- . transaction ( ) ;
140-
141- const deleteSmartWalletSig = await anchor . web3 . sendAndConfirmTransaction (
142- connection ,
143- deleteSmartWalletTxn as anchor . web3 . Transaction ,
144- [ payer ]
145- ) ;
146-
147- console . log ( 'Delete smart wallet: ' , deleteSmartWalletSig ) ;
148- } ) ;
149-
15093 it ( 'Execute direct transaction with transfer sol from smart wallet' , async ( ) => {
15194 const privateKey = ECDSA . generateKey ( ) ;
15295
0 commit comments