-
Notifications
You must be signed in to change notification settings - Fork 17
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
revertible random #15
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Very nice. Added some suggestion for minor word-smithing.
<Callout type="info"> | ||
`unsafeRandom()` function currently behaves the same way as `revertibleRandom()`. | ||
It is deprecated and will be removed in an upcoming release of Cadence. | ||
</Callout> |
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.
do we need this here? We already have a very similar callout for unsafeRandom
:
cadence-lang.org/versioned_docs/version-current_0.42/0.42/language/built-in-functions.mdx
Lines 39 to 42 in 107c54b
<Callout type="info"> | |
`unsafeRandom()` function currently behaves the same way as `revertibleRandom()`. | |
It is deprecated and will be removed in an upcoming release of Cadence. | |
</Callout> |
I feel this is largely duplicated and best fits within the context of
unsafeRandom
<Callout type="info"> | |
`unsafeRandom()` function currently behaves the same way as `revertibleRandom()`. | |
It is deprecated and will be removed in an upcoming release of Cadence. | |
</Callout> |
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.
I actually duplicated it purposely. I think there is an advantage to clarify why this function is here and what's its relationship with the existing unsafeRandom
. Developers used to unsafeRandom
may be asking how revertible
is different and this provides them with a quick answer.
I added the section for unsafeRandom
afterwards as per your suggestion to keep a section for deprecated functions. I think the duplication is minor and it is temporary anyway.
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.
okay you guys win 😄 onflow/docs#439 (comment)
versioned_docs/version-current_0.42/0.42/language/built-in-functions.mdx
Show resolved
Hide resolved
versioned_docs/version-current_0.42/0.42/language/built-in-functions.mdx
Show resolved
Hide resolved
versioned_docs/version-current_0.42/0.42/language/built-in-functions.mdx
Show resolved
Hide resolved
`unsafeRandom` has the same interface and implementation as `revertibleRandom()` although | ||
it is called unsafe. |
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.
`unsafeRandom` has the same interface and implementation as `revertibleRandom()` although | |
it is called unsafe. | |
Its implementation has been upgraded to the same implementation as `revertibleRandom()` for improved security. However, the name was retained for downwards compatibility despite it technically being no longer unsafe (see `revertibleRandom()` for details). |
We'll do a final sync by copying all content from the |
cc @gregsantos |
@AlexHentschel thanks for the review. Update: here is the PR with your suggestions |
revertibleRandom
unsafeRandom
Changes are copied from onflow/docs#423