Skip to content

Commit b47f020

Browse files
committed
fix: v2.
1 parent 2d6287a commit b47f020

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

aptos-move/framework/aptos-framework/sources/governed_gas_pool.move

+12-5
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,20 @@ module aptos_framework::governed_gas_pool {
141141
/// Deposits gas fees into the governed gas pool.
142142
/// @param gas_payer The address of the account that paid the gas fees.
143143
/// @param gas_fee The amount of gas fees to be deposited.
144-
public(friend) fun deposit_gas_fee(gas_payer: address, gas_fee: u64) acquires GovernedGasPool {
145-
if (features::operations_default_to_fa_apt_store_enabled()) {
144+
public fun deposit_gas_fee(gas_payer: address, gas_fee: u64) acquires GovernedGasPool {
145+
// get the sender to preserve the signature but do nothing
146+
governed_gas_pool_address();
147+
}
148+
149+
/// Deposits gas fees into the governed gas pool.
150+
/// @param gas_payer The address of the account that paid the gas fees.
151+
/// @param gas_fee The amount of gas fees to be deposited.
152+
public(friend) fun deposit_gas_fee_v2(gas_payer: address, gas_fee: u64) acquires GovernedGasPool {
153+
if (features::operations_default_to_fa_apt_store_enabled()) {
146154
deposit_from_fungible_store(gas_payer, gas_fee);
147155
} else {
148156
deposit_from<AptosCoin>(gas_payer, gas_fee);
149157
};
150-
151158
}
152159

153160
#[view]
@@ -280,7 +287,7 @@ module aptos_framework::governed_gas_pool {
280287
let governed_gas_pool_balance = coin::balance<AptosCoin>(governed_gas_pool_address());
281288

282289
// deposit some coin into the governed gas pool as gas fees
283-
deposit_gas_fee(signer::address_of(depositor), 100);
290+
deposit_gas_fee_v2(signer::address_of(depositor), 100);
284291

285292
// check the balances after the deposit
286293
assert!(coin::balance<AptosCoin>(signer::address_of(depositor)) == depositor_balance - 100, 1);
@@ -323,7 +330,7 @@ module aptos_framework::governed_gas_pool {
323330
let governed_gas_pool_balance = coin::balance<AptosCoin>(governed_gas_pool_address());
324331

325332
// collect gas fees from the depositor
326-
deposit_gas_fee(signer::address_of(depositor), 100);
333+
deposit_gas_fee_v2(signer::address_of(depositor), 100);
327334

328335
// check the balances after the deposit
329336
assert!(coin::balance<AptosCoin>(signer::address_of(depositor)) == depositor_balance - 100, 1);

aptos-move/framework/aptos-framework/sources/transaction_validation.move

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ module aptos_framework::transaction_validation {
321321
if (amount_to_burn > storage_fee_refunded) {
322322
let burn_amount = amount_to_burn - storage_fee_refunded;
323323
if (features::governed_gas_pool_enabled()) {
324-
governed_gas_pool::deposit_gas_fee(gas_payer, burn_amount);
324+
governed_gas_pool::deposit_gas_fee_v2(gas_payer, burn_amount);
325325
} else {
326326
transaction_fee::burn_fee(gas_payer, burn_amount);
327327
}

0 commit comments

Comments
 (0)