From b843da73dd6a487e4cec0e458ec662fb2edbde14 Mon Sep 17 00:00:00 2001 From: sangtran Date: Sat, 5 Sep 2026 23:51:10 +0700 Subject: misc: fix return bug in pebble_state and add on close method cleanup --- state/pebble_backend.go | 6 ++++++ state/pebble_state.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'state') diff --git a/state/pebble_backend.go b/state/pebble_backend.go index fbb8d68..b510f8f 100644 --- a/state/pebble_backend.go +++ b/state/pebble_backend.go @@ -128,3 +128,9 @@ func (p *PebbleStateBackend) deserialize(stateID uint8) []byte { } return b } + +func (p *PebbleStateBackend) Close() error { + return p.db.Close() +} + + diff --git a/state/pebble_state.go b/state/pebble_state.go index 3eeaa05..0b60deb 100644 --- a/state/pebble_state.go +++ b/state/pebble_state.go @@ -44,7 +44,7 @@ func (p *pebbleStateValue) Value(ctx context.Context) (any, error) { res := core.GetBuffer(len(v)) copy(res, v) - return v, nil + return res, nil } func (p *pebbleStateValue) Clear(ctx context.Context) error { -- cgit v1.3.1