-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Read only methods #1052
Closed
Closed
Read only methods #1052
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
ea39390
Update VM to last changes
shargon 86aff3e
Remove hashes
shargon fa580d2
ReadOnly
shargon 1e0496a
Rename to ReadOnly
shargon 6759e5a
Fix unit tests
shargon be5d7a1
Refactor readOnly check
shargon aa3dce2
Reduce changes
shargon 6c6ab1a
Update VM to last changes
shargon 3bc6e80
ReadOnly
shargon cab7f01
Rename to ReadOnly
shargon fe0986a
Fix unit tests
shargon dd65378
Refactor readOnly check
shargon 288c9ff
Reduce changes
shargon a7e4485
Merge
shargon 6107a8d
Merge remote-tracking branch 'origin/read-only' into read-only
shargon 049b485
Merge pull request #15 from shargon/read-only
shargon a2e48d2
Remove change file
shargon 1095106
Merge branch 'master' into read-only-methods
lock9 d010c54
Merge branch 'master' into read-only-methods
shargon 38e2a10
Fix contract manifest
shargon 1ea1538
Add null check
shargon e8ab57d
Prevent null manifest contracts
shargon 6e54e04
Merge branch 'master' into read-only-methods
shargon c2722ce
Refactor ReadOnly
shargon c8cd016
ReadOnly if is specified
shargon fca0844
UT
shargon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
namespace Neo.SmartContract | ||
namespace Neo.SmartContract | ||
{ | ||
public class ExecutionContextState | ||
{ | ||
/// <summary> | ||
/// Script hash | ||
/// </summary> | ||
public UInt160 ScriptHash { get; set; } | ||
|
||
/// <summary> | ||
/// Is read only | ||
/// </summary> | ||
public bool ReadOnly { get; set; } = false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 don't think this is a good idea @shargon... what is
RequireWriteAccess
? To Storage?Could we remove this?
I thought that, if current ExecutionContextState is running on ReadOnly, then methods that require write access could simply fail (example: Storage.GetCurrentContext`).
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.
We can rename the var, but not remove it, because is used for ban the syscall when is in readOnly mode