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

Method GetParamsFee

fsm/gov.go:342–352  ·  view source on GitHub ↗

GetParamsFee() returns the current state of the governance params in the Fee space

()

Source from the content-addressed store, hash-verified

340
341// GetParamsFee() returns the current state of the governance params in the Fee space
342func (s *StateMachine) GetParamsFee() (ptr *FeeParams, err lib.ErrorI) {
343 // check cache
344 if s.cache.feeParams == nil {
345 // create a new object ref for the fee params to ensure a non-nil result
346 s.cache.feeParams = new(FeeParams)
347 // get the fee parameters from state
348 err = s.getParams(ParamSpaceFee, s.cache.feeParams, ErrEmptyFeeParams)
349 }
350 // exit
351 return s.cache.feeParams, err
352}
353
354// getParams() is a generic helper function loads the params for a specific ParamSpace into a ptr object
355func (s *StateMachine) getParams(space string, ptr any, emptyErr func() lib.ErrorI) (err lib.ErrorI) {

Callers 6

GetFeeForMessageNameMethod · 0.95
UpdateParamMethod · 0.95
GetParamsMethod · 0.95
TestGetFeeForMessageFunction · 0.80
TestSetGetParamsFunction · 0.80
FeeParamsMethod · 0.80

Calls 1

getParamsMethod · 0.95

Tested by 2

TestGetFeeForMessageFunction · 0.64
TestSetGetParamsFunction · 0.64