1010 state:: { ConfigKeys , ConfigState } ,
1111 } ,
1212 solana_sdk:: {
13- account:: { AccountSharedData , WritableAccount } ,
13+ account:: AccountSharedData ,
1414 instruction:: { AccountMeta , Instruction } ,
1515 program_error:: ProgramError ,
1616 pubkey:: Pubkey ,
@@ -84,7 +84,7 @@ fn test_process_create_ok() {
8484 & [ ( config, config_account) ] ,
8585 & [
8686 Check :: success ( ) ,
87- Check :: compute_units ( 619 ) ,
87+ Check :: compute_units ( 616 ) ,
8888 Check :: account ( & config)
8989 . data (
9090 & bincode:: serialize ( & ( ConfigKeys { keys : vec ! [ ] } , MyConfig :: default ( ) ) )
@@ -112,7 +112,7 @@ fn test_process_store_ok() {
112112 & [ ( config, config_account) ] ,
113113 & [
114114 Check :: success ( ) ,
115- Check :: compute_units ( 619 ) ,
115+ Check :: compute_units ( 616 ) ,
116116 Check :: account ( & config)
117117 . data ( & bincode:: serialize ( & ( ConfigKeys { keys } , my_config) ) . unwrap ( ) )
118118 . build ( ) ,
@@ -187,7 +187,7 @@ fn test_process_store_with_additional_signers() {
187187 ] ,
188188 & [
189189 Check :: success ( ) ,
190- Check :: compute_units ( 3_274 ) ,
190+ Check :: compute_units ( 3_271 ) ,
191191 Check :: account ( & config)
192192 . data ( & bincode:: serialize ( & ( ConfigKeys { keys } , my_config) ) . unwrap ( ) )
193193 . build ( ) ,
@@ -335,7 +335,7 @@ fn test_config_updates() {
335335 ( signer0, AccountSharedData :: default ( ) ) ,
336336 ( signer1, AccountSharedData :: default ( ) ) ,
337337 ] ,
338- & [ Check :: success ( ) , Check :: compute_units ( 3_274 ) ] ,
338+ & [ Check :: success ( ) , Check :: compute_units ( 3_271 ) ] ,
339339 ) ;
340340
341341 // Use this for next invoke.
@@ -353,7 +353,7 @@ fn test_config_updates() {
353353 ] ,
354354 & [
355355 Check :: success ( ) ,
356- Check :: compute_units ( 3_275 ) ,
356+ Check :: compute_units ( 3_272 ) ,
357357 Check :: account ( & config)
358358 . data ( & bincode:: serialize ( & ( ConfigKeys { keys } , new_config) ) . unwrap ( ) )
359359 . build ( ) ,
@@ -466,7 +466,7 @@ fn test_config_update_contains_duplicates_fails() {
466466 ( signer0, AccountSharedData :: default ( ) ) ,
467467 ( signer1, AccountSharedData :: default ( ) ) ,
468468 ] ,
469- & [ Check :: success ( ) , Check :: compute_units ( 3_274 ) ] ,
469+ & [ Check :: success ( ) , Check :: compute_units ( 3_271 ) ] ,
470470 ) ;
471471
472472 // Attempt update with duplicate signer inputs.
@@ -510,7 +510,7 @@ fn test_config_updates_requiring_config() {
510510 ] ,
511511 & [
512512 Check :: success ( ) ,
513- Check :: compute_units ( 3_370 ) ,
513+ Check :: compute_units ( 3_367 ) ,
514514 Check :: account ( & config)
515515 . data ( & bincode:: serialize ( & ( ConfigKeys { keys : keys. clone ( ) } , my_config) ) . unwrap ( ) )
516516 . build ( ) ,
@@ -531,7 +531,7 @@ fn test_config_updates_requiring_config() {
531531 ] ,
532532 & [
533533 Check :: success ( ) ,
534- Check :: compute_units ( 3_370 ) ,
534+ Check :: compute_units ( 3_367 ) ,
535535 Check :: account ( & config)
536536 . data ( & bincode:: serialize ( & ( ConfigKeys { keys } , new_config) ) . unwrap ( ) )
537537 . build ( ) ,
@@ -625,7 +625,7 @@ fn test_maximum_keys_input() {
625625 let result = mollusk. process_and_validate_instruction (
626626 & instruction,
627627 & [ ( config, config_account) ] ,
628- & [ Check :: success ( ) , Check :: compute_units ( 25_282 ) ] ,
628+ & [ Check :: success ( ) , Check :: compute_units ( 25_279 ) ] ,
629629 ) ;
630630
631631 // Use this for next invoke.
@@ -638,7 +638,7 @@ fn test_maximum_keys_input() {
638638 let result = mollusk. process_and_validate_instruction (
639639 & instruction,
640640 & [ ( config, updated_config_account) ] ,
641- & [ Check :: success ( ) , Check :: compute_units ( 25_282 ) ] ,
641+ & [ Check :: success ( ) , Check :: compute_units ( 25_279 ) ] ,
642642 ) ;
643643
644644 // Use this for next invoke.
@@ -750,33 +750,6 @@ fn test_safe_deserialize_from_state() {
750750 ) ;
751751}
752752
753- // Backwards compatibility test case.
754- #[ test]
755- fn test_write_same_data_to_executable ( ) {
756- let mollusk = setup ( ) ;
757-
758- let config = Pubkey :: new_unique ( ) ;
759- let keys = vec ! [ ] ;
760-
761- // Creates a config account with `MyConfig::default()`.
762- let mut config_account = create_config_account ( & mollusk, keys. clone ( ) ) ;
763-
764- // Make the config account executable.
765- config_account. set_executable ( true ) ;
766-
767- // Pass the exact same data (`MyConfig::default()`) to the instruction,
768- // which we'll attempt to write into the account.
769- let instruction = config_instruction:: store ( & config, true , keys. clone ( ) , & MyConfig :: default ( ) ) ;
770-
771- mollusk. process_and_validate_instruction (
772- & instruction,
773- & [ ( config, config_account) ] ,
774- & [ Check :: err ( ProgramError :: Custom (
775- ConfigError :: ExecutableDataModified as u32 ,
776- ) ) ] ,
777- ) ;
778- }
779-
780753// Backwards compatibility test case.
781754#[ test]
782755fn test_write_same_data_to_readonly ( ) {
0 commit comments