starknet-rs
starknet-rs copied to clipboard
fix(class): 🐛 `LegacyContractClass` deserialization failing on empty ABI
Pull Request type
- Bugfix
What is the current behavior?
LegacyContractClass deserialization fails on classes with a missing ABI.
Earliest example of this is class 0x01cbbbd9543d07a5769e0d17bca0ede054082a27689aa7b6b3731851e0c65326 at block 20732.
What is the new behavior?
LegacyContractClasscan now have a missing (Option) ABI.
Does this introduce a breaking change?
Yes. Code that retrieves the ABI from a LegacyContractClass will have to be updated to handle the new Option.
How are you parsing the class? IIRC the class as generated by the compiler will always have the abi field, even when it's empty. This type is for the compiler output. If you're parsing response from providers, you should use starknet_core::types::ContractClass.