From 96d58242dd6e6e8bbcc0fb443854354220cdc2e7 Mon Sep 17 00:00:00 2001 From: Nate Beauregard Date: Thu, 19 Dec 2024 17:07:14 -0500 Subject: [PATCH] Add BlockByHash client implementation --- e2e/clients.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/e2e/clients.go b/e2e/clients.go index 206fcf4d..555ce826 100644 --- a/e2e/clients.go +++ b/e2e/clients.go @@ -53,7 +53,15 @@ func (m *MonomerClient) GenesisHash(ctx context.Context) (common.Hash, error) { func (m *MonomerClient) BlockByNumber(ctx context.Context, number *big.Int) (*ethtypes.Block, error) { block, err := m.ethclient.BlockByNumber(ctx, number) if err != nil { - return nil, err + return nil, fmt.Errorf("block by number: %v", err) + } + return block, nil +} + +func (m *MonomerClient) BlockByHash(ctx context.Context, hash common.Hash) (*ethtypes.Block, error) { + block, err := m.ethclient.BlockByHash(ctx, hash) + if err != nil { + return nil, fmt.Errorf("block by hash: %v", err) } return block, nil }