@@ -26,7 +26,8 @@ enum InitializeVariant {
2626
2727#[ test_case( InitializeVariant :: Initialize ; "initialize" ) ]
2828#[ test_case( InitializeVariant :: InitializeChecked ; "initialize_checked" ) ]
29- fn test_initialize ( variant : InitializeVariant ) {
29+ #[ tokio:: test]
30+ async fn test_initialize ( variant : InitializeVariant ) {
3031 let mut ctx = StakeTestContext :: new ( ) ;
3132
3233 let custodian = Pubkey :: new_unique ( ) ;
@@ -46,7 +47,6 @@ fn test_initialize(variant: InitializeVariant) {
4647 InitializeVariant :: InitializeChecked => Lockup :: default ( ) ,
4748 } ;
4849
49- // Create an uninitialized stake account
5050 let ( stake, stake_account) = ctx. stake_account ( StakeLifecycle :: Uninitialized ) . build ( ) ;
5151
5252 // Process the Initialize instruction, including testing missing signers
@@ -113,7 +113,8 @@ fn test_initialize(variant: InitializeVariant) {
113113
114114#[ test_case( InitializeVariant :: Initialize ; "initialize" ) ]
115115#[ test_case( InitializeVariant :: InitializeChecked ; "initialize_checked" ) ]
116- fn test_initialize_insufficient_funds ( variant : InitializeVariant ) {
116+ #[ tokio:: test]
117+ async fn test_initialize_insufficient_funds ( variant : InitializeVariant ) {
117118 let ctx = StakeTestContext :: new ( ) ;
118119
119120 let custodian = Pubkey :: new_unique ( ) ;
@@ -130,7 +131,7 @@ fn test_initialize_insufficient_funds(variant: InitializeVariant) {
130131 InitializeVariant :: InitializeChecked => Lockup :: default ( ) ,
131132 } ;
132133
133- // Create account with insufficient lamports (need to manually create since builder adds rent automatically)
134+ // Create account with insufficient lamports (manually since builder adds rent automatically)
134135 let stake = Pubkey :: new_unique ( ) ;
135136 let stake_account = AccountSharedData :: new_data_with_space (
136137 ctx. rent_exempt_reserve / 2 , // Not enough lamports
@@ -160,11 +161,10 @@ fn test_initialize_insufficient_funds(variant: InitializeVariant) {
160161
161162#[ test_case( InitializeVariant :: Initialize ; "initialize" ) ]
162163#[ test_case( InitializeVariant :: InitializeChecked ; "initialize_checked" ) ]
163- fn test_initialize_incorrect_size_larger ( variant : InitializeVariant ) {
164+ #[ tokio:: test]
165+ async fn test_initialize_incorrect_size_larger ( variant : InitializeVariant ) {
164166 let ctx = StakeTestContext :: new ( ) ;
165167
166- // Original program_test.rs uses double rent instead of just
167- // increasing the size by 1. This behavior remains (makes no difference here).
168168 let rent_exempt_reserve = Rent :: default ( ) . minimum_balance ( StakeStateV2 :: size_of ( ) * 2 ) ;
169169
170170 let custodian = Pubkey :: new_unique ( ) ;
@@ -211,11 +211,10 @@ fn test_initialize_incorrect_size_larger(variant: InitializeVariant) {
211211
212212#[ test_case( InitializeVariant :: Initialize ; "initialize" ) ]
213213#[ test_case( InitializeVariant :: InitializeChecked ; "initialize_checked" ) ]
214- fn test_initialize_incorrect_size_smaller ( variant : InitializeVariant ) {
214+ #[ tokio:: test]
215+ async fn test_initialize_incorrect_size_smaller ( variant : InitializeVariant ) {
215216 let ctx = StakeTestContext :: new ( ) ;
216217
217- // Original program_test.rs uses rent for size instead of
218- // rent for size - 1. This behavior remains (makes no difference here).
219218 let rent_exempt_reserve = Rent :: default ( ) . minimum_balance ( StakeStateV2 :: size_of ( ) ) ;
220219
221220 let custodian = Pubkey :: new_unique ( ) ;
0 commit comments