-
Notifications
You must be signed in to change notification settings - Fork 52
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
fix: add ErrInvalidApproval
errorcode for sp's approval invalid
#175
Conversation
ErrInvalidApproval
errorcode for sp's approval invalid
if err != nil { | ||
return err | ||
} | ||
approvalAccAddress := sdk.MustAccAddressFromHex(sp.ApprovalAddress) | ||
|
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.
Don't need to check the "err" value returned any more?
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.
Here the AccAddressFromHexUnsafe
function is replaced with MustAccAddressFromHex
.
It is agreed on the chain that the address stored on the chain must be correct, and the MustAccAddressFromHex
interface is judged. If there is an error in parsing the address, it will panic
.
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.
LGTM
Description
If the user creates a bucket on sp1 and then creates an object on sp2, the error message will be more accurate. Use the ErrInvalidApproval error code to indicate an invalid approval from sp.
Changes
Notable changes: