You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a part of model based testing audit of the authz module, code inspection has been done in order to find issues or possible improvements in code.
Version:
master (commit: 8800d2e)
auditing is performed for tag: v0.46.0-alpha4 (commit: 354faa8)
After analysis of error handling, I saw that there were no module errors registered and used in error.go.
With registration of module error we would define globally unique SDK error with registered codespace and code, also module errors can be further wrapped to provide more details for failed execution.
Also: sdk errors package allows ABCI Info do be extracted for registered errors – the ones that are not registered, are declared as from undefined codespace, as as internal error…
Here are several recommendations for more errors that could be registered and lines of code where they could be used. More thorough analysis should be done, however.
ErrNoAuthorizationFound ErrNoAuthzorizationFound = sdkerrors.Register(ModuleName, 2, "authorization not found")
Would be used in
returnsdkerrors.ErrNotFound.Wrap("authorization not found")
and in line and several more places, in the following way: return sdkerrors.Wrapf(authz.ErrNoAuthzorizationFound, "failed to update grant with key %s", string(skey))
As a part of model based testing audit of the authz module, code inspection has been done in order to find issues or possible improvements in code.
Version:
master (commit: 8800d2e)
auditing is performed for tag: v0.46.0-alpha4 (commit: 354faa8)
After analysis of error handling, I saw that there were no module errors registered and used in error.go.
With registration of module error we would define globally unique SDK error with registered codespace and code, also module errors can be further wrapped to provide more details for failed execution.
Also: sdk errors package allows ABCI Info do be extracted for registered errors – the ones that are not registered, are declared as from undefined codespace, as as internal error…
Here are several recommendations for more errors that could be registered and lines of code where they could be used. More thorough analysis should be done, however.
ErrNoAuthzorizationFound = sdkerrors.Register(ModuleName, 2, "authorization not found")
Would be used in
cosmos-sdk/x/authz/keeper/keeper.go
Line 63 in 6073395
and in line and several more places, in the following way:
return sdkerrors.Wrapf(authz.ErrNoAuthzorizationFound, "failed to update grant with key %s", string(skey))
The text was updated successfully, but these errors were encountered: