frostfs-node/pkg/innerring/processors/neofs/process_config.go
Alex Vanin f2562e8c47 [#486] innerring: Use fee provider and notary disabled flag in processors
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>
2021-05-05 12:45:16 +03:00

27 lines
690 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.alphabetState.IsAlphabet() {
np.log.Info("non alphabet mode, ignore config")
return
}
err := invoke.SetConfig(np.morphClient, np.netmapContract, np.feeProvider,
&invoke.SetConfigArgs{
ID: config.ID(),
Key: config.Key(),
Value: config.Value(),
},
)
if err != nil {
np.log.Error("can't relay set config event", zap.Error(err))
}
}