frostfs-node/pkg/innerring/processors/neofs/process_config.go
Alex Vanin f11ae1035d [#21] ir: Add config relay processor
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-10-02 11:25:35 +03:00

26 lines
643 B
Go

package neofs
import (
"github.com/nspcc-dev/neofs-node/pkg/innerring/invoke"
neofsEvent "github.com/nspcc-dev/neofs-node/pkg/morph/event/neofs"
"go.uber.org/zap"
)
// Process config event by setting configuration value from main chain in
// side chain.
func (np *Processor) processConfig(config *neofsEvent.Config) {
if !np.activeState.IsActive() {
np.log.Info("passive mode, ignore deposit")
return
}
err := invoke.SetConfig(np.morphClient, np.netmapContract,
&invoke.SetConfigArgs{
Key: config.Key(),
Value: config.Value(),
},
)
if err != nil {
np.log.Error("can't relay set config event", zap.Error(err))
}
}