mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-24 15:25:18 +00:00
fix: various errors from linter (#481)
This commit is contained in:
parent
03717ad0fa
commit
8f3858509a
@ -70,5 +70,4 @@ func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, k Keeper) {
|
|||||||
}
|
}
|
||||||
k.SetPreviousSavingsDistribution(ctx, ctx.BlockTime())
|
k.SetPreviousSavingsDistribution(ctx, ctx.BlockTime())
|
||||||
}
|
}
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
@ -334,7 +334,6 @@ func (k Keeper) SetDebtDenom(ctx sdk.Context, denom string) {
|
|||||||
}
|
}
|
||||||
store := prefix.NewStore(ctx.KVStore(k.key), types.DebtDenomKey)
|
store := prefix.NewStore(ctx.KVStore(k.key), types.DebtDenomKey)
|
||||||
store.Set([]byte{}, k.cdc.MustMarshalBinaryLengthPrefixed(denom))
|
store.Set([]byte{}, k.cdc.MustMarshalBinaryLengthPrefixed(denom))
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetGovDenom set the denom of the governance token in the system
|
// SetGovDenom set the denom of the governance token in the system
|
||||||
@ -344,7 +343,6 @@ func (k Keeper) SetGovDenom(ctx sdk.Context, denom string) {
|
|||||||
}
|
}
|
||||||
store := prefix.NewStore(ctx.KVStore(k.key), types.GovDenomKey)
|
store := prefix.NewStore(ctx.KVStore(k.key), types.GovDenomKey)
|
||||||
store.Set([]byte{}, k.cdc.MustMarshalBinaryLengthPrefixed(denom))
|
store.Set([]byte{}, k.cdc.MustMarshalBinaryLengthPrefixed(denom))
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ValidateCollateral validates that a collateral is valid for use in cdps
|
// ValidateCollateral validates that a collateral is valid for use in cdps
|
||||||
|
@ -200,7 +200,7 @@ func (k Keeper) calculatePayment(ctx sdk.Context, owed sdk.Coin, fees sdk.Coin,
|
|||||||
|
|
||||||
feePayment := sdk.NewCoin(payment.Denom, sdk.ZeroInt())
|
feePayment := sdk.NewCoin(payment.Denom, sdk.ZeroInt())
|
||||||
principalPayment := sdk.NewCoin(payment.Denom, sdk.ZeroInt())
|
principalPayment := sdk.NewCoin(payment.Denom, sdk.ZeroInt())
|
||||||
overpayment := sdk.NewCoin(payment.Denom, sdk.ZeroInt())
|
var overpayment sdk.Coin
|
||||||
if !payment.Amount.IsPositive() {
|
if !payment.Amount.IsPositive() {
|
||||||
return feePayment, principalPayment
|
return feePayment, principalPayment
|
||||||
}
|
}
|
||||||
|
@ -60,9 +60,6 @@ var (
|
|||||||
PreviousDistributionTimeKey = []byte{0x08}
|
PreviousDistributionTimeKey = []byte{0x08}
|
||||||
)
|
)
|
||||||
|
|
||||||
var lenPositiveDec = len(SortableDecBytes(sdk.OneDec()))
|
|
||||||
var lenNegativeDec = len(SortableDecBytes(sdk.OneDec().Neg()))
|
|
||||||
|
|
||||||
// GetCdpIDBytes returns the byte representation of the cdpID
|
// GetCdpIDBytes returns the byte representation of the cdpID
|
||||||
func GetCdpIDBytes(cdpID uint64) (cdpIDBz []byte) {
|
func GetCdpIDBytes(cdpID uint64) (cdpIDBz []byte) {
|
||||||
cdpIDBz = make([]byte, 8)
|
cdpIDBz = make([]byte, 8)
|
||||||
|
@ -79,8 +79,5 @@ func genRandomInflation(r *rand.Rand) sdk.Dec {
|
|||||||
func genRandomActive(r *rand.Rand) bool {
|
func genRandomActive(r *rand.Rand) bool {
|
||||||
threshold := 50
|
threshold := 50
|
||||||
value := simulation.RandIntBetween(r, 1, 100)
|
value := simulation.RandIntBetween(r, 1, 100)
|
||||||
if value > threshold {
|
return value > threshold
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
noOpMsg = simulation.NoOpMsg(types.ModuleName)
|
|
||||||
btcPrices = []sdk.Dec{}
|
btcPrices = []sdk.Dec{}
|
||||||
bnbPrices = []sdk.Dec{}
|
bnbPrices = []sdk.Dec{}
|
||||||
xrpPrices = []sdk.Dec{}
|
xrpPrices = []sdk.Dec{}
|
||||||
|
Loading…
Reference in New Issue
Block a user