Skip to content

Commit

Permalink
fix: v2.
Browse files Browse the repository at this point in the history
  • Loading branch information
l-monninger committed Feb 28, 2025
1 parent 2d6287a commit b47f020
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,20 @@ module aptos_framework::governed_gas_pool {
/// Deposits gas fees into the governed gas pool.
/// @param gas_payer The address of the account that paid the gas fees.
/// @param gas_fee The amount of gas fees to be deposited.
public(friend) fun deposit_gas_fee(gas_payer: address, gas_fee: u64) acquires GovernedGasPool {
if (features::operations_default_to_fa_apt_store_enabled()) {
public fun deposit_gas_fee(gas_payer: address, gas_fee: u64) acquires GovernedGasPool {
// get the sender to preserve the signature but do nothing
governed_gas_pool_address();
}

/// Deposits gas fees into the governed gas pool.
/// @param gas_payer The address of the account that paid the gas fees.
/// @param gas_fee The amount of gas fees to be deposited.
public(friend) fun deposit_gas_fee_v2(gas_payer: address, gas_fee: u64) acquires GovernedGasPool {
if (features::operations_default_to_fa_apt_store_enabled()) {
deposit_from_fungible_store(gas_payer, gas_fee);
} else {
deposit_from<AptosCoin>(gas_payer, gas_fee);
};

}

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

// deposit some coin into the governed gas pool as gas fees
deposit_gas_fee(signer::address_of(depositor), 100);
deposit_gas_fee_v2(signer::address_of(depositor), 100);

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

// collect gas fees from the depositor
deposit_gas_fee(signer::address_of(depositor), 100);
deposit_gas_fee_v2(signer::address_of(depositor), 100);

// check the balances after the deposit
assert!(coin::balance<AptosCoin>(signer::address_of(depositor)) == depositor_balance - 100, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ module aptos_framework::transaction_validation {
if (amount_to_burn > storage_fee_refunded) {
let burn_amount = amount_to_burn - storage_fee_refunded;
if (features::governed_gas_pool_enabled()) {
governed_gas_pool::deposit_gas_fee(gas_payer, burn_amount);
governed_gas_pool::deposit_gas_fee_v2(gas_payer, burn_amount);
} else {
transaction_fee::burn_fee(gas_payer, burn_amount);
}
Expand Down

0 comments on commit b47f020

Please sign in to comment.