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>
25 lines
512 B
Go
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)))
|
|
}
|