File tree Expand file tree Collapse file tree 3 files changed +495
-28
lines changed
Expand file tree Collapse file tree 3 files changed +495
-28
lines changed Original file line number Diff line number Diff line change @@ -16,4 +16,4 @@ cluster = "localnet"
1616wallet = " ~/.config/solana/id.json"
1717
1818[scripts ]
19- test = " yarn run ts-mocha -p ./tsconfig.json -t 1000000 \" tests/**/*.ts\" "
19+ test = " yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
Original file line number Diff line number Diff line change @@ -226,24 +226,12 @@ pub mod blog {
226226 . ok_or ( BlogError :: EmptyBalance ) ?;
227227 require ! ( amount > 0 , BlogError :: EmptyBalance ) ;
228228
229- let authority_key = state. authority ;
230- let bump_seed = [ state. bump ] ;
231- let signer_seeds = [
232- BlogState :: SEED_PREFIX ,
233- authority_key. as_ref ( ) ,
234- & bump_seed[ ..] ,
235- ] ;
236- system_program:: transfer (
237- CpiContext :: new_with_signer (
238- ctx. accounts . system_program . to_account_info ( ) ,
239- SystemTransfer {
240- from : ctx. accounts . blog_state . to_account_info ( ) ,
241- to : ctx. accounts . recipient . to_account_info ( ) ,
242- } ,
243- & [ & signer_seeds] ,
244- ) ,
245- amount,
246- ) ?;
229+ * * ctx
230+ . accounts
231+ . blog_state
232+ . to_account_info ( )
233+ . try_borrow_mut_lamports ( ) ? -= amount;
234+ * * ctx. accounts . recipient . try_borrow_mut_lamports ( ) ? += amount;
247235
248236 emit ! ( FundsWithdrawn {
249237 recipient: ctx. accounts. recipient. key( ) ,
You can’t perform that action at this time.
0 commit comments