-
Notifications
You must be signed in to change notification settings - Fork 24
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
[Feature]: Investigate How to Address export-abi
Warnings
#439
Comments
export-abi
Feature Causes Issuesexport-abi
Warnings
Declaring the
error[E0220]: associated type `Error` not found for `Self`
--> contracts/src/access/ownable_two_step.rs:158:27
|
158 | ) -> Result<(), Self::Error> {
| ^^^^^ associated type `Error` not found Mitigation: this is a very weird error that is solved using a fully-qualified path for
error[E0277]: the trait bound `ownable::Error: SolError` is not satisfied
--> contracts/src/access/ownable_two_step.rs:48:13
|
48 | Ownable(OwnableError),
| ^^^^^^^^^^^^ the trait `SolError` is not implemented for `ownable::Error`
|
= help: the following other types implement trait `SolError`:
AccessControlBadConfirmation
AccessControlUnauthorizedAccount
CheckpointUnorderedInsertion
ECDSAInvalidSignature
ECDSAInvalidSignatureS
ERC1155InsufficientBalance
ERC1155InvalidApprover
ERC1155InvalidArrayLength
and 39 others What's worth noting is that this error only appears for the wrapped errors from other contracts. In other words, in each place where we "inherit" errors from another contract to be able to wrap and return them,
@qalisander might this be related to a similar issue you raised with the Stylus team OffchainLabs/stylus-sdk-rs#135? EDIT: I created a new Stylus project, set our lib as a dependency and created an
It seems we will need to handle this issue somehow, as users of our library won't be able to use the use crate::utils::cryptography::ecdsa;
pub enum Error {
// ...
ECDSA(ecdsa::Error),
} We do: use crate::utils::cryptography::ecdsa::{
ECDSAInvalidSignature, ECDSAInvalidSignatureS,
};
pub enum Error {
// ...
// add errors directly
InvalidSignature(ECDSAInvalidSignature),
InvalidSignatureS(ECDSAInvalidSignatureS),
} |
export-abi
Warningsexport-abi
Warnings
To recap:
Until these two are resolved, this issue is considered blocked |
What is the feature you would like to see?
By declaring
export-abi
feature, we can remove those pesky warnings.The problem is that
cargo hack
workflow fails when it tried to activate this feature withthe trait `SolError` is not implemented for `[OUR_ERROR_NAME]`
.We should investigate why this is, so that we can declare the feature in Cargo.toml.
Alternatively, we can simply skip this feature, just as we do for
std
.Original comment: #437 (comment)
Related #436
Contribution Guidelines
The text was updated successfully, but these errors were encountered: