[#21] ir: Remove excess todo

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
support/v0.27
Alex Vanin 2020-09-08 12:09:08 +03:00
parent 4aee3de24e
commit f23d8a5f4a
7 changed files with 28 additions and 28 deletions

View File

@ -89,6 +89,6 @@ func LockAsset(cli *client.Client, con util.Uint160, p *LockParams) error {
p.User.BytesBE(),
p.LockAccount.BytesBE(),
p.Amount,
int64(p.Until), // fixme: invoke can work only with int64 values
int64(p.Until),
)
}

View File

@ -9,7 +9,7 @@ import (
)
func (bp *Processor) handleLock(ev event.Event) {
lock := ev.(balanceEvent.Lock) // todo: check panic in production
lock := ev.(balanceEvent.Lock)
bp.log.Info("notification",
zap.String("type", "lock"),
zap.String("value", hex.EncodeToString(lock.ID())))
@ -18,7 +18,7 @@ func (bp *Processor) handleLock(ev event.Event) {
err := bp.pool.Submit(func() { bp.processLock(&lock) })
if err != nil {
// todo: move into controlled degradation stage
// there system can be moved into controlled degradation stage
bp.log.Warn("balance worker pool drained",
zap.Int("capacity", bp.pool.Cap()))
}

View File

@ -17,7 +17,7 @@ func (bp *Processor) processLock(lock *balanceEvent.Lock) {
err := invoke.CashOutCheque(bp.mainnetClient, bp.neofsContract,
&invoke.ChequeParams{
ID: lock.ID(),
Amount: lock.Amount() / 1_0000_0000, // todo: Fixed16 to Fixed8
Amount: lock.Amount() / 1_0000_0000, // Fixed16 to Fixed8
User: lock.User(),
LockAccount: lock.LockAccount(),
})

View File

@ -10,7 +10,7 @@ import (
)
func (cp *Processor) handlePut(ev event.Event) {
put := ev.(containerEvent.Put) // todo: check panic in production
put := ev.(containerEvent.Put)
id := sha256.Sum256(put.Container())
cp.log.Info("notification",
@ -21,14 +21,14 @@ func (cp *Processor) handlePut(ev event.Event) {
err := cp.pool.Submit(func() { cp.processContainerPut(&put) })
if err != nil {
// todo: move into controlled degradation stage
// there system can be moved into controlled degradation stage
cp.log.Warn("container processor worker pool drained",
zap.Int("capacity", cp.pool.Cap()))
}
}
func (cp *Processor) handleDelete(ev event.Event) {
del := ev.(containerEvent.Delete) // todo: check panic in production
del := ev.(containerEvent.Delete)
cp.log.Info("notification",
zap.String("type", "container delete"),
zap.String("id", base58.Encode(del.ContainerID())))
@ -37,7 +37,7 @@ func (cp *Processor) handleDelete(ev event.Event) {
err := cp.pool.Submit(func() { cp.processContainerDelete(&del) })
if err != nil {
// todo: move into controlled degradation stage
// there system can be moved into controlled degradation stage
cp.log.Warn("container processor worker pool drained",
zap.Int("capacity", cp.pool.Cap()))
}

View File

@ -9,7 +9,7 @@ import (
)
func (np *Processor) handleDeposit(ev event.Event) {
deposit := ev.(neofsEvent.Deposit) // todo: check panic in production
deposit := ev.(neofsEvent.Deposit)
np.log.Info("notification",
zap.String("type", "deposit"),
zap.String("id", hex.EncodeToString(deposit.ID())))
@ -18,14 +18,14 @@ func (np *Processor) handleDeposit(ev event.Event) {
err := np.pool.Submit(func() { np.processDeposit(&deposit) })
if err != nil {
// todo: move into controlled degradation stage
// there system can be moved into controlled degradation stage
np.log.Warn("neofs processor worker pool drained",
zap.Int("capacity", np.pool.Cap()))
}
}
func (np *Processor) handleWithdraw(ev event.Event) {
withdraw := ev.(neofsEvent.Withdraw) // todo: check panic in production
withdraw := ev.(neofsEvent.Withdraw)
np.log.Info("notification",
zap.String("type", "withdraw"),
zap.String("id", hex.EncodeToString(withdraw.ID())))
@ -34,14 +34,14 @@ func (np *Processor) handleWithdraw(ev event.Event) {
err := np.pool.Submit(func() { np.processWithdraw(&withdraw) })
if err != nil {
// todo: move into controlled degradation stage
// there system can be moved into controlled degradation stage
np.log.Warn("neofs processor worker pool drained",
zap.Int("capacity", np.pool.Cap()))
}
}
func (np *Processor) handleCheque(ev event.Event) {
cheque := ev.(neofsEvent.Cheque) // todo: check panic in production
cheque := ev.(neofsEvent.Cheque)
np.log.Info("notification",
zap.String("type", "cheque"),
zap.String("id", hex.EncodeToString(cheque.ID())))
@ -50,14 +50,14 @@ func (np *Processor) handleCheque(ev event.Event) {
err := np.pool.Submit(func() { np.processCheque(&cheque) })
if err != nil {
// todo: move into controlled degradation stage
// there system can be moved into controlled degradation stage
np.log.Warn("neofs processor worker pool drained",
zap.Int("capacity", np.pool.Cap()))
}
}
func (np *Processor) handleConfig(ev event.Event) {
cfg := ev.(neofsEvent.Config) // todo: check panic in production
cfg := ev.(neofsEvent.Config)
np.log.Info("notification",
zap.String("type", "set config"),
zap.String("key", hex.EncodeToString(cfg.Key())),
@ -67,14 +67,14 @@ func (np *Processor) handleConfig(ev event.Event) {
err := np.pool.Submit(func() { np.processConfig(&cfg) })
if err != nil {
// todo: move into controlled degradation stage
// there system can be moved into controlled degradation stage
np.log.Warn("neofs processor worker pool drained",
zap.Int("capacity", np.pool.Cap()))
}
}
func (np *Processor) handleUpdateInnerRing(ev event.Event) {
updIR := ev.(neofsEvent.UpdateInnerRing) // todo: check panic in production
updIR := ev.(neofsEvent.UpdateInnerRing)
np.log.Info("notification",
zap.String("type", "update inner ring"),
)
@ -83,7 +83,7 @@ func (np *Processor) handleUpdateInnerRing(ev event.Event) {
err := np.pool.Submit(func() { np.processUpdateInnerRing(&updIR) })
if err != nil {
// todo: move into controlled degradation stage
// there system can be moved into controlled degradation stage
np.log.Warn("neofs processor worker pool drained",
zap.Int("capacity", np.pool.Cap()))
}

View File

@ -55,7 +55,7 @@ func (np *Processor) processWithdraw(withdraw *neofsEvent.Withdraw) {
}
// create lock account
// todo: check collision there, consider reversed script hash
// fixme: check collision there, consider reversed script hash
lock, err := util.Uint160DecodeBytesBE(withdraw.ID()[:util.Uint160Size])
if err != nil {
np.log.Error("can't create lock account", zap.Error(err))
@ -69,7 +69,7 @@ func (np *Processor) processWithdraw(withdraw *neofsEvent.Withdraw) {
ID: withdraw.ID(),
User: withdraw.User(),
LockAccount: lock,
Amount: withdraw.Amount() * 1_0000_0000, // todo: from Fixed8 to Fixed16
Amount: withdraw.Amount() * 1_0000_0000, // from Fixed8 to Fixed16
Until: curEpoch + lockAccountLifetime,
})
if err != nil {

View File

@ -10,21 +10,21 @@ import (
)
func (np *Processor) handleNewEpochTick(ev event.Event) {
_ = ev.(timerEvent.NewEpochTick) // todo: check panic in production
_ = ev.(timerEvent.NewEpochTick)
np.log.Info("tick", zap.String("type", "epoch"))
// send event to the worker pool
err := np.pool.Submit(func() { np.processNewEpochTick() })
if err != nil {
// todo: move into controlled degradation stage
// there system can be moved into controlled degradation stage
np.log.Warn("netmap worker pool drained",
zap.Int("capacity", np.pool.Cap()))
}
}
func (np *Processor) handleNewEpoch(ev event.Event) {
epochEvent := ev.(netmapEvent.NewEpoch) // todo: check panic in production
epochEvent := ev.(netmapEvent.NewEpoch)
np.log.Info("notification",
zap.String("type", "new epoch"),
zap.Uint64("value", epochEvent.EpochNumber()))
@ -35,14 +35,14 @@ func (np *Processor) handleNewEpoch(ev event.Event) {
np.processNewEpoch(epochEvent.EpochNumber())
})
if err != nil {
// todo: move into controlled degradation stage
// there system can be moved into controlled degradation stage
np.log.Warn("netmap worker pool drained",
zap.Int("capacity", np.pool.Cap()))
}
}
func (np *Processor) handleAddPeer(ev event.Event) {
newPeer := ev.(netmapEvent.AddPeer) // todo: check panic in production
newPeer := ev.(netmapEvent.AddPeer)
np.log.Info("notification",
zap.String("type", "add peer"),
@ -54,14 +54,14 @@ func (np *Processor) handleAddPeer(ev event.Event) {
np.processAddPeer(newPeer.Node())
})
if err != nil {
// todo: move into controlled degradation stage
// there system can be moved into controlled degradation stage
np.log.Warn("netmap worker pool drained",
zap.Int("capacity", np.pool.Cap()))
}
}
func (np *Processor) handleUpdateState(ev event.Event) {
updPeer := ev.(netmapEvent.UpdatePeer) // todo: check panic in production
updPeer := ev.(netmapEvent.UpdatePeer)
np.log.Info("notification",
zap.String("type", "update peer state"),
zap.String("key", hex.EncodeToString(updPeer.PublicKey().Bytes())))
@ -72,7 +72,7 @@ func (np *Processor) handleUpdateState(ev event.Event) {
np.processUpdatePeer(updPeer)
})
if err != nil {
// todo: move into controlled degradation stage
// there system can be moved into controlled degradation stage
np.log.Warn("netmap worker pool drained",
zap.Int("capacity", np.pool.Cap()))
}