Fix contract class unmarshall for modern cairo compilers#656
Conversation
* added contract casm compiled by scarn 2.7.0 compiler * added tests to unmarshall contract class from new casm json format
…compilers * Added bytecode_segment_lengths field to CasmClass, allowing for backward compatibility * Added NestedUInts type to handle deserialisation of CasmClass * Added test to check that ClassHash now respects bytecode_segment_lengths and calculates correct value
… of Declare transation * Simplify nested string
thiagodeev
left a comment
There was a problem hiding this comment.
Thanks for your help, @baitcode!
I left some comments, mostly about testing
Added argent 0.4.0 contract. Fixed review comments
|
@thiagodeev Fixed! Added argent account contract v0.4.0 to hash tests. |
thiagodeev
left a comment
There was a problem hiding this comment.
Thanks @baitcode. Some new observations about testing
|
@thiagodeev Thank you very much for the review. I've fixed all the comments. |
thiagodeev
left a comment
There was a problem hiding this comment.
Thanks @baitcode! Nice work.
Just a few requests:
* added test for new sierra hash * simplified EntryPoint comparisons in test
35d5fe5 to
98dda3f
Compare
There was a problem hiding this comment.
Thank you again @baitcode!
I made a new test for the ClassHash and CompiledClassHash. The code is failing in the ClassHash, I gave more details in the comment.
CompiledClassHash is working fine, congrats!
Could you please handle this?
|
Thank you again @baitcode for your contribution! |
Fixes: #655
Added workaround for abi data that is not string, but json object.
Fix ClassHash calculation for casm compiled classes for modern cairo compilers
Here is the snippet for hash values generation with starknet.py:
https://gist.github.com/baitcode/5adec0f74121d0ae3a09aaf573ff8665