[#326] ir: Add debug message about transfer for audit transaction

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-01-28 22:53:59 +03:00 committed by Alex Vanin
parent d4bd726c25
commit 819300f939

View file

@ -167,10 +167,14 @@ func (a auditSettlementDeps) ResolveKey(ni audit.NodeInfo) (*owner.ID, error) {
var transferAuditDetails = []byte("settlement-audit") var transferAuditDetails = []byte("settlement-audit")
func (a auditSettlementDeps) Transfer(sender, recipient *owner.ID, amount *big.Int) { func (a auditSettlementDeps) Transfer(sender, recipient *owner.ID, amount *big.Int) {
log := a.log.With(
zap.Stringer("sender", sender),
zap.Stringer("recipient", recipient),
zap.Stringer("amount (GASe-12)", amount),
)
if !amount.IsInt64() { if !amount.IsInt64() {
a.log.Error("amount can not be represented as an int64", a.log.Error("amount can not be represented as an int64")
zap.Stringer("value", amount),
)
return return
} }
@ -181,8 +185,12 @@ func (a auditSettlementDeps) Transfer(sender, recipient *owner.ID, amount *big.I
To: recipient, To: recipient,
Details: transferAuditDetails, Details: transferAuditDetails,
}); err != nil { }); err != nil {
a.log.Error("transfer of funds for audit failed", log.Error("could not send transfer transaction for audit",
zap.String("error", err.Error()), zap.String("error", err.Error()),
) )
return
} }
log.Debug("transfer transaction for audit was successfully sent")
} }