Upgrade dashboard, builder, and agent resource controls.
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.
This commit is contained in:
28
agent/miner/target_test.go
Normal file
28
agent/miner/target_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
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))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user