From 7eaf159a8be1a24eee1aba82625e9fde3208debe Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Tue, 21 Feb 2023 16:17:41 +0300 Subject: [PATCH] [#63] adm: Fix contract wallet creation Create contract wallet only by init and update-config command. Close #63 Signed-off-by: Dmitrii Stepanov --- CHANGELOG.md | 1 + cmd/frostfs-adm/internal/modules/morph/initialize.go | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d41676ac9..7544f3249 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ Changelog for FrostFS Node - `neo-go` client deadlock on subscription restoration (#2244) - Possible panic during write-cache initialization (#2234) - Do not fetch an object if `meta` is missing it (#61) +- Create contract wallet only by `init` and `update-config` command (#63) ### Removed ### Updated diff --git a/cmd/frostfs-adm/internal/modules/morph/initialize.go b/cmd/frostfs-adm/internal/modules/morph/initialize.go index 2c742d82d..dc4208c03 100644 --- a/cmd/frostfs-adm/internal/modules/morph/initialize.go +++ b/cmd/frostfs-adm/internal/modules/morph/initialize.go @@ -115,8 +115,10 @@ func newInitializeContext(cmd *cobra.Command, v *viper.Viper) (*initializeContex return nil, err } + needContracts := cmd.Name() == "update-contracts" || cmd.Name() == "init" + var w *wallet.Wallet - if cmd.Name() != "deploy" { + if needContracts { w, err = openContractWallet(v, cmd, walletDir) if err != nil { return nil, err @@ -157,7 +159,6 @@ func newInitializeContext(cmd *cobra.Command, v *viper.Viper) (*initializeContex } } - needContracts := cmd.Name() == "update-contracts" || cmd.Name() == "init" if needContracts { ctrPath, err = cmd.Flags().GetString(contractsInitFlag) if err != nil {