From 4d3c2785ab6c9a4e0818ff4b8a5f5b86f4896abb Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Tue, 14 Nov 2023 19:53:38 +0100 Subject: [PATCH] Update util/store/iter.go --- util/store/iter.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/util/store/iter.go b/util/store/iter.go index ae30935eb8..e4cc9cb0d1 100644 --- a/util/store/iter.go +++ b/util/store/iter.go @@ -85,7 +85,7 @@ type StrExtractor func([]byte) string func LoadAllDecCoins(iter db.Iterator, prefixLen int) (sdk.DecCoins, error) { var coins sdk.DecCoins cb := func(key, val []byte) error { - o := sdk.DecCoin{Denom: rmPrefix(key, prefixLen)} + o := sdk.DecCoin{Denom: string(key[prefixLen:])} if err := o.Amount.Unmarshal(val); err != nil { return err } @@ -96,12 +96,5 @@ func LoadAllDecCoins(iter db.Iterator, prefixLen int) (sdk.DecCoins, error) { if err := iterate(iter, cb); err != nil { return nil, err } - return coins, nil } - -// rmPrefix extracts denom from a key with the form -// prefix | denom -func rmPrefix(key []byte, prefixLen int) string { - return string(key[prefixLen:]) -}