Lethean-specific mining configurations: - LetheanTestnetConfig — pool.lthn.io:5555, ProgPoWZ, 50% CPU - LetheanMainnetConfig — pool.lthn.io:3333, ProgPoWZ, 75% CPU - LetheanSoloConfig — direct daemon RPC (46941/36941), 100% CPU - LetheanDefaultProfile — ready-to-use MiningProfile with RawConfig - LetheanDualMiningProfile — GPU:ProgPoWZ(LTHN) + CPU:RandomX(XMR) All configs: zero donate level (XMRig telemetry stripped), keepalive on. 5/5 tests passing. Co-Authored-By: Charon <charon@lethean.io>
76 lines
2.3 KiB
Go
76 lines
2.3 KiB
Go
// Copyright (c) 2017-2026 Lethean (https://lt.hn)
|
|
// SPDX-License-Identifier: EUPL-1.2
|
|
|
|
package mining
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
const testAddress = "iTHNUNiuu3VP1yy8xH2y5iQaABKXurdjqZmzFiBiyR4dKG3j6534e9jMriY6SM7PH8NibVwVWW1DWJfQEWnSjS8n3Wgx86pQpY"
|
|
|
|
func TestLetheanTestnetConfig_Good(t *testing.T) {
|
|
config := LetheanTestnetConfig(testAddress)
|
|
if config.Pool != LetheanTestnetPool {
|
|
t.Errorf("pool: got %s, want %s", config.Pool, LetheanTestnetPool)
|
|
}
|
|
if config.Algo != "progpowz" {
|
|
t.Errorf("algo: got %s, want progpowz", config.Algo)
|
|
}
|
|
if config.Coin != "lethean" {
|
|
t.Errorf("coin: got %s, want lethean", config.Coin)
|
|
}
|
|
if config.Wallet != testAddress {
|
|
t.Error("wallet address mismatch")
|
|
}
|
|
if config.DonateLevel != 0 {
|
|
t.Errorf("donate: got %d, want 0", config.DonateLevel)
|
|
}
|
|
}
|
|
|
|
func TestLetheanMainnetConfig_Good(t *testing.T) {
|
|
config := LetheanMainnetConfig(testAddress)
|
|
if config.Pool != LetheanMainnetPool {
|
|
t.Errorf("pool: got %s, want %s", config.Pool, LetheanMainnetPool)
|
|
}
|
|
if config.CPUMaxThreadsHint != 75 {
|
|
t.Errorf("threads hint: got %d, want 75", config.CPUMaxThreadsHint)
|
|
}
|
|
}
|
|
|
|
func TestLetheanSoloConfig_Good(t *testing.T) {
|
|
config := LetheanSoloConfig(testAddress, true)
|
|
if config.Pool != LetheanSoloTestnet {
|
|
t.Errorf("pool: got %s, want %s", config.Pool, LetheanSoloTestnet)
|
|
}
|
|
if config.CPUMaxThreadsHint != 100 {
|
|
t.Errorf("threads hint: got %d, want 100 (solo)", config.CPUMaxThreadsHint)
|
|
}
|
|
}
|
|
|
|
func TestLetheanDefaultProfile_Good(t *testing.T) {
|
|
profile := LetheanDefaultProfile(testAddress, true)
|
|
if profile.Name != "Lethean Testnet" {
|
|
t.Errorf("name: got %s, want Lethean Testnet", profile.Name)
|
|
}
|
|
if profile.MinerType != "xmrig" {
|
|
t.Errorf("miner: got %s, want xmrig", profile.MinerType)
|
|
}
|
|
if len(profile.Config) == 0 {
|
|
t.Error("config should not be empty")
|
|
}
|
|
// Config is RawConfig (JSON bytes) — verify it contains progpowz
|
|
configStr := string(profile.Config)
|
|
if !strings.Contains(configStr, "progpowz") {
|
|
t.Errorf("config should contain progpowz, got: %s", configStr[:50])
|
|
}
|
|
}
|
|
|
|
func TestLetheanDualMiningProfile_Good(t *testing.T) {
|
|
profile := LetheanDualMiningProfile(testAddress, "4FAKEXMR", true)
|
|
configStr := string(profile.Config)
|
|
if !strings.Contains(configStr, "25") {
|
|
t.Errorf("dual mining config should have 25%% cpu hint")
|
|
}
|
|
}
|