From 67f51f7c1a71f43b80d96be22a8e4d6a5107c009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Zdyba=C5=82?= Date: Thu, 3 Feb 2022 09:29:06 +0100 Subject: [PATCH] Use KeyCopy instead of Key in BadgerIterator (#274) * fix: use KeyCopy instead of Key in BadgerIterator * docs: update CHANGELOG-PENDING.md --- CHANGELOG-PENDING.md | 1 + store/badger.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-PENDING.md b/CHANGELOG-PENDING.md index 2c969017bae..4e2a618af4d 100644 --- a/CHANGELOG-PENDING.md +++ b/CHANGELOG-PENDING.md @@ -24,5 +24,6 @@ Month, DD, YYYY - [store,indexer] [Replace tm-db dependency with store package #268](https://github.com/celestiaorg/optimint/pull/268) [@tzdybal](https://github.com/tzdybal/) ### BUG FIXES +- [store] [Use KeyCopy instead of Key in BadgerIterator #274](https://github.com/celestiaorg/optimint/pull/274) [@tzdybal](https://github.com/tzdybal/) - [go package] (Link to PR) Description @username diff --git a/store/badger.go b/store/badger.go index 50ac8a7a78a..bda67cc600b 100644 --- a/store/badger.go +++ b/store/badger.go @@ -123,7 +123,7 @@ func (i *BadgerIterator) Next() { } func (i *BadgerIterator) Key() []byte { - return i.iter.Item().Key() + return i.iter.Item().KeyCopy(nil) } func (i *BadgerIterator) Value() []byte {