Skip to content

Commit

Permalink
Remove 0 block check
Browse files Browse the repository at this point in the history
  • Loading branch information
ferglor committed Jul 1, 2024
1 parent 09dc7e2 commit 71b4ea5
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -462,13 +462,11 @@ func (r *EvmRegistry) addToActive(ctx context.Context, id *big.Int, force bool)
func (r *EvmRegistry) buildCallOpts(ctx context.Context, block *big.Int) (*bind.CallOpts, error) {
opts := bind.CallOpts{
Context: ctx,
BlockNumber: block,
BlockNumber: nil,
}

if block == nil || block.Int64() == 0 {
if r.LatestBlock() != 0 {
opts.BlockNumber = big.NewInt(r.LatestBlock())
}
opts.BlockNumber = big.NewInt(r.LatestBlock())
} else {
opts.BlockNumber = block
}
Expand Down Expand Up @@ -716,7 +714,7 @@ func (r *EvmRegistry) getUpkeepConfigs(ctx context.Context, ids []*big.Int) ([]a
)

for i, id := range ids {
opts, err := r.buildCallOpts(ctx, big.NewInt(0))
opts, err := r.buildCallOpts(ctx, nil)
if err != nil {
return nil, fmt.Errorf("failed to get call opts: %s", err)
}
Expand Down

0 comments on commit 71b4ea5

Please sign in to comment.