Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rpc): fix return type of starknet_getClass and starknet_getClassAt #408

Merged
merged 1 commit into from
Jun 24, 2022

Conversation

kkovaacs
Copy link
Contributor

According to the OpenRPC specification the Base64 encoded, gzip
compressed JSON representation of the class should be returned. (The
same representation that is used by the write API.)

Just like the entry points, we don't store this in the database
directly, so we have to decompress our full JSON, extract the relevant
part, and then compress and encode it as expected by the specification.

Fixes #406

Copy link
Contributor

@Mirko-von-Leipzig Mirko-von-Leipzig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the bytecode that we store not a zstd compressed version of what we want? i.e. what is the difference between the two? One we stored as felts I think, but aren't those just the original bytes chunked into felts?

@kkovaacs
Copy link
Contributor Author

Is the bytecode that we store not a zstd compressed version of what we want? i.e. what is the difference between the two? One we stored as felts I think, but aren't those just the original bytes chunked into felts?

No. bytecode is just the data part of the program (effectively a subset).

@kkovaacs kkovaacs force-pushed the krisztian/fix-rpc-getclass-program branch from e312062 to 067199b Compare June 24, 2022 15:03
…ssAt`

According to the OpenRPC specification the Base64 encoded, gzip
compressed JSON representation of the class should be returned. (The
same representation that is used by the write API.)

Just like the entry points, we don't store this in the database
directly, so we have to decompress our full JSON, extract the relevant
part, and then compress and encode it as expected by the specification.
@kkovaacs kkovaacs merged commit fd02ff4 into main Jun 24, 2022
@kkovaacs kkovaacs deleted the krisztian/fix-rpc-getclass-program branch June 24, 2022 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getClass and getClassAt RPC methods return incorrect program type
2 participants