Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

AccountTransaction::handle_fee should not take &self as arg #1770

Open
tdelabro opened this issue Apr 8, 2024 · 1 comment
Open

AccountTransaction::handle_fee should not take &self as arg #1770

tdelabro opened this issue Apr 8, 2024 · 1 comment

Comments

@tdelabro
Copy link
Contributor

tdelabro commented Apr 8, 2024

    fn handle_fee(
        &self,
        state: &mut dyn State,
        tx_context: Arc<TransactionContext>,
        actual_fee: Fee,
        charge_fee: bool,
    ) -> TransactionExecutionResult<Option<CallInfo>> {
        if !charge_fee || actual_fee == Fee(0) {
            // Fee charging is not enforced in some transaction simulations and tests.
            return Ok(None);
        }

        // Charge fee.
        let fee_transfer_call_info = Self::execute_fee_transfer(state, tx_context, actual_fee)?;

        Ok(Some(fee_transfer_call_info))
    }

&self is not used. It can be removed and implemented as a type function, like Self::execute_fee_transfer it internally calls.
Or even as a standalone function as it does not use anything associated with the type like type constants or anything else

@Subsegment
Copy link

I want to make some contribution to the repo. Please assign it to me:)

gswirski pushed a commit to reilabs/blockifier that referenced this issue Jun 26, 2024
* fix: remove  from manifests name and use

* fix: generate new manifests

* ci: re-enable ensure-windows

* fix: add new generated manifests for tests

* fix: adjust clean command to new manifests path
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants