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

feat: impl ToBigInt and ToBigUInt #42

Merged
merged 2 commits into from
Jun 25, 2024

Conversation

tdelabro
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@0xLucqs 0xLucqs left a comment

Choose a reason for hiding this comment

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

tests

Copy link
Collaborator

@pefontana pefontana left a comment

Choose a reason for hiding this comment

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

Hi @tdelabro !
I dont get why we need this, when we have the Felt methods pub fn to_bigint(&self) -> BigInt and pub fn to_biguint(&self) -> BigUint

@tdelabro
Copy link
Collaborator Author

@pefontana we need it in order to be compatible with traits that would require the implementation of ToBigInt and ToBigUInt.
The whole num-traits thing is behind a feature flag, but if you need it to interface with some libs methods or traits, you can enable the flag and use the felt type there.

Copy link
Collaborator

@0xLucqs 0xLucqs left a comment

Choose a reason for hiding this comment

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

still waiting for tests

@tdelabro
Copy link
Collaborator Author

still waiting for tests

The conversion logic is already tested there:

fn felt_to_bigints() {

There is no logic to be tested in the code added by this PR.

@0xLucqs
Copy link
Collaborator

0xLucqs commented Mar 21, 2024

for the current implementation yes but if we change something we'll get rekt, just copy paste the other tests idk

@tdelabro
Copy link
Collaborator Author

for the current implementation yes but if we change something we'll get rekt, just copy paste the other tests idk

It doesn't make sense to test twice the same thing for a change that may or may not occur in the feature.
Let's add the tests when we change the impl, if it ever happens

@tdelabro tdelabro requested review from Oppen, pefontana and 0xLucqs April 7, 2024 01:04
@tdelabro
Copy link
Collaborator Author

@Oppen can we merge this?

Copy link
Contributor

@Oppen Oppen left a comment

Choose a reason for hiding this comment

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

LGTM

@Oppen
Copy link
Contributor

Oppen commented Jun 24, 2024

@Oppen can we merge this?

LGTM but I'm not blocking the merge. Also I don't think I have merge rights anymore, official maintainers are now only Levy and Peter AFAIK.

That said, I do see a point in the tests Lucas asked for, mostly to detect regressions. Even if the tests only assert that the two ways to convert give the same results that's some assurance for future us. I do disagree that the difference it makes here is enough to block merging tho.

@0xLucqs 0xLucqs merged commit 573c589 into starknet-io:main Jun 25, 2024
2 checks passed
@tdelabro tdelabro deleted the impl-ToBigInt/ToBigUInt branch June 25, 2024 12:36
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.

5 participants