[#452] Use API structures for reputation PeerID and GlobalTrust

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-04-05 12:29:33 +03:00 committed by Alex Vanin
parent 7cf48d4d91
commit 27cf6f5112
6 changed files with 116 additions and 36 deletions

View file

@ -10,16 +10,18 @@ import (
func (rp *Processor) handlePutReputation(ev event.Event) {
put := ev.(reputationEvent.Put)
peerID := put.PeerID()
rp.log.Info("notification",
zap.String("type", "reputation put"),
zap.String("peer_id", hex.EncodeToString(put.PeerID().Bytes())))
zap.String("peer_id", hex.EncodeToString(peerID.ToV2().GetValue())))
// send event to the worker pool
err := rp.pool.Submit(func() {
rp.processPut(
put.Epoch(),
put.PeerID(),
peerID,
put.Value(),
)
})