ax(mining): replace prose comments with usage examples in simulated_miner.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run

AX principle 2 — comments must show HOW (concrete call), not restate WHAT
the name already says. Three prose-style descriptions replaced with
realistic usage examples showing struct construction and registration.

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 16:56:59 +01:00
parent 09f6f12f08
commit 7b098da3be
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -9,10 +9,10 @@ import (
"time"
)
// MinerTypeSimulated is the type identifier for simulated miners.
// factory.Register(MinerTypeSimulated, func() Miner { return NewSimulatedMiner(SimulatedMinerConfig{}) })
const MinerTypeSimulated = "simulated"
// SimulatedMiner is a mock miner that generates realistic-looking stats for UI testing.
// miner := &SimulatedMiner{Name: "sim-001", MinerType: MinerTypeSimulated, Algorithm: "rx/0"}
type SimulatedMiner struct {
// Exported fields for JSON serialization
Name string `json:"name"`
@ -42,7 +42,7 @@ type SimulatedMiner struct {
difficultyBase int
}
// SimulatedMinerConfig holds configuration for creating a simulated miner.
// SimulatedMinerConfig{Name: "sim-001", Algorithm: "rx/0", BaseHashrate: 5000, Variance: 0.1}
type SimulatedMinerConfig struct {
Name string // Miner instance name (e.g., "sim-xmrig-001")
Algorithm string // Algorithm name (e.g., "rx/0", "kawpow", "ethash")