Files
zeekay 65a56203c3 chore: initial commit — tree had no git at all
github.com/luxfi/bench existed only as loose files: no .git, no history, no
remote. An rm -rf would have destroyed it with nothing to recover from, and it
was invisible to every repo sweep that looks for a .git directory.

Includes the dependency repair that makes it build again. It previously failed
with:

    reading github.com/luxfi/geth/go.mod at revision v1.16.98: unknown revision

The v1.16.x line was DELETED from github.com/luxfi/geth. The requirement came
from github.com/luxfi/crypto, which pins the dead tag AND excludes the
alternative in every version through v1.20.0; v1.20.2 is the first that moved
to geth v1.20.1, so bumping crypto is what escapes it. geth then drops out of
go.mod entirely.

The compiled luxbench binary is ignored rather than committed.

Verified: go build ./... exits 0.

NOTE: no remote — luxfi/bench does not exist on GitHub. This is still one copy
in one place.
2026-07-26 04:23:44 -07:00

50 lines
1.1 KiB
Go

package zapvscodec
import (
"testing"
)
func TestSmokeCodecRoundtrip(t *testing.T) {
buf := MakeCodecValidatorBytes()
if len(buf) == 0 {
t.Fatal("empty codec bytes")
}
tx, err := UnmarshalCodec(buf)
if err != nil {
t.Fatalf("codec unmarshal: %v", err)
}
if tx.NetworkID != 1 {
t.Errorf("codec NetworkID = %d, want 1", tx.NetworkID)
}
if tx.Start != 1_700_000_000 {
t.Errorf("codec Start = %d, want 1700000000", tx.Start)
}
t.Logf("codec bytes: %d", len(buf))
}
func TestSmokeZAPRoundtrip(t *testing.T) {
buf := MakeZAPValidatorBytes()
if len(buf) == 0 {
t.Fatal("empty zap bytes")
}
tx, err := WrapZAPValidator(buf)
if err != nil {
t.Fatalf("zap wrap: %v", err)
}
if tx.NetworkID() != 1 {
t.Errorf("zap NetworkID = %d, want 1", tx.NetworkID())
}
if tx.Start() != 1_700_000_000 {
t.Errorf("zap Start = %d, want 1700000000", tx.Start())
}
t.Logf("zap bytes: %d", len(buf))
}
func TestSmokeBadMagicRejection(t *testing.T) {
buf := CorruptZAPBytes(8192)
_, err := WrapZAPValidator(buf)
if err == nil {
t.Fatal("expected error for corrupt magic, got nil")
}
}