2020-09-08 09:01:38 +00:00
|
|
|
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) {
|
2021-03-23 15:20:44 +00:00
|
|
|
if !np.alphabetState.IsAlphabet() {
|
|
|
|
np.log.Info("non alphabet mode, ignore config")
|
2020-09-08 09:01:38 +00:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-04-29 13:40:34 +00:00
|
|
|
err := invoke.SetConfig(np.morphClient, np.netmapContract, np.feeProvider,
|
2020-09-08 09:01:38 +00:00
|
|
|
&invoke.SetConfigArgs{
|
2020-11-05 13:41:44 +00:00
|
|
|
ID: config.ID(),
|
2020-09-08 09:01:38 +00:00
|
|
|
Key: config.Key(),
|
|
|
|
Value: config.Value(),
|
|
|
|
},
|
|
|
|
)
|
|
|
|
if err != nil {
|
|
|
|
np.log.Error("can't relay set config event", zap.Error(err))
|
|
|
|
}
|
|
|
|
}
|