Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Save declared class only if the fee charge was successful #762

@juanbono

Description

@juanbono

Declare and Declare V2 transactions charge a fee after we save the ContractClass in the State.
This is a problem because when the transaction's sender doesn't have enough balance, the transaction fails, but the cached state remains with the already added entry (class_hash, contract_class).

We should check the return of the charge_fee method and only save it into the state when it finishes successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions