-
Notifications
You must be signed in to change notification settings - Fork 391
fix: parse error codes from createNewTask ethereum contract function #1503
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
Conversation
MarcosNicolau
left a comment
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 need to test it.
batcher/aligned-batcher/src/lib.rs
Outdated
|
|
||
| // TODO: Here we have to match and handle the errors and flush the queue if necessary | ||
| // NoProofSubmitters | ||
| // NoFeePerProof | ||
| // InsufficientFeeForAggregator | ||
| // SubmissionInsufficientBalance | ||
| // BatchAlreadySubmitted | ||
| // InsufficientFunds | ||
| // OnlyBatcherAllowed | ||
| // Generic |
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 would create a separate issue here
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.
Removed! This will be handle in a future PR
| // TODO: Here we are missing the modifiers: onlyWhenNotPaused | ||
| // TODO: Parse parameters from error responses |
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.
Ditto
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.
Created #1508!
MarcosNicolau
left a comment
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.
Works as expected.
|
tested on local devnet and it worked as expected. |
| &byte_string[..10] // Extract the error code only | ||
| } else { | ||
| "" // Not gonna match | ||
| }; |
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.
Try let str_code = e.to_string().get(..10).unwrap_or("");
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.
It's working now. Maybe in a future refactor
avilagaston9
left a comment
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.
Works in my machine!
…1503) Co-authored-by: Julian Ventura <[email protected]> Co-authored-by: avilagaston9 <[email protected]> Co-authored-by: Urix <[email protected]>
Parse error codes from
createNewTaskDescription
This PR adds parsing errors on batcher from the
createNewTaskfunction on ethereumBatcherPaymentServicecontractAnother PR will be made to add handling of modifiers
onlyWhenNotPausedwhenNotPaused, as well as improve the parsing of some revert errors by parsing the returned args.How to test
You will have to repeat this for each error:
createNewTaskfromBatcherPaymentServiceorAlignedServiceManagerto revert with an error handled in this PRmake anvil_deploy_aligned_contractsType of change
Please delete options that are not relevant.
Checklist
testnet, everything else tostaging