From 730849a1cdc9ddd8523ea4dedbad6898e9faf5b4 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Mon, 5 Dec 2022 17:19:32 +0300 Subject: [PATCH] config: move common part of notary/state into InternalService --- pkg/config/internal_service.go | 8 ++++++++ pkg/config/notary_config.go | 5 +---- pkg/config/state_root.go | 5 +---- 3 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 pkg/config/internal_service.go diff --git a/pkg/config/internal_service.go b/pkg/config/internal_service.go new file mode 100644 index 000000000..c8c49f11b --- /dev/null +++ b/pkg/config/internal_service.go @@ -0,0 +1,8 @@ +package config + +// InternalService stores configuration for internal services that don't have +// any network configuration, but use a wallet and can be enabled/disabled. +type InternalService struct { + Enabled bool `yaml:"Enabled"` + UnlockWallet Wallet `yaml:"UnlockWallet"` +} diff --git a/pkg/config/notary_config.go b/pkg/config/notary_config.go index 791ed8f86..df4e51187 100644 --- a/pkg/config/notary_config.go +++ b/pkg/config/notary_config.go @@ -1,7 +1,4 @@ package config // P2PNotary stores configuration for Notary node service. -type P2PNotary struct { - Enabled bool `yaml:"Enabled"` - UnlockWallet Wallet `yaml:"UnlockWallet"` -} +type P2PNotary InternalService diff --git a/pkg/config/state_root.go b/pkg/config/state_root.go index 904c104fb..dd44f264d 100644 --- a/pkg/config/state_root.go +++ b/pkg/config/state_root.go @@ -1,7 +1,4 @@ package config // StateRoot contains state root service configuration. -type StateRoot struct { - Enabled bool `yaml:"Enabled"` - UnlockWallet Wallet `yaml:"UnlockWallet"` -} +type StateRoot InternalService