Minor fixes
This commit is contained in:
parent
645160c9d3
commit
c2548e248c
|
@ -122,11 +122,12 @@ func (p *Presenter) getBridgeSideInfo(ctx context.Context, bridgeID string, cfg
|
|||
func (p *Presenter) getBlockTimeOrDefault(ctx context.Context, chainID string, blockNumber uint) (time.Time, error) {
|
||||
bt, err := p.repo.BlockTimestamps.GetByBlockNumber(ctx, chainID, blockNumber)
|
||||
if err != nil && !errors.Is(err, db.ErrNotFound) {
|
||||
if errors.Is(err, db.ErrNotFound) {
|
||||
return time.Time{}, nil
|
||||
}
|
||||
return time.Time{}, fmt.Errorf("failed to get block timestamp: %w", err)
|
||||
} else if err == nil {
|
||||
return bt.Timestamp, nil
|
||||
}
|
||||
return time.Time{}, nil
|
||||
return bt.Timestamp, nil
|
||||
}
|
||||
|
||||
func (p *Presenter) GetBridgeConfig(w http.ResponseWriter, r *http.Request) {
|
||||
|
|
|
@ -77,10 +77,7 @@ func (r *bridgeValidatorsRepo) FindActiveValidators(ctx context.Context, bridgeI
|
|||
vals := make([]*entity.BridgeValidator, 0, 10)
|
||||
err = r.db.SelectContext(ctx, &vals, q, args...)
|
||||
if err != nil {
|
||||
if errors.Is(err, sql.ErrNoRows) {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, fmt.Errorf("can't get bridge validator: %w", err)
|
||||
return nil, fmt.Errorf("can't get bridge validators: %w", err)
|
||||
}
|
||||
return vals, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue