From 3149b2129bb3cd9765379a354e4ca7b4b269bf31 Mon Sep 17 00:00:00 2001 From: rene <41963722+renaynay@users.noreply.github.com> Date: Wed, 24 Jan 2024 16:52:42 -0600 Subject: [PATCH] fix(headertest): Return err not found in header store if not found --- headertest/store.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/headertest/store.go b/headertest/store.go index c0ab6438..99b5d3b3 100644 --- a/headertest/store.go +++ b/headertest/store.go @@ -62,7 +62,11 @@ func (m *Store[H]) Get(ctx context.Context, hash header.Hash) (H, error) { } func (m *Store[H]) GetByHeight(ctx context.Context, height uint64) (H, error) { - return m.Headers[height], nil + if header, exists := m.Headers[height]; exists { + return header, nil + } + var zero H + return zero, header.ErrNotFound } func (m *Store[H]) GetRange(ctx context.Context, from, to uint64) ([]H, error) {