@@ -8,6 +8,8 @@ module aptos_framework::account {
8
8
use std::features::get_decommission_core_resources_enabled;
9
9
#[test_only]
10
10
use std::features::change_feature_flags_for_testing;
11
+ #[test_only]
12
+ use aptos_framework::aptos_governance;
11
13
use aptos_framework::chain_id;
12
14
use aptos_framework::create_signer::create_signer;
13
15
use aptos_framework::event::{Self , EventHandle };
@@ -259,8 +261,8 @@ module aptos_framework::account {
259
261
260
262
/// Destroy the Account resource from a given account.
261
263
/// Used to destroy the core resources account on mainnet.
262
- public entry fun destroy_account_from (account : &signer , from: address ) acquires Account {
263
- system_addresses::assert_core_resource (account );
264
+ public entry fun destroy_account_from (aptos_framework : &signer , from: address ) acquires Account {
265
+ system_addresses::assert_aptos_framework (aptos_framework );
264
266
265
267
// Assert that the feature flag for decommissioning core resources is enabled
266
268
assert !(
@@ -998,10 +1000,9 @@ module aptos_framework::account {
998
1000
);
999
1001
}
1000
1002
1001
- #[test(aptos_framework = @aptos_framework , core_resources = @0xa550c18 , from = @0xdead )]
1003
+ #[test(aptos_framework = @aptos_framework , from = @0xdead )]
1002
1004
public entry fun test_destroy_account_from_with_flag_enabled (
1003
1005
aptos_framework: &signer ,
1004
- core_resources: &signer ,
1005
1006
from: &signer ,
1006
1007
) acquires Account {
1007
1008
// Enable the feature flag for testing
@@ -1016,17 +1017,16 @@ module aptos_framework::account {
1016
1017
assert !(exists <Account >(signer ::address_of (from)), 1 );
1017
1018
1018
1019
// Destroy the Account resource
1019
- destroy_account_from (core_resources , signer ::address_of (from));
1020
+ destroy_account_from (aptos_framework , signer ::address_of (from));
1020
1021
1021
1022
// Confirm the resource has been removed
1022
1023
assert !(!exists <Account >(signer ::address_of (from)), 2 );
1023
1024
}
1024
1025
1025
- #[test(aptos_framework = @aptos_framework , core_resources = @0xa550c18 , from = @0xdead )]
1026
+ #[test(aptos_framework = @aptos_framework , from = @0xdead )]
1026
1027
#[expected_failure(abort_code = 21 , location = Self)]
1027
1028
public entry fun test_destroy_account_from_with_flag_disabled (
1028
1029
aptos_framework: &signer ,
1029
- core_resources: &signer ,
1030
1030
from: &signer ,
1031
1031
) acquires Account {
1032
1032
// Disable the feature flag for testing
@@ -1041,7 +1041,10 @@ module aptos_framework::account {
1041
1041
assert !(exists <Account >(signer ::address_of (from)), 1 );
1042
1042
1043
1043
// Attempt to destroy the Account resource (should fail)
1044
- destroy_account_from (core_resources, signer ::address_of (from));
1044
+ destroy_account_from (aptos_framework, signer ::address_of (from));
1045
+
1046
+ // Confirm the resource has been removed
1047
+ assert !(!exists <Account >(signer ::address_of (from)), 2 );
1045
1048
}
1046
1049
1047
1050
#[test_only]
0 commit comments