-
Notifications
You must be signed in to change notification settings - Fork 374
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(p/int256): int256 #1848
feat(p/int256): int256 #1848
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1848 +/- ##
==========================================
+ Coverage 44.86% 47.54% +2.67%
==========================================
Files 459 388 -71
Lines 67625 61279 -6346
==========================================
- Hits 30339 29133 -1206
+ Misses 34745 29707 -5038
+ Partials 2541 2439 -102 ☔ View full report in Codecov by Sentry. |
CI fails because this pr doesn't includes uint256 |
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.
Looks good 💯
I've left comments relating to adding more unit tests, and refactoring the README.
Otherwise, I think we should be good to go 🚀
Please merge master
into this branch and make sure the tests are passing locally 🙏
This pr implements
int256
package to handle huge numbers in gno.To support this, it uses
uint256
package in its own structorigin(go) implementation: https://github.com/mempooler/int256
gnoswap(gno) implementation: https://github.com/gnoswap-labs/gnoswap/package/big/int256
gno test metrics
gno test -v=true -print-runtime-metrics=true ./examples/gno.land/p/demo/int256 === RUN TestAbs --- PASS: TestAbs (0.00s) --- runtime: cycle=30.5k imports=3 allocs=797.6k(0.16%) === RUN TestAbsGt --- PASS: TestAbsGt (0.00s) --- runtime: cycle=108.7k imports=3 allocs=2.5M(0.50%) === RUN TestAdd --- PASS: TestAdd (0.00s) --- runtime: cycle=155.2k imports=3 allocs=4.0M(0.79%) === RUN TestSub --- PASS: TestSub (0.00s) --- runtime: cycle=259.1k imports=3 allocs=6.3M(1.26%) === RUN TestMul --- PASS: TestMul (0.00s) --- runtime: cycle=278.4k imports=3 allocs=7.0M(1.39%) === RUN TestDiv --- PASS: TestDiv (0.00s) --- runtime: cycle=307.6k imports=3 allocs=8.1M(1.62%) === RUN TestRem --- PASS: TestRem (0.00s) --- runtime: cycle=342.8k imports=3 allocs=9.5M(1.90%) === RUN TestEq --- PASS: TestEq (0.00s) --- runtime: cycle=422.1k imports=3 allocs=11.3M(2.25%) === RUN TestCmp --- PASS: TestCmp (0.00s) --- runtime: cycle=466.7k imports=3 allocs=12.4M(2.47%) === RUN TestIsZero --- PASS: TestIsZero (0.00s) --- runtime: cycle=471.3k imports=3 allocs=12.6M(2.51%) === RUN TestIsNeg --- PASS: TestIsNeg (0.00s) --- runtime: cycle=476.6k imports=3 allocs=12.8M(2.56%) === RUN TestLt --- PASS: TestLt (0.00s) --- runtime: cycle=522.7k imports=3 allocs=14.0M(2.79%) === RUN TestClone --- PASS: TestClone (0.00s) --- runtime: cycle=565.1k imports=3 allocs=14.9M(2.98%) === RUN TestSetInt64 --- PASS: TestSetInt64 (0.00s) --- runtime: cycle=567.2k imports=3 allocs=15.0M(3.01%) === RUN TestSetUint64 --- PASS: TestSetUint64 (0.00s) --- runtime: cycle=568.3k imports=3 allocs=15.1M(3.02%) === RUN TestUint64 --- PASS: TestUint64 (0.00s) --- runtime: cycle=605.7k imports=3 allocs=16.0M(3.21%) === RUN TestInt64 --- PASS: TestInt64 (0.00s) --- runtime: cycle=624.5k imports=3 allocs=16.5M(3.31%) === RUN TestNeg --- PASS: TestNeg (0.00s) --- runtime: cycle=636.2k imports=3 allocs=16.9M(3.38%) === RUN TestSign --- PASS: TestSign (0.00s) --- runtime: cycle=639.4k imports=3 allocs=17.1M(3.41%) ok ./examples/gno.land/p/demo/int256 0.59s
Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description