Skip to content

Commit

Permalink
fix(zetaclient): add block by number result nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
gartnera committed Sep 14, 2024
1 parent 9988584 commit 86344f6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions zetaclient/chains/evm/observer/observer.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ func (ob *Observer) BlockByNumber(blockNumber int) (*ethrpc.Block, error) {
if err != nil {
return nil, err
}
if block == nil {
return nil, fmt.Errorf("block not found: %d", blockNumber)

Check warning on line 319 in zetaclient/chains/evm/observer/observer.go

View check run for this annotation

Codecov / codecov/patch

zetaclient/chains/evm/observer/observer.go#L319

Added line #L319 was not covered by tests
}
for i := range block.Transactions {
err := evm.ValidateEvmTransaction(&block.Transactions[i])
if err != nil {
Expand Down

0 comments on commit 86344f6

Please sign in to comment.