go-blockchain/consensus/pow_test.go
Snider 34128d8e98
Some checks failed
Security Scan / security (pull_request) Successful in 11s
Test / Test (pull_request) Failing after 19s
refactor: migrate module path to dappco.re/go/core/blockchain
Update go.mod module line, all require/replace directives, and every
.go import path from forge.lthn.ai/core/go-blockchain to
dappco.re/go/core/blockchain. Add replace directives to bridge
dappco.re paths to existing forge.lthn.ai registry during migration.
Update CLAUDE.md, README, and docs to reflect the new module path.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 01:49:26 +00:00

25 lines
512 B
Go

//go:build !integration
package consensus
import (
"testing"
"dappco.re/go/core/blockchain/types"
"github.com/stretchr/testify/assert"
)
func TestCheckDifficulty_Good(t *testing.T) {
// A zero hash meets any difficulty.
hash := types.Hash{}
assert.True(t, CheckDifficulty(hash, 1))
}
func TestCheckDifficulty_Bad(t *testing.T) {
// Max hash (all 0xFF) should fail high difficulty.
hash := types.Hash{}
for i := range hash {
hash[i] = 0xFF
}
assert.False(t, CheckDifficulty(hash, ^uint64(0)))
}