forked from TrueCloudLab/frostfs-node
f2562e8c47
Processors that use `invoke` package to make chain invocation should provide fee config and client with enabled or disabled notary support. If notary support is disabled, then functions from `invoke` package will perform ordinary method invocation with extra fee. Processors that use `morph/client` wrappers should check `notaryDisabled` flag to call corresponding wrapper function. Netmap processor omits some actions during validator syncronization if notary is disabled. Signed-off-by: Alex Vanin <alexey@nspcc.ru>
27 lines
786 B
Go
27 lines
786 B
Go
package balance
|
|
|
|
import (
|
|
"github.com/nspcc-dev/neofs-node/pkg/innerring/invoke"
|
|
balanceEvent "github.com/nspcc-dev/neofs-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
|
|
}
|
|
|
|
err := invoke.CashOutCheque(bp.mainnetClient, bp.neofsContract, bp.feeProvider,
|
|
&invoke.ChequeParams{
|
|
ID: lock.ID(),
|
|
Amount: bp.converter.ToFixed8(lock.Amount()),
|
|
User: lock.User(),
|
|
LockAccount: lock.LockAccount(),
|
|
})
|
|
if err != nil {
|
|
bp.log.Error("can't send lock asset tx", zap.Error(err))
|
|
}
|
|
}
|