Skip to content

Commit

Permalink
CNS-45: minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
oren-lava committed Dec 25, 2022
1 parent 8d64550 commit 75b9076
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion x/pairing/keeper/grpc_query_get_pairing.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/lavanet/lava/utils"
"github.com/lavanet/lava/x/pairing/types"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down Expand Up @@ -41,7 +42,9 @@ func (k Keeper) GetPairing(goCtx context.Context, req *types.QueryGetPairingRequ
// Calculate the time left until the new epoch (when epoch changes, new pairing is generated)
timeLeftToNextPairing, err := k.calculateNextEpochTime(ctx)
if err != nil {
return nil, fmt.Errorf("could not calculate time to next pairing, err: %s", err)
// we don't want to fail the query if the calculateNextEpochTime function fails. This shouldn't happen, it's a fail-safe
utils.LavaFormatError("calculate next epoch time failed. Returning default time=0", err, nil)
timeLeftToNextPairing = 0
}

// Get current epoch start block
Expand Down

0 comments on commit 75b9076

Please sign in to comment.