check / check (push) Successful in 4m30s
go-bip39's repository no longer exists, so keyfunc now carries the part of v1.1.0 it uses, with the upstream LICENSE beside it, and imports it from internal/bip39. Upstream's tests and test vectors for the kept code come along unchanged; where they called a removed function, crypto/rand stands in for NewEntropy and EntropyFromMnemonic for MnemonicToByteArray. Changes beyond the trimming are what the linter asked for: the package-level variables moved into the functions that use them, three error strings were lower-cased, and the unknown-word error now wraps ErrInvalidMnemonic. go.mod no longer requires go-bip39. go mod tidy keeps its two go.sum lines, because a test in sneak/secret's bip85 package imports it, and drops six lines that only go-bip39's own requirements needed. Model: opus-5-5 Co-authored-by: clawbot <sneak+clawbot@sneak.cloud>
20 lines
384 B
Go
20 lines
384 B
Go
package bip39
|
|
|
|
import (
|
|
"hash/crc32"
|
|
"testing"
|
|
)
|
|
|
|
func TestEnglishChecksum(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
// Ensure word list is correct
|
|
// $ wget https://raw.githubusercontent.com/bitcoin/bips/master/bip-0039/english.txt
|
|
// $ crc32 english.txt
|
|
// c1dbd296
|
|
checksum := crc32.ChecksumIEEE([]byte(english))
|
|
if checksum != 0xc1dbd296 {
|
|
t.Error("english checksum invalid")
|
|
}
|
|
}
|