package chains_test import ( "testing" "git.smesh.lol/btcd-lite/internal/chains" ) // TestProfiles loads both profiles and requires the fork constants to agree // with each other. func TestProfiles(t *testing.T) { ps, err := chains.Profiles() if err != nil { t.Fatalf("load: %v", err) } btc, xbt := ps[0], ps[1] if btc.Name != "btc" || xbt.Name != "xbt" { t.Fatalf("names %q %q", btc.Name, xbt.Name) } if xbt.HeaderV2Height != chains.ForkFirstHeight { t.Fatalf("fork first height %d, constants say %d", xbt.HeaderV2Height, chains.ForkFirstHeight) } if xbt.Checkpoint == nil || xbt.Checkpoint.Height != chains.SharedLastHeight { t.Fatalf("fork checkpoint is at %v, constants say %d", xbt.Checkpoint, chains.SharedLastHeight) } if btc.GenesisHash != xbt.GenesisHash { t.Fatal("profiles do not share a genesis") } }