File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
aptos-move/framework/aptos-framework/sources Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,11 @@ module aptos_framework::governed_gas_pool {
55
55
) {
56
56
system_addresses::assert_aptos_framework (aptos_framework);
57
57
58
+ // return if the governed gas pool has already been initialized
59
+ if (exists <GovernedGasPool >(signer ::address_of (aptos_framework))) {
60
+ return
61
+ };
62
+
58
63
// generate a seed to be used to create the resource account hosting the delegation pool
59
64
let seed = create_resource_account_seed (delegation_pool_creation_seed);
60
65
@@ -348,4 +353,12 @@ module aptos_framework::governed_gas_pool {
348
353
assert !(coin::balance <AptosCoin >(signer ::address_of (beneficiary)) == 100 , 4 );
349
354
350
355
}
356
+
357
+ #[test(aptos_framework = @aptos_framework )]
358
+ fun test_initialize_is_idempotent (aptos_framework: &signer ) {
359
+ // initialize the governed gas pool
360
+ initialize_for_test (aptos_framework);
361
+ // initialize the governed gas pool again, no abort
362
+ initialize (aptos_framework, vector ::empty <u8 >());
363
+ }
351
364
}
You can’t perform that action at this time.
0 commit comments