@@ -422,49 +422,49 @@ func (k Keeper) handleNetworkRegistered(ctx sdk.Context, log ethTypes.Log) {
422422
423423 // Override Core network parameters (if event has values)
424424 if event .Hyperparams .Rho != 0 {
425- params ["rho" ] = strconv .FormatFloat (float64 (event .Hyperparams .Rho )/ 10000.0 , 'f' , - 1 , 64 )
425+ params [types . KeyRho ] = strconv .FormatFloat (float64 (event .Hyperparams .Rho )/ 10000.0 , 'f' , - 1 , 64 )
426426 }
427427 if event .Hyperparams .Kappa != 0 {
428- params ["kappa" ] = fmt .Sprintf ("%d" , event .Hyperparams .Kappa )
428+ params [types . KeyKappa ] = fmt .Sprintf ("%d" , event .Hyperparams .Kappa )
429429 }
430430 if event .Hyperparams .ImmunityPeriod != 0 {
431- params ["immunity_period" ] = fmt .Sprintf ("%d" , event .Hyperparams .ImmunityPeriod )
431+ params [types . KeyImmunityPeriod ] = fmt .Sprintf ("%d" , event .Hyperparams .ImmunityPeriod )
432432 }
433433 if event .Hyperparams .Tempo != 0 {
434- params ["tempo" ] = fmt .Sprintf ("%d" , event .Hyperparams .Tempo )
434+ params [types . KeyTempo ] = fmt .Sprintf ("%d" , event .Hyperparams .Tempo )
435435 }
436436 if event .Hyperparams .MaxValidators != 0 {
437- params ["max_validators" ] = fmt .Sprintf ("%d" , event .Hyperparams .MaxValidators )
437+ params [types . KeyMaxValidators ] = fmt .Sprintf ("%d" , event .Hyperparams .MaxValidators )
438438 }
439439 if event .Hyperparams .ActivityCutoff != 0 {
440- params ["activity_cutoff" ] = fmt .Sprintf ("%d" , event .Hyperparams .ActivityCutoff )
440+ params [types . KeyActivityCutoff ] = fmt .Sprintf ("%d" , event .Hyperparams .ActivityCutoff )
441441 }
442442 if event .Hyperparams .MaxAllowedUids != 0 {
443- params ["max_allowed_uids" ] = fmt .Sprintf ("%d" , event .Hyperparams .MaxAllowedUids )
443+ params [types . KeyMaxAllowedUids ] = fmt .Sprintf ("%d" , event .Hyperparams .MaxAllowedUids )
444444 }
445445 if event .Hyperparams .MaxAllowedValidators != 0 {
446- params ["max_allowed_validators" ] = fmt .Sprintf ("%d" , event .Hyperparams .MaxAllowedValidators )
446+ params [types . KeyMaxAllowedValidators ] = fmt .Sprintf ("%d" , event .Hyperparams .MaxAllowedValidators )
447447 }
448448 if event .Hyperparams .MinAllowedWeights != 0 {
449- params ["min_allowed_weights" ] = fmt .Sprintf ("%d" , event .Hyperparams .MinAllowedWeights )
449+ params [types . KeyMinAllowedWeights ] = fmt .Sprintf ("%d" , event .Hyperparams .MinAllowedWeights )
450450 }
451451 if event .Hyperparams .MaxWeightsLimit != 0 {
452- params ["max_weights_limit" ] = fmt .Sprintf ("%d" , event .Hyperparams .MaxWeightsLimit )
452+ params [types . KeyMaxWeightsLimit ] = fmt .Sprintf ("%d" , event .Hyperparams .MaxWeightsLimit )
453453 }
454454
455455 // Directly add Economic & Governance parameters
456- params ["base_neuron_cost" ] = event .Hyperparams .BaseNeuronCost .String ()
457- params ["current_difficulty" ] = fmt .Sprintf ("%d" , event .Hyperparams .CurrentDifficulty )
458- params ["target_regs_per_interval" ] = fmt .Sprintf ("%d" , event .Hyperparams .TargetRegsPerInterval )
459- params ["max_regs_per_block" ] = fmt .Sprintf ("%d" , event .Hyperparams .MaxRegsPerBlock )
460- params ["weights_rate_limit" ] = fmt .Sprintf ("%d" , event .Hyperparams .WeightsRateLimit )
461- params ["weights_set_rate_limit" ] = fmt .Sprintf ("%d" , event .Hyperparams .WeightsRateLimit ) // Compatible with stakework
462- params ["registration_allowed" ] = fmt .Sprintf ("%t" , event .Hyperparams .RegistrationAllowed )
463- params ["commit_reveal_enabled" ] = fmt .Sprintf ("%t" , event .Hyperparams .CommitRevealEnabled )
464- params ["commit_reveal_period" ] = fmt .Sprintf ("%d" , event .Hyperparams .CommitRevealPeriod )
465- params ["serving_rate_limit" ] = fmt .Sprintf ("%d" , event .Hyperparams .ServingRateLimit )
466- params ["validator_threshold" ] = event .Hyperparams .ValidatorThreshold .String ()
467- params ["neuron_threshold" ] = event .Hyperparams .NeuronThreshold .String ()
456+ params [types . KeyBaseNeuronCost ] = event .Hyperparams .BaseNeuronCost .String ()
457+ params [types . KeyCurrentDifficulty ] = fmt .Sprintf ("%d" , event .Hyperparams .CurrentDifficulty )
458+ params [types . KeyTargetRegsPerInterval ] = fmt .Sprintf ("%d" , event .Hyperparams .TargetRegsPerInterval )
459+ params [types . KeyMaxRegsPerBlock ] = fmt .Sprintf ("%d" , event .Hyperparams .MaxRegsPerBlock )
460+ params [types . KeyWeightsRateLimit ] = fmt .Sprintf ("%d" , event .Hyperparams .WeightsRateLimit )
461+ params [types . KeyWeightsSetRateLimit ] = fmt .Sprintf ("%d" , event .Hyperparams .WeightsRateLimit ) // Compatible with stakework
462+ params [types . KeyRegistrationAllowed ] = fmt .Sprintf ("%t" , event .Hyperparams .RegistrationAllowed )
463+ params [types . KeyCommitRevealEnabled ] = fmt .Sprintf ("%t" , event .Hyperparams .CommitRevealEnabled )
464+ params [types . KeyCommitRevealPeriod ] = fmt .Sprintf ("%d" , event .Hyperparams .CommitRevealPeriod )
465+ params [types . KeyServingRateLimit ] = fmt .Sprintf ("%d" , event .Hyperparams .ServingRateLimit )
466+ params [types . KeyValidatorThreshold ] = event .Hyperparams .ValidatorThreshold .String ()
467+ params [types . KeyNeuronThreshold ] = event .Hyperparams .NeuronThreshold .String ()
468468
469469 // Create subnet structure
470470 subnet := types.Subnet {
0 commit comments