@@ -134,11 +134,6 @@ fn assign_account_to_program(
134
134
keyed_account : & mut KeyedAccount ,
135
135
program_id : & Pubkey ,
136
136
) -> Result < ( ) , InstructionError > {
137
- // no work to do, just return
138
- if keyed_account. account . owner == * program_id {
139
- return Ok ( ( ) ) ;
140
- }
141
-
142
137
if keyed_account. signer_key ( ) . is_none ( ) {
143
138
debug ! ( "Assign: account must sign" ) ;
144
139
return Err ( InstructionError :: MissingRequiredSignature ) ;
@@ -718,14 +713,6 @@ mod tests {
718
713
) ,
719
714
Err ( InstructionError :: MissingRequiredSignature )
720
715
) ;
721
- // no change, no signature needed
722
- assert_eq ! (
723
- assign_account_to_program(
724
- & mut KeyedAccount :: new( & from, false , & mut from_account) ,
725
- & system_program:: id( ) ,
726
- ) ,
727
- Ok ( ( ) )
728
- ) ;
729
716
730
717
assert_eq ! (
731
718
process_instruction(
@@ -842,45 +829,6 @@ mod tests {
842
829
)
843
830
}
844
831
845
- #[ test]
846
- fn test_create_account_no_transfer ( ) {
847
- solana_logger:: setup ( ) ;
848
- let ( genesis_config, alice_keypair) = create_genesis_config ( 100 ) ;
849
- let alice_pubkey = alice_keypair. pubkey ( ) ;
850
- let bob_keypair = Keypair :: new ( ) ;
851
- let bob_pubkey = bob_keypair. pubkey ( ) ;
852
-
853
- // Fund to account to bypass AccountNotFound error
854
- let bank = Bank :: new ( & genesis_config) ;
855
- let bank_client = BankClient :: new ( bank) ;
856
- bank_client
857
- . transfer ( 50 , & alice_keypair, & bob_pubkey)
858
- . unwrap ( ) ;
859
- let program_id = Pubkey :: new_rand ( ) ;
860
-
861
- // test system_instruction: that alice's signature is not asked for
862
- let instruction =
863
- system_instruction:: create_account ( & alice_pubkey, & bob_pubkey, 0 , 1 , & program_id) ;
864
-
865
- assert ! ( !instruction. accounts[ 0 ] . is_signer) ;
866
-
867
- // test system_instruction_processor: that alice's signature is needed
868
- assert ! ( bank_client
869
- . send_instruction( & bob_keypair, instruction)
870
- . is_ok( ) ) ;
871
-
872
- assert_eq ! ( bank_client. get_balance( & alice_pubkey) . unwrap( ) , 50 ) ;
873
- assert_eq ! (
874
- bank_client. get_account( & bob_pubkey) . unwrap( ) . unwrap( ) ,
875
- Account {
876
- data: vec![ 0 ; 1 ] ,
877
- owner: program_id,
878
- lamports: 50 ,
879
- ..Account :: default ( )
880
- }
881
- ) ;
882
- }
883
-
884
832
#[ test]
885
833
fn test_system_unsigned_transaction ( ) {
886
834
let ( genesis_config, alice_keypair) = create_genesis_config ( 100 ) ;
0 commit comments