From 8b6e32e7c6c706227ab2a1529767623a88208bcc Mon Sep 17 00:00:00 2001 From: likhita-809 Date: Thu, 8 Jul 2021 16:36:41 +0530 Subject: [PATCH] add godocs --- types/kv/helpers.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/kv/helpers.go b/types/kv/helpers.go index 582c9f31077a..5bccea122eb5 100644 --- a/types/kv/helpers.go +++ b/types/kv/helpers.go @@ -2,12 +2,14 @@ package kv import "fmt" +// AssertKeyAtLeastLength panics when store key length is less than the given length. func AssertKeyAtLeastLength(bz []byte, length int) { if len(bz) < length { panic(fmt.Sprintf("expected key of length at least %d, got %d", length, len(bz))) } } +// AssertKeyLength panics when store key length is not equal to the given length. func AssertKeyLength(bz []byte, length int) { if len(bz) != length { panic(fmt.Sprintf("unexpected key length; got: %d, expected: %d", len(bz), length))