- 
                Notifications
    
You must be signed in to change notification settings  - Fork 240
 
feat: Improve error message when trying to redeclare contract using sncast declare #3253 #3578
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
feat: Improve error message when trying to redeclare contract using sncast declare #3253 #3578
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.
Some of cast tests are failing, probably asserts for outputs need to be updated.
Also run cargo fmt.
| 
           @cptartur I'll check those out I ran cargo fmt already that was an oversight  | 
    
Co-authored-by: Artur Michałek <[email protected]>
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.
Looks good, let's wait for the tests to pass
| 
           Hi! This pull request hasn't had any activity for a while, so I am  | 
    
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.
Thanks for contributing, this will however not address the problem.
The added error handling duplicates the one we already have but the error still persists.
The problem is not due to missing error handling but from the fact that error comes from estimateFee endpoint and not declare.
| Err(Provider(error)) => Err(StarknetCommandError::ProviderError(error.into())), | ||
| Err(Provider(ProviderError::StarknetError(StarknetError::ClassAlreadyDeclared))) => Err( | ||
| StarknetCommandError::ClassAlreadyDeclared(class_hash.into_()), | ||
| ), | 
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.
The error here is duplicating an handling of AlreadyDeclared we have couple of lines above
          
 I'll be investigating the problem with estimateFee  | 
    
Closes #3253
Introduced changes
ClassAlreadyDeclared(Felt252)Checklist
CHANGELOG.md