Fix linter findings (#178)

* [linter] Fix unnecessary conversion (unconvert)

* [linter] Fix fmt.Sprintf can be replaced with faster strconv.FormatInt (perfsprint)

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
This commit is contained in:
Julian Strobl 2023-11-15 14:06:29 +01:00 committed by GitHub
parent 9662389446
commit 682796b3c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -106,7 +106,7 @@ func (k Keeper) GetDistributionForReissuedTokens(ctx sdk.Context, blockHeight in
var overallAmount uint64
for index, obj := range reissuances {
if (index == 0 && lastPoP == 0 && obj.BlockHeight == 0) || //corner case (beginning of he chain)
(int64(lastPoP) < int64(obj.BlockHeight) && int64(obj.BlockHeight) <= blockHeight) {
(lastPoP < obj.BlockHeight && obj.BlockHeight <= blockHeight) {
amount, err := getUint64FromTxString(ctx, obj.Rawtx)
if err == nil {
overallAmount = overallAmount + amount

View File

@ -22,7 +22,7 @@ func createNDistributionOrder(keeper *keeper.Keeper, ctx sdk.Context, n int) []t
items[i].DaoAddr = fmt.Sprintf("DAO%v", i)
items[i].DaoAmount = fmt.Sprintf("%v", float64(amount)*types.PercentageDao)
items[i].InvestorAddr = fmt.Sprintf("INVESTOR%v", i)
items[i].InvestorAmount = fmt.Sprintf("%v", int64(float64(amount)*types.PercentageInvestor))
items[i].InvestorAmount = strconv.FormatInt(int64(float64(amount)*types.PercentageInvestor), 10)
items[i].PopAddr = fmt.Sprintf("POP%v", i)
items[i].PopAmount = fmt.Sprintf("%v", float64(amount)*types.PercentagePop)
keeper.StoreDistributionOrder(ctx, items[i])