Skip to content

Commit

Permalink
Add BlockByHash client implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
natebeauregard committed Dec 19, 2024
1 parent 65328fc commit d89fa5f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion e2e/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit d89fa5f

Please sign in to comment.