starknet-rs icon indicating copy to clipboard operation
starknet-rs copied to clipboard

fix(class): 🐛 `LegacyContractClass` deserialization failing on empty ABI

Open Trantorian1 opened this issue 1 year ago • 1 comments

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?

  • LegacyContractClass can 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.

Trantorian1 avatar Feb 28 '24 12:02 Trantorian1

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.

xJonathanLEI avatar Mar 27 '24 04:03 xJonathanLEI