Closed joshlf closed 5 years ago
@joshlf I've submitted a PR regarding this issue #17, the only problem I have with it is that the EcdsaSignature
trait already implemented an is_valid
method, I looked at the body of the function and ended up renaming it to has_content
, I don't know if you are ok with that naming convention and I'm open to suggestions regarding what to do about it.
@yonson2 maybe you can use the fully qualified syntax for choosing which implementation to call so you don't have to rename anything:
@yonson2 Ah good point about the name conflict. How does is_valid_format
sound?
@categulario thanks for that, I'll have it in mind for future occasions for sure but I think in this particular case its better for each trait to have a different method to prevent ambiguity. As for which name I like @joshlf's suggestion better than the one I had initially set so I've submitted that change.
Signature::verify
takes a public key and a signature and returns a boolean. @zarvox has pointed out that it's not 100% obvious to somebody coming across code likeif sig.verify(&pub) { ... }
which return value means that the signature is valid and which means that it's invalid.In order to make it more obvious, we should rename this method to
is_valid
.