Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Yarom Swisa authored and Yarom Swisa committed Sep 21, 2023
1 parent 4bb3ed8 commit af788f7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions testutil/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

btcSecp256k1 "github.com/btcsuite/btcd/btcec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/lavanet/lava/testutil/keeper"
testkeeper "github.com/lavanet/lava/testutil/keeper"
"github.com/lavanet/lava/utils/sigs"
conflicttypes "github.com/lavanet/lava/x/conflict/types"
Expand All @@ -24,8 +23,8 @@ type Account struct {
}

func CreateNewAccount(ctx context.Context, keepers testkeeper.Keepers, balance int64) (acc Account) {
acc.SK, acc.Addr = sigs.GenerateDeterministicFloatingKey(keeper.Randomizer)
keeper.Randomizer.Inc()
acc.SK, acc.Addr = sigs.GenerateDeterministicFloatingKey(testkeeper.Randomizer)
testkeeper.Randomizer.Inc()
coins := sdk.NewCoins(sdk.NewCoin(epochstoragetypes.TokenDenom, sdk.NewInt(balance)))
keepers.BankKeeper.SetBalance(sdk.UnwrapSDKContext(ctx), acc.Addr, coins)
return
Expand Down
2 changes: 1 addition & 1 deletion utils/sigs/sigs.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func NewZeroReader(seed int64) *ZeroReader {
func (z ZeroReader) Read(p []byte) (n int, err error) {
// fool the non determinism mechanism of crypto
if len(p) == 1 {
p[0] = byte(z.Seed)
p[0] = z.Seed
return len(p), nil
}
return z.rand.Read(p)
Expand Down
2 changes: 1 addition & 1 deletion x/epochstorage/keeper/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func (k Keeper) GetNextEpoch(ctx sdk.Context, block uint64) (nextEpoch uint64, e
func (k Keeper) GetPreviousEpochStartForBlock(ctx sdk.Context, block uint64) (previousEpochStart uint64, erro error) {
epochStart, _, err := k.GetEpochStartForBlock(ctx, block)
if epochStart <= 0 {
return 0, utils.LavaFormatError("GetPreviousEpochStartForBlock", fmt.Errorf("GetPreviousEpochStartForBlock tried to fetch epoch beyond zero"))
return 0, fmt.Errorf("GetPreviousEpochStartForBlock tried to fetch epoch beyond zero")
}
previousEpochStart, _, err2 := k.GetEpochStartForBlock(ctx, epochStart-1) // we take one block before the target epoch so it belongs to the previous epoch
if err != nil {
Expand Down

0 comments on commit af788f7

Please sign in to comment.