-
Notifications
You must be signed in to change notification settings - Fork 137
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
Update interface of revertibleRandom
#2943
Update interface of revertibleRandom
#2943
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.
Changes look good so far!
Given we are introducing a new type, we should probably add some more high-level Cadence tests (you've already added low-level Go tests, which is great!), for usages of FixedSizeUnsignedIntegerType
in various places, such as:
- As a type annotation for variable
- Constructing a value (valid/invalid)
main
function arguments/return type (for import/export)- Storing to the storage and reading from it.
- Casting, sub-type assignment, etc.
Given this is a breaking change, can you please rebase this to the |
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.
Great work!
Looks good, only thing left is the removal of the unnecessary endianness conversion
b6bec33
to
65d7cdf
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## feature/stable-cadence #2943 +/- ##
==========================================================
+ Coverage 80.11% 80.14% +0.02%
==========================================================
Files 348 348
Lines 81870 81999 +129
==========================================================
+ Hits 65590 65716 +126
- Misses 13958 13961 +3
Partials 2322 2322
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@turbolent, @SupunS, @darkdrag00nv2 do you think we should add the optional parameter Another option is to leave this PR as it is, open a new PR where the optional parameter is added, and I'll continue to commit on that new PR. |
@tarakby either way works. The PR has the |
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.
Nice, great work!
There's a data race in the tests: https://github.com/onflow/cadence/actions/runs/7121193421/job/19389931602?pr=2943, looking into it |
@turbolent, Nice! I didn't notice the parameter is already there. I'll create an issue for myself to work on the remaining part. |
I believe this should labelled with |
Not sure why this got closed. This should now be opened against the master (#2971) |
Same, it seems as though it was closed automatically when |
Work towards #2712
Description
FixedSizeUnsignedInteger
revertibleRandom
function tofun revertibleRandom<T: FixedSizeUnsignedInteger>([modulo: T]): T
Note that updating the interface is a breaking change as the existing usage of the function such as below fails.
Noteworthy Points
revertibleRandom
interface (FLIP 120) #2712 (comment)InclusiveRange
constructor function: Fix incorrect type inference for InclusiveRange #2886Basically:
master
branchFiles changed
in the Github PR explorer