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

Add in contract assertions to prng functions #1295

Merged
merged 1 commit into from
Jul 12, 2024
Merged

Add in contract assertions to prng functions #1295

merged 1 commit into from
Jul 12, 2024

Conversation

leighmcculloch
Copy link
Member

What

Add in contract assertions to prng functions.

Why

It's really easy to think you can use the prng functions inside your tests to help setup random test data, without reaslising that these functions are restricted to use within a contract.

Close #1165

Copy link
Member Author

@leighmcculloch leighmcculloch left a comment

Choose a reason for hiding this comment

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

There are more places we can drop this assertion, such as the deploy functions. I'm marking the original issue #1165 as closed after this change because once this has merged we have addressed the two biggest occurrences where folks get confused which is the storage and prng APIs.

soroban-sdk/src/storage.rs Show resolved Hide resolved
@leighmcculloch leighmcculloch added this pull request to the merge queue Jul 12, 2024
Merged via the queue into main with commit 40824b9 Jul 12, 2024
16 checks passed
@leighmcculloch leighmcculloch deleted the i1165 branch July 12, 2024 21:14
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.

Use Host has_frame logic in SDK to panic fns called when in or not in a contract as required
2 participants