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

Description
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.