Dark UI with hashrate graphs, inline setting help, percent-based threads/RAM, configurable process name and display modes, and LAN-aware run.bat startup banner.
29 lines
785 B
Go
29 lines
785 B
Go
package miner
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestHashMeetsTargetEqual(t *testing.T) {
|
|
target := "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
|
|
hash := "0000000000000000000000000000000000000000000000000000000000000001"
|
|
if !hashMeetsTarget(hash, target) {
|
|
t.Fatal("lower hash should meet high target")
|
|
}
|
|
}
|
|
|
|
func TestHashMeetsTargetReject(t *testing.T) {
|
|
target := "0000000000000000000000000000000000000000000000000000000000000001"
|
|
hash := "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
|
|
if hashMeetsTarget(hash, target) {
|
|
t.Fatal("high hash should not meet low target")
|
|
}
|
|
}
|
|
|
|
func TestDifficultyToTargetHex(t *testing.T) {
|
|
out := difficultyToTargetHex(1000)
|
|
if len(out) != 64 {
|
|
t.Fatalf("expected 64 hex chars, got %d", len(out))
|
|
}
|
|
}
|