MCPcopy
hub / github.com/canopy-network/canopy / HandleMessageChangeParameter

Method HandleMessageChangeParameter

fsm/message.go:292–304  ·  view source on GitHub ↗

HandleMessageChangeParameter() is the proper handler for an `Change-Parameter` message

(msg *MessageChangeParameter)

Source from the content-addressed store, hash-verified

290
291// HandleMessageChangeParameter() is the proper handler for an `Change-Parameter` message
292func (s *StateMachine) HandleMessageChangeParameter(msg *MessageChangeParameter) lib.ErrorI {
293 // requires explicit approval from +2/3 maj of the validator set
294 if err := s.ApproveProposal(msg); err != nil {
295 return ErrRejectProposal()
296 }
297 // extract the value from the proto packed 'any'
298 protoMsg, err := lib.FromAny(msg.ParameterValue)
299 if err != nil {
300 return err
301 }
302 // update the parameter
303 return s.UpdateParam(msg.ParameterSpace, msg.ParameterKey, protoMsg)
304}
305
306// HandleMessageDAOTransfer() is the proper handler for a `DAO-Transfer` message
307func (s *StateMachine) HandleMessageDAOTransfer(msg *MessageDAOTransfer) lib.ErrorI {

Calls 4

ApproveProposalMethod · 0.95
UpdateParamMethod · 0.95
FromAnyFunction · 0.92
ErrRejectProposalFunction · 0.85