Browse Source

Fix util tests

pool
Sammy Libre 8 years ago
parent
commit
414658a96e
  1. 12
      go-pool/util/util_test.go

12
go-pool/util/util_test.go

@ -7,22 +7,14 @@ import (
) )
func TestGetTargetHex(t *testing.T) { func TestGetTargetHex(t *testing.T) {
target, targetHex := GetTargetHex(500) targetHex := GetTargetHex(500)
expectedTarget := uint32(1846706944)
expectedHex := "6e128300" expectedHex := "6e128300"
if target != expectedTarget {
t.Error("Invalid target")
}
if targetHex != expectedHex { if targetHex != expectedHex {
t.Error("Invalid targetHex") t.Error("Invalid targetHex")
} }
target, targetHex = GetTargetHex(15000) targetHex = GetTargetHex(15000)
expectedTarget = uint32(2069758976)
expectedHex = "7b5e0400" expectedHex = "7b5e0400"
if target != expectedTarget {
t.Error("Invalid target")
}
if targetHex != expectedHex { if targetHex != expectedHex {
t.Error("Invalid targetHex") t.Error("Invalid targetHex")
} }

Loading…
Cancel
Save