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

Support for alloy_primitive int types #137

Merged
merged 6 commits into from
Aug 6, 2024
Merged

Support for alloy_primitive int types #137

merged 6 commits into from
Aug 6, 2024

Conversation

rory-ocl
Copy link
Contributor

@rory-ocl rory-ocl commented Jul 25, 2024

Description

Support for alloy_primitives::Signed and alloy_primitives::Uint in return types and parameters.

TODO

Still in draft as I finish up the following tasks:

  • Test all types in both return types and parameters
  • Ensure this does not increase gas cost for already-supported types and apply optimization if necessary

Checklist

  • I have documented these changes where necessary.
  • I have read the DCO and ensured that these changes comply.
  • I assign this work under its open source licensing.

Copy link
Contributor

@rauljordan rauljordan left a comment

Choose a reason for hiding this comment

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

LGTM just pending the overflow check

pub struct SolInt<const BITS: usize, const LIMBS: usize>;

impl<const BITS: usize, const LIMBS: usize> AbiType for Signed<BITS, LIMBS>
where
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the most hardcore generic constraint I've seen 😅, great job on getting it to work

let (head, _tail) = slice.split_at(TL);
let mut limbs = [0; TL];
limbs.copy_from_slice(head);
/* TODO overflow check needed?

This comment was marked as resolved.

@rory-ocl rory-ocl marked this pull request as ready for review July 29, 2024 22:25
rauljordan
rauljordan previously approved these changes Jul 30, 2024
@rory-ocl rory-ocl marked this pull request as draft July 31, 2024 19:17
@rory-ocl rory-ocl changed the base branch from stylus to develop July 31, 2024 19:19
@rory-ocl rory-ocl marked this pull request as ready for review August 6, 2024 18:58
Copy link
Member

@joshuacolvin0 joshuacolvin0 left a comment

Choose a reason for hiding this comment

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

LGTM

@rory-ocl rory-ocl merged commit b42ad27 into develop Aug 6, 2024
8 of 10 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