Skip to content

Commit

Permalink
change some error messages to info
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Bowman committed Feb 13, 2024
1 parent ed81656 commit 3f9e3f3
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions x/interchainstaking/keeper/callbacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ func SigningInfoCallback(k *Keeper, ctx sdk.Context, args []byte, query icqtypes
return fmt.Errorf("can not get validator address from consensus address: %s", valSigningInfo.Address)
}

k.Logger(ctx).Error("Tombstoned validator found", "valoper", valAddr)
k.Logger(ctx).Info("tombstoned validator found", "valoper", valAddr)

valAddrBytes, err := addressutils.ValAddressFromBech32(valAddr, zone.GetValoperPrefix())
if err != nil {
Expand Down Expand Up @@ -718,22 +718,22 @@ func AllBalancesCallback(k *Keeper, ctx sdk.Context, args []byte, query icqtypes
case zone.DepositAddress != nil && balanceQuery.Address == zone.DepositAddress.Address:
if zone.DepositAddress.BalanceWaitgroup != 0 {
zone.DepositAddress.BalanceWaitgroup = 0
k.Logger(ctx).Error("Zeroing deposit balance waitgroup")
k.Logger(ctx).Info("zeroing deposit balance waitgroup")
}
case zone.WithdrawalAddress != nil && balanceQuery.Address == zone.WithdrawalAddress.Address:
if zone.WithdrawalAddress.BalanceWaitgroup != 0 {
zone.WithdrawalAddress.BalanceWaitgroup = 0
k.Logger(ctx).Error("Zeroing withdrawal balance waitgroup")
k.Logger(ctx).Info("zeroing withdrawal balance waitgroup")

Check warning on line 726 in x/interchainstaking/keeper/callbacks.go

View check run for this annotation

Codecov / codecov/patch

x/interchainstaking/keeper/callbacks.go#L726

Added line #L726 was not covered by tests
}
case zone.DelegationAddress != nil && balanceQuery.Address == zone.DelegationAddress.Address:
if zone.DelegationAddress.BalanceWaitgroup != 0 {
zone.DelegationAddress.BalanceWaitgroup = 0
k.Logger(ctx).Error("Zeroing delegation balance waitgroup")
k.Logger(ctx).Info("zeroing delegation balance waitgroup")

Check warning on line 731 in x/interchainstaking/keeper/callbacks.go

View check run for this annotation

Codecov / codecov/patch

x/interchainstaking/keeper/callbacks.go#L731

Added line #L731 was not covered by tests
}
case zone.PerformanceAddress != nil && balanceQuery.Address == zone.PerformanceAddress.Address:
if zone.PerformanceAddress.BalanceWaitgroup != 0 {
zone.PerformanceAddress.BalanceWaitgroup = 0
k.Logger(ctx).Error("Zeroing performance balance waitgroup")
k.Logger(ctx).Info("zeroing performance balance waitgroup")

Check warning on line 736 in x/interchainstaking/keeper/callbacks.go

View check run for this annotation

Codecov / codecov/patch

x/interchainstaking/keeper/callbacks.go#L736

Added line #L736 was not covered by tests
}
}
k.SetZone(ctx, &zone)
Expand Down
8 changes: 4 additions & 4 deletions x/interchainstaking/keeper/delegation.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,18 +318,18 @@ func (k *Keeper) FlushOutstandingDelegations(ctx sdk.Context, zone *types.Zone,
exclusionTime := ctx.BlockTime().AddDate(0, 0, -1)
k.IterateZoneReceipts(ctx, zone.ChainId, func(_ int64, receiptInfo types.Receipt) (stop bool) {
if (receiptInfo.FirstSeen.After(exclusionTime) || receiptInfo.FirstSeen.Equal(exclusionTime)) && receiptInfo.Completed == nil && receiptInfo.Amount[0].Denom == delAddrBalance.Denom {
k.Logger(ctx).Error("adding to pending amount", "pending receipt", receiptInfo)
k.Logger(ctx).Info("adding to pending amount", "pending receipt", receiptInfo)
pendingAmount = pendingAmount.Add(receiptInfo.Amount...)
}
return false
})

coinsToFlush, hasNeg := sdk.NewCoins(delAddrBalance).SafeSub(pendingAmount...)
if hasNeg || coinsToFlush.IsZero() {
k.Logger(ctx).Error("delegate account balance negative, or nothing to flush, setting outdated receipts")
k.Logger(ctx).Info("delegate account balance negative, or nothing to flush, setting outdated receipts")
k.SetReceiptsCompleted(ctx, zone.ChainId, exclusionTime, ctx.BlockTime(), delAddrBalance.Denom)
if zone.GetWithdrawalWaitgroup() == 0 {
k.Logger(ctx).Info("Triggering redemption rate calc in lieu of delegation flush")
k.Logger(ctx).Info("triggering redemption rate calc in lieu of delegation flush")
if err := k.TriggerRedemptionRate(ctx, zone); err != nil {
return err

Check warning on line 334 in x/interchainstaking/keeper/delegation.go

View check run for this annotation

Codecov / codecov/patch

x/interchainstaking/keeper/delegation.go#L332-L334

Added lines #L332 - L334 were not covered by tests
}
Expand All @@ -338,7 +338,7 @@ func (k *Keeper) FlushOutstandingDelegations(ctx sdk.Context, zone *types.Zone,
}

// set the zone amount to the coins to be flushed.
k.Logger(ctx).Error("flush delegations ", "total", coinsToFlush)
k.Logger(ctx).Info("flush delegations ", "total", coinsToFlush)

sendMsg := banktypes.MsgSend{
FromAddress: "",
Expand Down
12 changes: 6 additions & 6 deletions x/interchainstaking/keeper/ibc_packet_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (k *Keeper) HandleAcknowledgement(ctx sdk.Context, packet channeltypes.Pack
if !ok {
return errors.New("unable to unmarshal MsgWithdrawDelegatorReward")
}
k.Logger(ctx).Error("Failed to withdraw rewards; will try again next epoch", "validator", withdrawalMsg.ValidatorAddress)
k.Logger(ctx).Error("failed to withdraw rewards; will try again next epoch", "validator", withdrawalMsg.ValidatorAddress)

Check warning on line 133 in x/interchainstaking/keeper/ibc_packet_handlers.go

View check run for this annotation

Codecov / codecov/patch

x/interchainstaking/keeper/ibc_packet_handlers.go#L133

Added line #L133 was not covered by tests
return nil
}
k.Logger(ctx).Info("Rewards withdrawn")
Expand Down Expand Up @@ -672,7 +672,7 @@ func (k *Keeper) HandleFailedBeginRedelegate(ctx sdk.Context, msg sdk.Msg, memo
return err
}

k.Logger(ctx).Error("Received MsgBeginRedelegate acknowledgement error")
k.Logger(ctx).Error("received MsgBeginRedelegate acknowledgement error")
// first, type assertion. we should have stakingtypes.MsgBeginRedelegate
redelegateMsg, ok := msg.(*stakingtypes.MsgBeginRedelegate)
if !ok {
Expand All @@ -683,7 +683,7 @@ func (k *Keeper) HandleFailedBeginRedelegate(ctx sdk.Context, msg sdk.Msg, memo
return fmt.Errorf("zone for delegate account %s not found", redelegateMsg.DelegatorAddress)
}
k.DeleteRedelegationRecord(ctx, zone.ChainId, redelegateMsg.ValidatorSrcAddress, redelegateMsg.ValidatorDstAddress, epochNumber)
k.Logger(ctx).Error("Cleaning up redelegation record")
k.Logger(ctx).Info("cleaning up redelegation record")
return nil
}

Expand Down Expand Up @@ -820,7 +820,7 @@ func (k *Keeper) HandleFailedUndelegate(ctx sdk.Context, msg sdk.Msg, memo strin
return err
}

k.Logger(ctx).Error("Received MsgUndelegate acknowledgement error")
k.Logger(ctx).Error("received MsgUndelegate acknowledgement error")
// first, type assertion. we should have stakingtypes.MsgBeginRedelegate
undelegateMsg, ok := msg.(*stakingtypes.MsgUndelegate)
if !ok {
Expand Down Expand Up @@ -889,7 +889,7 @@ func (k *Keeper) HandleFailedUndelegate(ctx sdk.Context, msg sdk.Msg, memo strin
}

k.DeleteUnbondingRecord(ctx, zone.ChainId, undelegateMsg.ValidatorAddress, epochNumber)
k.Logger(ctx).Error("Cleaning up redelegation record")
k.Logger(ctx).Info("cleaning up unbonding record")
return nil
}

Expand Down Expand Up @@ -997,7 +997,7 @@ func (k *Keeper) HandleDelegate(ctx sdk.Context, msg sdk.Msg, memo string) error
switch {
case memo == "rewards":
case strings.HasPrefix(memo, "batch"):
k.Logger(ctx).Error("batch delegation", "memo", memo, "tx", delegateMsg)
k.Logger(ctx).Info("batch delegation", "memo", memo, "tx", delegateMsg)
exclusionTimestampUnix, err := strconv.ParseInt(strings.Split(memo, "/")[1], 10, 64)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion x/interchainstaking/keeper/intent.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func (k *Keeper) UpdateDelegatorIntent(ctx sdk.Context, delegator sdk.AccAddress
// grab offchain asset value, and raise the users' base value by this amount.
k.ClaimsManagerKeeper.IterateLastEpochUserClaims(ctx, zone.ChainId, delegator.String(), func(index int64, claim prtypes.Claim) (stop bool) {
claimAmt = claimAmt.Add(sdkmath.NewIntFromUint64(claim.Amount))
k.Logger(ctx).Error("Update intents - found claim for user", "user", delIntent.Delegator, "claim amount", claim.Amount, "new balance", claimAmt)
k.Logger(ctx).Info("Update intents - found claim for user", "user", delIntent.Delegator, "claim amount", claim.Amount, "new balance", claimAmt)

Check warning on line 206 in x/interchainstaking/keeper/intent.go

View check run for this annotation

Codecov / codecov/patch

x/interchainstaking/keeper/intent.go#L206

Added line #L206 was not covered by tests
return false
})

Expand Down
2 changes: 1 addition & 1 deletion x/interchainstaking/keeper/withdrawal_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (k *Keeper) GetNextWithdrawalRecordSequence(ctx sdk.Context) (sequence uint

func (k *Keeper) AddWithdrawalRecord(ctx sdk.Context, chainID, delegator string, distributions []*types.Distribution, recipient string, burnAmount sdk.Coin, hash string, status int32, completionTime time.Time, epochNumber int64) {
record := types.WithdrawalRecord{ChainId: chainID, Delegator: delegator, Distribution: distributions, Recipient: recipient, Status: status, BurnAmount: burnAmount, Txhash: hash, CompletionTime: completionTime, EpochNumber: epochNumber}
k.Logger(ctx).Error("addWithdrawalRecord", "record", record)
k.Logger(ctx).Info("addWithdrawalRecord", "record", record)
k.SetWithdrawalRecord(ctx, record)
}

Expand Down

0 comments on commit 3f9e3f3

Please sign in to comment.