-
Notifications
You must be signed in to change notification settings - Fork 88
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 a separate error for nonexistent contract input #868
Conversation
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.
Happy to approve. We've lifted the code freeze I believe but want to check first.
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.
LGTM 👍
@@ -905,7 +905,7 @@ where | |||
false | |||
} | |||
}) { | |||
return Err(InterpreterError::Panic(PanicReason::ContractNotInInputs)); | |||
return Err(InterpreterError::Panic(PanicReason::InputContractDoesNotExist)); |
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 know that is it not possible to call contract from non Script
transaction, but it looks like we need to move this check to the begin of the run
function and return an error if contract doesn't exist regardless of the transaction type.
…ut-contract # Conflicts: # CHANGELOG.md # fuel-asm/src/panic_reason.rs
Added an explicit `match` statement to not forget in the future to add handling of a new variants of the transactions.
When debugging a contract error with @matt-user, we noticed that trying to transfer to zero address produced a weird error message. Instead of saying "contract was in inputs, but doesn't exist", the message was just "contract not in inputs". This PR creates a separate error for that. It's technically a breaking change, since we change error to be another error.
Checklist
Before requesting review