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

Feature: Add corelib types #30

Merged
merged 24 commits into from
May 2, 2024
Merged

Conversation

piniom
Copy link
Collaborator

@piniom piniom commented Apr 26, 2024

The goal of this PR is twofold:

  1. Add a missing NonZero type to the cainome repo. The type will be restricted to hold integers only.
  2. Move the U256 type from generated code to the cainome repo directly. This would allow us to write methods such as fn to_bytes_be(&self) -> [u8, 32]; on the type and allow it to be used with the new NonZero type.

@piniom piniom marked this pull request as ready for review April 30, 2024 09:14
Copy link
Collaborator

@glihm glihm left a comment

Choose a reason for hiding this comment

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

Amazing @piniom. 🔥
Like this the fact that U256 exposes the bytes, we're sure that any library can just easily interact with cainome without being too opinionated.

Only the

use cainome::cairo_serde::U256;

Into the simple_get_set.rs test missing.

};
assert_eq!(U256::cairo_serialized_size(&u256), 2);
}
#[test]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we space the tests for easier paragraph navigation?

@glihm glihm merged commit 60da94a into cartridge-gg:main May 2, 2024
5 checks passed
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.

3 participants