Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

pi: Make status transition error human readable. #1543

Merged
merged 4 commits into from
Oct 13, 2021

Conversation

amass01
Copy link
Member

@amass01 amass01 commented Oct 13, 2021

This adds human readable billing statuses to the pi plugin and uses them
in the invalid billing status transition error.


Closes #1541.

This adds human readable billing statuses to the pi plugin and uses them in
the invalid billing status transition error.
@amass01
Copy link
Member Author

amass01 commented Oct 13, 2021

$ pictl proposalsetbillingstatus 309812a1c6617320 active
400 pi plugin error code 15, billing status change is not allowed: invalid billing status transition, active to active is not allowed

lukebp
lukebp previously approved these changes Oct 13, 2021
Copy link
Member

@lukebp lukebp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@lukebp lukebp dismissed their stale review October 13, 2021 13:25

Add unit tests.

Copy link
Member

@lukebp lukebp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a unit test veryifying that all statuses have a human readable entry. Format it like this please.

	// ErrorCodeLast is used by unit tests to verify that all error codes have
	// a human readable entry in the ErrorCodes map. This error will never be
	// returned.
	ErrorCodeLast ErrorCodeT = 23
	err := unittest.TestGenericConstMap(ErrorCodes, uint64(ErrorCodeLast))
	if err != nil {
		t.Error(err)
	}

Copy link
Member

@lukebp lukebp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@lukebp lukebp merged commit 4abe403 into decred:master Oct 13, 2021
@amass01 amass01 deleted the humanreadableerror branch October 13, 2021 15:21
@lukebp lukebp added 91cfcc8 bug A bug that made it into a production enviroment. labels Oct 13, 2021
@lukebp lukebp changed the title pi: readable invalid status transition error. pi: Make status transition error human readable. Oct 13, 2021
@lukebp lukebp added pi-not-deployed UX and removed bug A bug that made it into a production enviroment. labels Oct 14, 2021
@lukebp lukebp mentioned this pull request Nov 16, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pi: human readable invalid billing status transition error.
2 participants