diff --git a/cmd/neofs-adm/internal/modules/morph/initialize.go b/cmd/neofs-adm/internal/modules/morph/initialize.go index cbf98a630..6f2912280 100644 --- a/cmd/neofs-adm/internal/modules/morph/initialize.go +++ b/cmd/neofs-adm/internal/modules/morph/initialize.go @@ -7,6 +7,7 @@ import ( "path" "time" + "github.com/nspcc-dev/neo-go/pkg/core/native/nativenames" "github.com/nspcc-dev/neo-go/pkg/core/transaction" "github.com/nspcc-dev/neo-go/pkg/crypto/keys" "github.com/nspcc-dev/neo-go/pkg/rpc/client" @@ -133,10 +134,17 @@ func newInitializeContext(cmd *cobra.Command, v *viper.Viper) (*initializeContex return nil, fmt.Errorf("can't get native contract hashes: %w", err) } + notaryEnabled := false nativeHashes := make(map[string]util.Uint160, len(ns)) for i := range ns { + if ns[i].Manifest.Name == nativenames.Notary { + notaryEnabled = len(ns[i].UpdateHistory) > 0 + } nativeHashes[ns[i].Manifest.Name] = ns[i].Hash } + if !notaryEnabled { + return nil, errors.New("notary contract must be enabled") + } accounts := make([]*wallet.Account, len(wallets)) for i, w := range wallets {