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

Reject non-storable transaction/script arguments #305

Merged
merged 1 commit into from
Aug 10, 2020

Conversation

benjaminkvm
Copy link
Contributor

Closes #187

Description

Reject non-storable transaction/script arguments, with relevant test cases.

@turbolent turbolent added Language Breaking Change Breaks Cadence contracts deployed on Mainnet Improvement labels Aug 10, 2020
Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

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

Nice!

for _, param := range epSignature.Parameters {
if _, isVoid := param.TypeAnnotation.Type.(*sema.VoidType); !isVoid {
if !param.TypeAnnotation.Type.IsStorable(storableResults) {
return nil, &ScriptParameterTypeNotStorableError{
Copy link
Member

Choose a reason for hiding this comment

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

Never realized, but ExecuteTransaction is using newError, and ExecuteScript here is not.
@psiemens do you know why the errors are wrapped in one and not the other?

@turbolent turbolent merged commit 5185205 into master Aug 10, 2020
@turbolent turbolent deleted the benjaminkvm/187-reject-non-storable-params branch August 10, 2020 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Language Breaking Change Breaks Cadence contracts deployed on Mainnet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reject script functions and transactions with non-storable parameter types
2 participants