Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

bug:Retrieving class for contract version 0 reported an error #1585

Closed
fishseabowl opened this issue May 1, 2024 · 9 comments
Closed

bug:Retrieving class for contract version 0 reported an error #1585

fishseabowl opened this issue May 1, 2024 · 9 comments
Labels
bug Something isn't working stale

Comments

@fishseabowl
Copy link
Contributor

Bug Report

Madara version:

commit: 38ef50e
Current behavior:

In the file starknet-rpc-test/get_class_at.rs, line 67:

let program: LegacyProgram = serde_json::from_str(data.as_str())?;

reported: Error: invalid type: map, expected string at line 1 column 134

"{"prime":"0x800000000000011000000000000000000000000000000000000000000000001","builtins":["pedersen","range_check","bitwise"],"data":[{"Int":{"value":{"val":[2147450879,67600385]}}},{"Int":{"value":{"val":[1]}}},{"Int":{"value":{"val":[2147450878,546013183]}}},{"Int":{"value":{"val":[2147188732,1073971200]}}},{"Int":{"value":{"val":[2147188733,1073971201]}}},{"Int":{"value":{"val":[2147188736,1210482689]}}},{"Int":{"value":{"val":[3]}}},{"Int":{"value":{"val":[2147188736,1208123394]}}},{"Int":{"value":{"val":[2147450878,546013183]}}},{"Int":{"value":{"val":[2147450878,546013183]}}},{"Int":{"value":{"val":[2147581952,285507585]}}},{"Int":{"value":{"val":[0,0,0,0,0,0,17,134217728]}}},{"Int":{"value":{"val":[2147385344,1210351617]}}},{"Int":{"value":{"val":[4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,16,134217728]}}},{"Int":{"value":{"val":[2147450878,546013183]}}},{"Int":{"value":{"val":[2147450880,1208385537]}}},{"Int":{"value":{"val":[1918985076,1131376244,1130458220]}}},{"Int":{"value":{"val":[2147057663,1073905664]}}},{"Int":{"value":{"val":[2147057658,1073971201]}}},{"Int":{"value":{"val":[2147057659,1073971202]}}},{"Int":{"value":{"val":[2147057660,1073971203]}}},{"Int":{"value":{"val":[2147057661,1073971204]}}},{"Int":{"value":{"val":[2147057664,1210482689]}}},{"Int":{"value":{"val":[7]}}},{"Int":{"value":{"val":[2147057664,1208123397]}}},{"Int":{"value":{"val":[2147057664,1208123398]}}},{"Int":{"value":{"val":[2147450878,546013183]}}},{"Int":{"value":{"val":[2147450880,1208385537]}}},{"Int":{"value":{"val":[1130458220,1918988921,5007714]}}},{"Int":{"value":{"val":[2147057663,1073905664]}}},{"Int":{"value":{"val":[2147057658,1073971201]}}},{"Int":{"value":{"val":[2147057659,1073971202]}}},{"Int":{"value":{"val":[2147057660,1073971203]}}},{"Int":{"value":{"val":[2147057661,1073971204]}}},{"Int":{"value":{"val":[2147057664,1210482689]}}},{"Int":{"value":{"val":[7]}}},{"Int":{"value":{"val":[2147057664,1208123397]}}},{"Int":{"value":{"val":[2147057664,1208123398]}}},{"Int":{"value":{"val":[2147450878,546013183]}}},{"Int":{"value":{"val":[2147450880,1208385537]}}},//<-- This is where column 134 should be

Expected behavior:

No error reported

Steps to reproduce:

Run work_ok_retrieving_class_for_contract_version_0 unit test

Related code:

insert short code snippets here
        ContractClass::Legacy(c) => {
            // decompress program
            let mut d = GzDecoder::new(&c.program[..]);
            let mut data = String::new();
            d.read_to_string(&mut data).unwrap();
            let program: LegacyProgram = serde_json::from_str(data.as_str())?;

Other information:

@fishseabowl fishseabowl added the bug Something isn't working label May 1, 2024
@tdelabro
Copy link
Collaborator

tdelabro commented May 6, 2024

This test is currently ignored: https://github.com/keep-starknet-strange/madara/blob/38ef50e00a7c53ef55b5b2eb9a9f59426738de03/starknet-rpc-test/get_class_at.rs#L47C13-L47C20
until #1469 is solved.

Which is the purpose of your PR #1523.

This issue seems to say that the test is failing at a commit that does not contain your PR changes. Does it still fail on your #1523 branch?

@fishseabowl
Copy link
Contributor Author

@tdelabro Thank you for your commit. This issue arose from a recent update to the codebase. My PR #1523 addresses the missing "main_scope" field reported in issue #1469. The solution was tested with commit 5e68494.

@tdelabro
Copy link
Collaborator

tdelabro commented May 7, 2024

@fishseabowl can you list the next steps please? What to merge now? What to fix later?

@fishseabowl
Copy link
Contributor Author

@fishseabowl can you list the next steps please? What to merge now? What to fix later?

@tdelabro The PR #1523 is ready to be merged. After that, we'll look into why ContractClass::Legacy serde_json format isn't decoding correctly in this issue #1585 and fix it. Thanks

@tdelabro
Copy link
Collaborator

#1523 has been merged

Copy link

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a 👍
Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs.
Thank you for your contributions!

@github-actions github-actions bot added the stale label Jun 13, 2024
@tdelabro
Copy link
Collaborator

tdelabro commented Jun 14, 2024

I changing a lot of stuffs related to this here: #1631

@github-actions github-actions bot removed the stale label Jun 15, 2024
Copy link

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a 👍
Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs.
Thank you for your contributions!

@github-actions github-actions bot added the stale label Jul 15, 2024
@tdelabro
Copy link
Collaborator

tdelabro commented Aug 2, 2024

repository archived in favor of https://github.com/madara-alliance/madara

@tdelabro tdelabro closed this as not planned Won't fix, can't repro, duplicate, stale Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

2 participants