-
Notifications
You must be signed in to change notification settings - Fork 314
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
Storage status #52
Merged
Merged
Storage status #52
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ extern "C" { | |
enum | ||
{ | ||
/** The EVMC ABI version number of the interface declared in this file. */ | ||
EVMC_ABI_VERSION = 4 | ||
EVMC_ABI_VERSION = 5 | ||
}; | ||
|
||
/** | ||
|
@@ -451,21 +451,35 @@ typedef void (*evmc_get_storage_fn)(struct evmc_uint256be* result, | |
const struct evmc_address* address, | ||
const struct evmc_uint256be* key); | ||
|
||
|
||
/** | ||
* The effect of an attempt to modify a contract storage item. | ||
*/ | ||
enum evmc_storage_status | ||
{ | ||
EVMC_STORAGE_UNCHANGED = 0, /**< The storage item value unchanged. */ | ||
EVMC_STORAGE_MODIFIED = 1, /**< The storage item value modified. */ | ||
EVMC_STORAGE_ADDED = 2, /**< The storage item added. */ | ||
EVMC_STORAGE_DELETED = 3, /**< The storage item deleted. */ | ||
}; | ||
|
||
|
||
/** | ||
* Set storage callback function. | ||
* | ||
* This callback function is used by an EVM to update the given contract | ||
* storage entry. | ||
* @param context The pointer to the Host execution context. | ||
* @see ::evmc_context. | ||
* @param address The address of the contract. | ||
* @param key The index of the storage entry. | ||
* @param value The value to be stored. | ||
* This callback function is used by an EVM to update the given contract | ||
* storage entry. | ||
* @param context The pointer to the Host execution context. | ||
* @see ::evmc_context. | ||
* @param address The address of the contract. | ||
* @param key The index of the storage entry. | ||
* @param value The value to be stored. | ||
* @return The effect on the storage item. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should have |
||
*/ | ||
typedef void (*evmc_set_storage_fn)(struct evmc_context* context, | ||
const struct evmc_address* address, | ||
const struct evmc_uint256be* key, | ||
const struct evmc_uint256be* value); | ||
typedef enum evmc_storage_status (*evmc_set_storage_fn)(struct evmc_context* context, | ||
const struct evmc_address* address, | ||
const struct evmc_uint256be* key, | ||
const struct evmc_uint256be* value); | ||
|
||
/** | ||
* Get balance callback function. | ||
|
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.
Does this needs to expose special cases about 0?
Adding explanation above may be good. We have the following cases, please map them to codes:
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 the special case for
zero -> zero
is needed, this can be reported together withX -> X
. It will not be needed in EIP-1087 either.I will add more documentation. Thanks for suggestion.
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 guess the caller can deduce that by value == 0 && unchanged.