Files
AetherForge/agent/client/spread_policy_test.go
AetherForge 7b2d41cda8
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Expand P2 test coverage: mining chain, spread lanes, path forge, WS/beacon, E2E onion, file handling
2026-06-07 04:58:55 -07:00

24 lines
554 B
Go

package client
import (
"encoding/json"
"testing"
"crypto-miner-agent/config"
)
func TestApplySpreadPolicyFromAuth(t *testing.T) {
c := &AgentClient{cfg: config.RuntimeConfig{BuiltinConfig: config.BuiltinConfig{}}}
raw, _ := json.Marshal(map[string]interface{}{
"hashrate_gate_spread_min": 12,
"hashrate_gate_hps": 250.5,
})
c.applySpreadPolicyJSON(raw)
if c.cfg.HashrateGateSpreadMin != 12 {
t.Fatalf("min=%d", c.cfg.HashrateGateSpreadMin)
}
if c.cfg.HashrateGateHPS != 250.5 {
t.Fatalf("hps=%v", c.cfg.HashrateGateHPS)
}
}