@@ -355,7 +355,7 @@ impl TopLevelState {
355355 fee_payer : & Address ,
356356 fee_payer_public : & Public ,
357357 ) -> StateResult < ParcelInvoice > {
358- // Change the address to a master address if it is a regular key.
358+ // Change the address to an owner address if it is a regular key.
359359 let fee_payer = if self . regular_account_exists_and_not_null ( fee_payer) ? {
360360 let regular_account = self . require_regular_account_from_address ( fee_payer) ?;
361361 public_to_address ( & regular_account. owner_public ( ) )
@@ -764,16 +764,16 @@ impl TopState<StateDB> for TopLevelState {
764764 Ok ( ( ) )
765765 }
766766
767- fn set_regular_key ( & mut self , master_public : & Public , regular_key : & Public ) -> StateResult < ( ) > {
768- let master_address = public_to_address ( master_public ) ;
767+ fn set_regular_key ( & mut self , owner_public : & Public , regular_key : & Public ) -> StateResult < ( ) > {
768+ let owner_address = public_to_address ( owner_public ) ;
769769
770- let ( master_public , master_address ) = if self . regular_account_exists_and_not_null ( & master_address ) ? {
771- let regular_account = self . require_regular_account_from_address ( & master_address ) ?;
772- let master_public = regular_account. owner_public ( ) . clone ( ) ;
773- let master_address = public_to_address ( & master_public ) ;
774- ( master_public , master_address )
770+ let ( owner_public , owner_address ) = if self . regular_account_exists_and_not_null ( & owner_address ) ? {
771+ let regular_account = self . require_regular_account_from_address ( & owner_address ) ?;
772+ let owner_public = regular_account. owner_public ( ) . clone ( ) ;
773+ let owner_address = public_to_address ( & owner_public ) ;
774+ ( owner_public , owner_address )
775775 } else {
776- ( * master_public , public_to_address ( & master_public ) )
776+ ( * owner_public , public_to_address ( & owner_public ) )
777777 } ;
778778
779779 let regular_address = public_to_address ( regular_key) ;
@@ -782,18 +782,18 @@ impl TopState<StateDB> for TopLevelState {
782782 }
783783
784784 if self . account_exists_and_not_null ( & regular_address) ? {
785- return Err ( ParcelError :: RegularKeyAlreadyInUseAsMaster . into ( ) )
785+ return Err ( ParcelError :: RegularKeyAlreadyInUseAsPlatformAccount . into ( ) )
786786 }
787787
788- let prev_regular_key = self . require_account ( & master_address ) ?. regular_key ( ) ;
788+ let prev_regular_key = self . require_account ( & owner_address ) ?. regular_key ( ) ;
789789
790790 if let Some ( prev_regular_key) = prev_regular_key {
791791 self . kill_regular_account ( & prev_regular_key) ;
792792 }
793793
794- let mut master_account = self . require_account ( & master_address ) ?;
795- master_account . set_regular_key ( regular_key) ;
796- self . require_regular_account ( & regular_key) ?. set_owner_public ( & master_public ) ;
794+ let mut owner_account = self . require_account ( & owner_address ) ?;
795+ owner_account . set_regular_key ( regular_key) ;
796+ self . require_regular_account ( & regular_key) ?. set_owner_public ( & owner_public ) ;
797797 Ok ( ( ) )
798798 }
799799
@@ -1346,7 +1346,7 @@ mod tests_parcel {
13461346 }
13471347
13481348 #[ test]
1349- fn use_master_balance_when_signed_with_regular_key ( ) {
1349+ fn use_owner_balance_when_signed_with_regular_key ( ) {
13501350 let mut state = get_temp_state ( ) ;
13511351 let regular_keypair = Random . generate ( ) . unwrap ( ) ;
13521352 let key = regular_keypair. public ( ) ;
@@ -1419,7 +1419,7 @@ mod tests_parcel {
14191419 }
14201420
14211421 #[ test]
1422- fn fail_when_regular_key_is_already_registered_as_master_key ( ) {
1422+ fn fail_when_regular_key_is_already_registered_as_owner_key ( ) {
14231423 let ( sender, sender_public) = address ( ) ;
14241424 let ( sender2, sender_public2) = address ( ) ;
14251425
@@ -1438,7 +1438,7 @@ mod tests_parcel {
14381438 } ;
14391439
14401440 let result = state. apply ( & parcel, & sender, & sender_public) ;
1441- assert_eq ! ( Err ( StateError :: Parcel ( ParcelError :: RegularKeyAlreadyInUseAsMaster ) ) , result) ;
1441+ assert_eq ! ( Err ( StateError :: Parcel ( ParcelError :: RegularKeyAlreadyInUseAsPlatformAccount ) ) , result) ;
14421442 }
14431443
14441444 #[ test]
@@ -1558,7 +1558,7 @@ mod tests_parcel {
15581558 }
15591559
15601560 #[ test]
1561- fn use_deleted_regular_key_as_master_key ( ) {
1561+ fn use_deleted_regular_key_as_owner_key ( ) {
15621562 let ( sender, sender_public) = address ( ) ;
15631563 let ( regular_address, regular_public) = address ( ) ;
15641564 let ( _, regular_public2) = address ( ) ;
0 commit comments