MCPcopy Create free account
hub / github.com/akash-network/node / makeTestKey

Function makeTestKey

util/query/pagination_test.go:221–238  ·  view source on GitHub ↗

makeTestKey is a helper function to create a valid pagination key for testing

(t *testing.T, states, prefix, key, unsolicited []byte)

Source from the content-addressed store, hash-verified

219
220// makeTestKey is a helper function to create a valid pagination key for testing
221func makeTestKey(t *testing.T, states, prefix, key, unsolicited []byte) []byte {
222 if len(states) == 0 {
223 t.Fatal("states cannot be empty")
224 }
225 if len(prefix) == 0 {
226 t.Fatal("prefix cannot be empty")
227 }
228 if len(key) == 0 {
229 t.Fatal("key cannot be empty")
230 }
231
232 encoded, err := EncodePaginationKey(states, prefix, key, unsolicited)
233 if err != nil {
234 t.Fatalf("failed to encode pagination key: %v", err)
235 }
236
237 return encoded
238}

Callers 1

TestDecodePaginationKeyFunction · 0.85

Calls 1

EncodePaginationKeyFunction · 0.85

Tested by

no test coverage detected