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

Method GetParams

fsm/gov.go:277–306  ·  view source on GitHub ↗

GetParams() returns the aggregated ParamSpaces in a single Params object

()

Source from the content-addressed store, hash-verified

275
276// GetParams() returns the aggregated ParamSpaces in a single Params object
277func (s *StateMachine) GetParams() (*Params, lib.ErrorI) {
278 // get the consensus parameters from state
279 cons, err := s.GetParamsCons()
280 if err != nil {
281 return nil, err
282 }
283 // get the validator parameters from state
284 val, err := s.GetParamsVal()
285 if err != nil {
286 return nil, err
287 }
288 // get the fee parameters from state
289 fee, err := s.GetParamsFee()
290 if err != nil {
291 return nil, err
292 }
293 // get the governance parameters from state
294 gov, err := s.GetParamsGov()
295 if err != nil {
296 return nil, err
297 }
298 // return a collective 'parameters' object that holds all the spaces
299 // proto copies are needed for update safety
300 return &Params{
301 Consensus: proto.Clone(cons).(*ConsensusParams),
302 Validator: proto.Clone(val).(*ValidatorParams),
303 Fee: proto.Clone(fee).(*FeeParams),
304 Governance: proto.Clone(gov).(*GovernanceParams),
305 }, nil
306}
307
308// GetParamsCons() returns the current state of the governance params in the Consensus space
309func (s *StateMachine) GetParamsCons() (ptr *ConsensusParams, err lib.ErrorI) {

Calls 5

GetParamsConsMethod · 0.95
GetParamsValMethod · 0.95
GetParamsFeeMethod · 0.95
GetParamsGovMethod · 0.95
CloneMethod · 0.80