Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions ledger/catchpointtracker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,7 @@ func TestSecondStageDeletesUnfinishedCatchpointRecordAfterRestart(t *testing.T)
// before the change != hash calculated now. Accepting the new hash risks
// breaking backwards compatibility.
//
// The test also confirms each hashKind has at least 1 test case. The check
// The test also confirms each HashKind has at least 1 test case. The check
// defends against the addition of a hashed data type without test coverage.
func TestHashContract(t *testing.T) {
partitiontest.PartitionTest(t)
Expand Down Expand Up @@ -1475,9 +1475,10 @@ func TestHashContract(t *testing.T) {
return false
}

require.True(t, strings.HasPrefix(store.HashKind(255).String(), "HashKind("))
for i := byte(0); i < 255; i++ {
if !strings.HasPrefix(store.HashKind(i).String(), "hashKind(") {
require.True(t, hasTestCoverageForKind(store.HashKind(i)), fmt.Sprintf("Missing test coverage for hashKind ordinal value = %d", i))
if !strings.HasPrefix(store.HashKind(i).String(), "HashKind(") {
require.True(t, hasTestCoverageForKind(store.HashKind(i)), fmt.Sprintf("Missing test coverage for HashKind ordinal value = %d", i))
}
}
}
6 changes: 3 additions & 3 deletions ledger/store/hashing.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ import (
)

// HashKind enumerates the possible data types hashed into a catchpoint merkle
// trie. Each merkle trie hash includes the hashKind byte at a known-offset.
// By encoding hashKind at a known-offset, it's possible for hash readers to
// trie. Each merkle trie hash includes the HashKind byte at a known-offset.
// By encoding HashKind at a known-offset, it's possible for hash readers to
// disambiguate the hashed resource.
//
//go:generate stringer -type=hashKind
//go:generate stringer -type=HashKind
//msgp:ignore HashKind
type HashKind byte

Expand Down
12 changes: 6 additions & 6 deletions ledger/store/hashkind_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions scripts/travis/codegen_verification.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ echo "Running check_license..."
echo "Rebuild swagger.json files"
make rebuild_swagger

echo "Regenerate config files"
go generate ./config
echo "Regenerate for stringer et el."
make generate

echo "Running fixcheck"
GOPATH=$(go env GOPATH)
Expand Down