Skip to content

Commit

Permalink
chore: remove function prefix from error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
notJoon committed Dec 23, 2024
1 parent cd53a04 commit 7d0de57
Show file tree
Hide file tree
Showing 12 changed files with 104 additions and 106 deletions.
18 changes: 9 additions & 9 deletions gov/governance/_GET_proposal.gno
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ func GetProposerByProposalId(proposalId uint64) string {
if !exist {
panic(addDetailToError(
errDataNotFound,
ufmt.Sprintf("_GET_proposal.gno__GetProposerByProposalId() || proposalId(%d) not found", proposalId),
ufmt.Sprintf("proposalId(%d) not found", proposalId),
))
}

Expand All @@ -21,7 +21,7 @@ func GetProposalTypeByProposalId(proposalId uint64) string {
if !exist {
panic(addDetailToError(
errDataNotFound,
ufmt.Sprintf("_GET_proposal.gno__GetProposalTypeByProposalId() || proposalId(%d) not found", proposalId),
ufmt.Sprintf("proposalId(%d) not found", proposalId),
))
}

Expand All @@ -33,7 +33,7 @@ func GetYeaByProposalId(proposalId uint64) string {
if !exist {
panic(addDetailToError(
errDataNotFound,
ufmt.Sprintf("_GET_proposal.gno__GetYeaByProposalId() || proposalId(%d) not found", proposalId),
ufmt.Sprintf("proposalId(%d) not found", proposalId),
))
}

Expand All @@ -45,7 +45,7 @@ func GetNayByProposalId(proposalId uint64) string {
if !exist {
panic(addDetailToError(
errDataNotFound,
ufmt.Sprintf("_GET_proposal.gno__GetNayByProposalId() || proposalId(%d) not found", proposalId),
ufmt.Sprintf("proposalId(%d) not found", proposalId),
))
}

Expand All @@ -57,7 +57,7 @@ func GetConfigVersionByProposalId(proposalId uint64) uint64 {
if !exist {
panic(addDetailToError(
errDataNotFound,
ufmt.Sprintf("_GET_proposal.gno__GetConfigVersionByProposalId() || proposalId(%d) not found", proposalId),
ufmt.Sprintf("proposalId(%d) not found", proposalId),
))
}

Expand All @@ -69,7 +69,7 @@ func GetQuorumAmountByProposalId(proposalId uint64) uint64 {
if !exist {
panic(addDetailToError(
errDataNotFound,
ufmt.Sprintf("_GET_proposal.gno__GetQuorumAmountByProposalId() || proposalId(%d) not found", proposalId),
ufmt.Sprintf("proposalId(%d) not found", proposalId),
))
}

Expand All @@ -81,7 +81,7 @@ func GetTitleByProposalId(proposalId uint64) string {
if !exist {
panic(addDetailToError(
errDataNotFound,
ufmt.Sprintf("_GET_proposal.gno__GetTitleByProposalId() || proposalId(%d) not found", proposalId),
ufmt.Sprintf("proposalId(%d) not found", proposalId),
))
}

Expand All @@ -93,7 +93,7 @@ func GetDescriptionByProposalId(proposalId uint64) string {
if !exist {
panic(addDetailToError(
errDataNotFound,
ufmt.Sprintf("_GET_proposal.gno__GetDescriptionByProposalId() || proposalId(%d) not found", proposalId),
ufmt.Sprintf("proposalId(%d) not found", proposalId),
))
}

Expand All @@ -105,7 +105,7 @@ func GetExecutionStateByProposalId(proposalId uint64) ExecutionState {
if !exist {
panic(addDetailToError(
errDataNotFound,
ufmt.Sprintf("_GET_proposal.gno__GetExecutionStateByProposalId() || proposalId(%d) not found", proposalId),
ufmt.Sprintf("proposalId(%d) not found", proposalId),
))
}

Expand Down
22 changes: 11 additions & 11 deletions gov/governance/_GET_vote.gno
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func GetVoteByVoteKey(voteKey string) bool {
if !exist {
panic(addDetailToError(
errDataNotFound,
ufmt.Sprintf("_GET_vote.gno__GetVoteByVoteKey() || voteKey(%s) not found", voteKey),
ufmt.Sprintf("voteKey(%s) not found", voteKey),
))
}

Expand All @@ -26,7 +26,7 @@ func GetVoteYesByVoteKey(voteKey string) bool {
if !exist {
panic(addDetailToError(
errDataNotFound,
ufmt.Sprintf("_GET_vote.gno__GetVoteYesByVoteKey() || voteKey(%s) not found", voteKey),
ufmt.Sprintf("voteKey(%s) not found", voteKey),
))
}

Expand All @@ -36,7 +36,7 @@ func GetVoteYesByVoteKey(voteKey string) bool {
if !exist {
panic(addDetailToError(
errDataNotFound,
ufmt.Sprintf("_GET_vote.gno__GetVoteYesByVoteKey() || voteKey(%s) not found", voteKey),
ufmt.Sprintf("voteKey(%s) not found", voteKey),
))
}

Expand All @@ -48,7 +48,7 @@ func GetVoteWeightByVoteKey(voteKey string) uint64 {
if !exist {
panic(addDetailToError(
errDataNotFound,
ufmt.Sprintf("_GET_vote.gno__GetVoteWeightByVoteKey() || voteKey(%s) not found", voteKey),
ufmt.Sprintf("voteKey(%s) not found", voteKey),
))
}

Expand All @@ -58,7 +58,7 @@ func GetVoteWeightByVoteKey(voteKey string) uint64 {
if !exist {
panic(addDetailToError(
errDataNotFound,
ufmt.Sprintf("_GET_vote.gno__GetVoteWeightByVoteKey() || voteKey(%s) not found", voteKey),
ufmt.Sprintf("voteKey(%s) not found", voteKey),
))
}

Expand All @@ -70,7 +70,7 @@ func GetVotedHeightByVoteKey(voteKey string) uint64 {
if !exist {
panic(addDetailToError(
errDataNotFound,
ufmt.Sprintf("_GET_vote.gno__GetVotedHeightByVoteKey() || voteKey(%s) not found", voteKey),
ufmt.Sprintf("voteKey(%s) not found", voteKey),
))
}

Expand All @@ -80,7 +80,7 @@ func GetVotedHeightByVoteKey(voteKey string) uint64 {
if !exist {
panic(addDetailToError(
errDataNotFound,
ufmt.Sprintf("_GET_vote.gno__GetVotedHeightByVoteKey() || voteKey(%s) not found", voteKey),
ufmt.Sprintf("voteKey(%s) not found", voteKey),
))
}

Expand All @@ -92,7 +92,7 @@ func GetVotedAtByVoteKey(voteKey string) uint64 {
if !exist {
panic(addDetailToError(
errDataNotFound,
ufmt.Sprintf("_GET_vote.gno__GetVotedAtByVoteKey() || voteKey(%s) not found", voteKey),
ufmt.Sprintf("voteKey(%s) not found", voteKey),
))
}

Expand All @@ -102,7 +102,7 @@ func GetVotedAtByVoteKey(voteKey string) uint64 {
if !exist {
panic(addDetailToError(
errDataNotFound,
ufmt.Sprintf("_GET_vote.gno__GetVotedAtByVoteKey() || voteKey(%s) not found", voteKey),
ufmt.Sprintf("voteKey(%s) not found", voteKey),
))
}

Expand All @@ -114,15 +114,15 @@ func divideVoteKeyToProposalIdAndUser(voteKey string) (uint64, std.Address) {
if err != nil {
panic(addDetailToError(
errInvalidInput,
ufmt.Sprintf("_GET_vote.gno__divideVoteKeyToProposalIdAndUser() || voteKey(%s) is invalid", voteKey),
ufmt.Sprintf("voteKey(%s) is invalid", voteKey),
))
}

proposalId, err := strconv.ParseUint(parts[0], 10, 64)
if err != nil {
panic(addDetailToError(
errInvalidInput,
ufmt.Sprintf("_GET_vote.gno__divideVoteKeyToProposalIdAndUser() || proposalId(%s) is invalid", parts[0]),
ufmt.Sprintf("proposalId(%s) is invalid", parts[0]),
))
}

Expand Down
2 changes: 1 addition & 1 deletion gov/governance/config.gno
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func GetConfigVersion(version uint64) Config {
if !exist {
panic(addDetailToError(
errDataNotFound,
ufmt.Sprintf("config.gno__GetConfigVersion() || config version(%d) does not exist", version),
ufmt.Sprintf("config version(%d) does not exist", version),
))
}

Expand Down
Loading

0 comments on commit 7d0de57

Please sign in to comment.