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

StateReader method should not require &mut self #1771

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

StateReader method should not require &mut self #1771

tdelabro opened this issue Apr 8, 2024 · 1 comment

Comments

@tdelabro
Copy link
Contributor

tdelabro commented Apr 8, 2024

  fn get_fee_token_balance(
        &mut self,
        contract_address: ContractAddress,
        fee_token_address: ContractAddress,
    ) -> Result<(StarkFelt, StarkFelt), StateError> {
        let low_key = get_fee_token_var_address(contract_address);
        let high_key = next_storage_key(&low_key)?;
        let low = self.get_storage_at(fee_token_address, low_key)?;
        let high = self.get_storage_at(fee_token_address, high_key)?;

        Ok((low, high))
    }

StateReader::get_fee_token_balance should not take &mut self, it's the reader API.

Because this one has a default implem it went under my radar on my PR #1325. It has to be fixed asap

@tdelabro
Copy link
Contributor Author

tdelabro commented Apr 8, 2024

I pushed the related changes on our fork in this commit: bidzyyys@4c2580e

gswirski pushed a commit to reilabs/blockifier that referenced this issue Jun 26, 2024
Co-authored-by: glihm <glihm@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant