@@ -552,7 +552,11 @@ fn set_nvda_price(ctx: &mut TestContext, price: i64, rate: u64) {
552552 set_router_rate ( ctx, nvda_mint, rate, nvda_rate_pda) ;
553553}
554554
555- fn set_weight ( ctx : & mut TestContext , index : u8 , weight_bps : u16 ) -> Result < ( ) , solana_kite:: SolanaKiteError > {
555+ fn set_weight (
556+ ctx : & mut TestContext ,
557+ index : u8 ,
558+ weight_bps : u16 ,
559+ ) -> Result < ( ) , solana_kite:: SolanaKiteError > {
556560 let ix = Instruction :: new_with_bytes (
557561 ctx. vault_program_id ,
558562 & vault_strategy:: instruction:: SetWeight { weight_bps } . data ( ) ,
@@ -563,7 +567,12 @@ fn set_weight(ctx: &mut TestContext, index: u8, weight_bps: u16) -> Result<(), s
563567 }
564568 . to_account_metas ( None ) ,
565569 ) ;
566- send_transaction_from_instructions ( & mut ctx. svm , vec ! [ ix] , & [ & ctx. manager ] , & ctx. manager . pubkey ( ) )
570+ send_transaction_from_instructions (
571+ & mut ctx. svm ,
572+ vec ! [ ix] ,
573+ & [ & ctx. manager ] ,
574+ & ctx. manager . pubkey ( ) ,
575+ )
567576}
568577
569578/// init strategy + add only TSLAx at 40%, so total weight is 4000: the strategy is
@@ -614,7 +623,8 @@ fn do_rebalance(
614623 sell_amount : u64 ,
615624 usdc_to_invest : u64 ,
616625) {
617- let ( sell_mint, sell_config, sell_feed, vault_sell, sell_rate) = asset_accounts ( ctx, sell_index) ;
626+ let ( sell_mint, sell_config, sell_feed, vault_sell, sell_rate) =
627+ asset_accounts ( ctx, sell_index) ;
618628 let ( buy_mint, buy_config, buy_feed, vault_buy, buy_rate) = asset_accounts ( ctx, buy_index) ;
619629 let ix = Instruction :: new_with_bytes (
620630 ctx. vault_program_id ,
@@ -648,8 +658,13 @@ fn do_rebalance(
648658 }
649659 . to_account_metas ( None ) ,
650660 ) ;
651- send_transaction_from_instructions ( & mut ctx. svm , vec ! [ ix] , & [ & ctx. manager ] , & ctx. manager . pubkey ( ) )
652- . unwrap ( ) ;
661+ send_transaction_from_instructions (
662+ & mut ctx. svm ,
663+ vec ! [ ix] ,
664+ & [ & ctx. manager ] ,
665+ & ctx. manager . pubkey ( ) ,
666+ )
667+ . unwrap ( ) ;
653668}
654669
655670fn advance_one_year ( ctx : & mut TestContext ) {
@@ -1121,10 +1136,7 @@ fn test_withdraw() {
11211136 send_transaction_from_instructions ( & mut ctx. svm , vec ! [ ix] , & [ & user] , & user. pubkey ( ) ) . unwrap ( ) ;
11221137
11231138 // Sole holder withdraws everything in kind: all 16000 TSLAx + 33333 NVDAx, no USDC.
1124- assert_eq ! (
1125- get_token_account_balance( & ctx. svm, & user_usdc) . unwrap( ) ,
1126- 0
1127- ) ;
1139+ assert_eq ! ( get_token_account_balance( & ctx. svm, & user_usdc) . unwrap( ) , 0 ) ;
11281140 assert_eq ! (
11291141 get_token_account_balance( & ctx. svm, & derive_ata( & user. pubkey( ) , & ctx. tsla_mint) ) . unwrap( ) ,
11301142 16_000
@@ -1274,7 +1286,10 @@ fn test_set_weight_rejects_overflow() {
12741286 standard_strategy ( & mut ctx) ;
12751287 // TSLAx 4000 + NVDAx 6000 = 10000. Raising TSLAx to 6000 would total 12000.
12761288 let r = set_weight ( & mut ctx, 0 , 6000 ) ;
1277- assert ! ( r. is_err( ) , "weight change pushing total over 10000 must revert" ) ;
1289+ assert ! (
1290+ r. is_err( ) ,
1291+ "weight change pushing total over 10000 must revert"
1292+ ) ;
12781293}
12791294
12801295#[ test]
0 commit comments