namada icon indicating copy to clipboard operation
namada copied to clipboard

Incorrect error code mapping in `check_proposal_tx` description

Open grarco opened this issue 9 months ago • 0 comments

Reported by Informal Systems.

Description

The check_proposal_tx function contains error codes that are not correctly mapped to their corresponding IDs in the description comment. This discrepancy can lead to confusion and potential misinterpretation of error conditions. For example, the error code WasmRuntimeError is listed as 3 in the function's description comment, but it is defined as 1 in the ResultCode enum, not 3 as indicated in the comment. Additionally, some error codes are not listed at all in the function's description comment, leading to incomplete documentation.

Problem Scenarios

Developers relying on the error code documentation within the description comment of the check_proposal_tx function may encounter confusion considering discrepancies between the documented error codes and their actual definitions.

Recommendation

To ensure consistency and accuracy, it is recommended to align the error code documentation in the description comment of the check_proposal_tx function (/process_proposal.rs#L174-L184) with the definitions in the ResultCode enum (/mod.rs#L55-L86).

grarco avatar May 07 '24 17:05 grarco