node icon indicating copy to clipboard operation
node copied to clipboard

MsgAddAuthorization: provide a string instead of the enum identifier for policy type

Open lumtis opened this issue 1 year ago • 2 comments

Describe the Issue For MsgAddAuthorization, currently the policy type must be provided as its identifier

	PolicyType_groupEmergency   PolicyType = 0
	PolicyType_groupOperational PolicyType = 1
	PolicyType_groupAdmin PolicyType = 2
	PolicyType_groupEmpty PolicyType = 3

This is very sensitive action as setting the wrong permission with this message could have huge impact on the protocol. We should use in the message a parameter more explicit than the number as it could be more prone to mistake.

Also 0, the default value, grant the emergency permission which only requires a single signature.

Considered solution

Using a string representing the policy type "admin" -> 2 "operational" -> 1 "emergency" -> 0

lumtis avatar Sep 19 '24 12:09 lumtis

Consider an interactive CLI . After submitting, it can print "Adding message XXX to authorization table with policy YYY; Press enter to continue."

Assuming that the CLI is primarily used to send these messages.

kingpinXD avatar Sep 20 '24 04:09 kingpinXD

I created this one in particular with gov-ops usage where the CLI is not usage, so this is basically about adding a string in the message so it can be directly visualized

lumtis avatar Sep 20 '24 15:09 lumtis