Better error message with missing sudo (no parse error)#279
Merged
Conversation
maurolacy
approved these changes
Apr 21, 2021
| /// Wraps the exported functions from a contract and provides the normalized format | ||
| /// Place T4 and E4 at the end, as we just want default placeholders for most contracts that don't have sudo | ||
| pub struct ContractWrapper<T1, T2, T3, E1, E2, E3, C = Empty, T4 = String, E4 = String> | ||
| pub struct ContractWrapper<T1, T2, T3, E1, E2, E3, C = Empty, T4 = Any, E4 = Any> |
Member
There was a problem hiding this comment.
Why don't you use T4 = Empty and E4 = String?
String is a great default error type. The only restrictions those types have is ToString. So requiring Display is more than necessary.
Contributor
Author
There was a problem hiding this comment.
Hmmm.. that might work and be a simpler solution.
Will try
Contributor
Author
There was a problem hiding this comment.
Just approved your PR to that end
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.
Closes #278
I introduced
Anyrather thanString.Anyis likeEmpty(parses any struct), but it has a neededDisplayimplementation.When we are happy with this, and merged, we can port over the
Displayimplementation tocosmwasm_std::Emptyfor the future.