Updates across core modules, app wiring, IBC config, governance execution tests, tokenfactory keeper/module, Makefile build targets, release CI, and dependency updates. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
41 lines
1.0 KiB
Go
41 lines
1.0 KiB
Go
package keeper
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"strconv"
|
|
)
|
|
|
|
// UpdateParam applies a governance parameter change to the modelregistry module.
|
|
func (k Keeper) UpdateParam(ctx context.Context, paramKey string, newValue string) error {
|
|
params, err := k.Params.Get(ctx)
|
|
if err != nil {
|
|
return fmt.Errorf("failed to get modelregistry params: %w", err)
|
|
}
|
|
|
|
switch paramKey {
|
|
case "min_deposit_uclaw":
|
|
v, err := strconv.ParseUint(newValue, 10, 64)
|
|
if err != nil {
|
|
return fmt.Errorf("invalid value for %s: %w", paramKey, err)
|
|
}
|
|
params.MinDepositUclaw = v
|
|
case "max_models":
|
|
v, err := strconv.ParseUint(newValue, 10, 64)
|
|
if err != nil {
|
|
return fmt.Errorf("invalid value for %s: %w", paramKey, err)
|
|
}
|
|
params.MaxModels = v
|
|
case "platform_fee_bps":
|
|
v, err := strconv.ParseUint(newValue, 10, 64)
|
|
if err != nil {
|
|
return fmt.Errorf("invalid value for %s: %w", paramKey, err)
|
|
}
|
|
params.PlatformFeeBps = v
|
|
default:
|
|
return fmt.Errorf("unknown modelregistry param key: %s", paramKey)
|
|
}
|
|
|
|
return k.Params.Set(ctx, params)
|
|
}
|