Various fallback improvements#1611
Open
seanyoung wants to merge 2 commits intohyperledger-solang:mainfrom
Open
Various fallback improvements#1611seanyoung wants to merge 2 commits intohyperledger-solang:mainfrom
seanyoung wants to merge 2 commits intohyperledger-solang:mainfrom
Conversation
07bc473 to
e2acdaa
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1611 +/- ##
==========================================
- Coverage 88.44% 88.42% -0.03%
==========================================
Files 150 150
Lines 68322 68503 +181
==========================================
+ Hits 60429 60572 +143
- Misses 7893 7931 +38 ☔ View full report in Codecov by Sentry. |
LucasSte
approved these changes
Dec 18, 2023
|
|
||
| The fallback function can defined in two ways. First, it can have no parameters or return | ||
| values. Alternatively, it must have a ``bytes`` parameter and ``bytes`` return value. In this | ||
| case, the parameter contains the undecoded input (also known as calldata or instruction data), |
Contributor
Author
There was a problem hiding this comment.
The wording is not great. What I mean is the raw bytes data before going through borsh/scale/eth decoding.
Allow the following:
contract A {
// Take raw calldata as argument and return return data
fallback(bytes calldata input) external payable (bytes memory) {}
}
Allow a function to be called fallback:
contract A {
// Will give a warning that's not a fallback function,
// just a regular functon
function fallback() public {}
}
Signed-off-by: Sean Young <sean@mess.org>
xermicus
approved these changes
Jan 8, 2024
Contributor
|
@seanyoung I'll be preparing a release in the upcoming days, I think this would be nice to have in :) |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Allow the following:
Allow a function to be called fallback:
This should make proxy contracts much easier to implement.
Also fixes all fallback/receive related failures in the evm tests.