frostfs-node/pkg/innerring/processors/balance/process_assets.go
Alex Vanin 20de74a505 Rename package name
Due to source code relocation from GitHub.

Signed-off-by: Alex Vanin <a.vanin@yadro.com>
2023-03-07 16:38:26 +03:00

29 lines
809 B
Go

package balance
import (
frostfsContract "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client/frostfs"
balanceEvent "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/event/balance"
"go.uber.org/zap"
)
// Process lock event by invoking Cheque method in main net to send assets
// back to the withdraw issuer.
func (bp *Processor) processLock(lock *balanceEvent.Lock) {
if !bp.alphabetState.IsAlphabet() {
bp.log.Info("non alphabet mode, ignore balance lock")
return
}
prm := frostfsContract.ChequePrm{}
prm.SetID(lock.ID())
prm.SetUser(lock.User())
prm.SetAmount(bp.converter.ToFixed8(lock.Amount()))
prm.SetLock(lock.LockAccount())
prm.SetHash(lock.TxHash())
err := bp.frostfsClient.Cheque(prm)
if err != nil {
bp.log.Error("can't send lock asset tx", zap.Error(err))
}
}