-
Notifications
You must be signed in to change notification settings - Fork 63
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
Add utility functions and tests to signed integers #68
base: master
Are you sure you want to change the base?
Add utility functions and tests to signed integers #68
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are my comments for this stage of the work, but since this PR is a work in progress, I will convert this open PR to draft. I also edited the title to reflect that these changes are implemented for all signed integer types. You can mark it ready for review (open) once functions for other types and tests for all the new functions are added.
underlying: Self::indent() - self.underlying, | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
} | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🫡
@@ -16,6 +16,8 @@ mod success { | |||
|
|||
let instance = Testi128::new(wallet, path_to_bin); | |||
|
|||
let _result = instance.main().call().await; | |||
let params = TxParameters::new(Some(1), Some(10000000), None); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same suggestion for other instances of this, for readability purposes.
let params = TxParameters::new(Some(1), Some(10000000), None); | |
let params = TxParameters::new(Some(1), Some(10_000_000), None); | |
let _result = instance.main().tx_params(params).call().await; | ||
assert_eq!(_result.is_err(), false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The underscore is used for unused variables.
Same suggestion for other instances of this usage.
let _result = instance.main().tx_params(params).call().await; | |
assert_eq!(_result.is_err(), false); | |
let result = instance.main().tx_params(params).call().await.unwrap(); | |
assert!(result.value); | |
alexey seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Type of change
Changes
The following changes have been made to I128 and I256:
The following changes have been made to I8, I16, I32 and I64:
Notes
But my tests are still failing because of the problem I have mentioned before in this topic
https://forum.fuel.network/t/cannot-use-from-uint-in-the-i128-from-sway-libs/1255