From 7f8ccc105bb85c4889f66655c2552caeeef89a17 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 24 Oct 2023 12:47:46 +0300 Subject: [PATCH] [#750] adm: Drop deprecated GetNetwork() Signed-off-by: Evgenii Stratonikov --- .../internal/modules/morph/initialize_transfer.go | 3 ++- cmd/frostfs-adm/internal/modules/morph/local_client.go | 5 ----- cmd/frostfs-adm/internal/modules/morph/n3client.go | 2 -- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/cmd/frostfs-adm/internal/modules/morph/initialize_transfer.go b/cmd/frostfs-adm/internal/modules/morph/initialize_transfer.go index 1f8e53416..b032780be 100644 --- a/cmd/frostfs-adm/internal/modules/morph/initialize_transfer.go +++ b/cmd/frostfs-adm/internal/modules/morph/initialize_transfer.go @@ -93,12 +93,13 @@ func (c *initializeContext) multiSignAndSend(tx *transaction.Transaction, accTyp } func (c *initializeContext) multiSign(tx *transaction.Transaction, accType string) error { - network, err := c.Client.GetNetwork() + version, err := c.Client.GetVersion() if err != nil { // error appears only if client // has not been initialized panic(err) } + network := version.Protocol.Network // Use parameter context to avoid dealing with signature order. pc := scContext.NewParameterContext("", network, tx) diff --git a/cmd/frostfs-adm/internal/modules/morph/local_client.go b/cmd/frostfs-adm/internal/modules/morph/local_client.go index 0367f7479..84cf40e97 100644 --- a/cmd/frostfs-adm/internal/modules/morph/local_client.go +++ b/cmd/frostfs-adm/internal/modules/morph/local_client.go @@ -10,7 +10,6 @@ import ( "github.com/google/uuid" "github.com/nspcc-dev/neo-go/pkg/config" - "github.com/nspcc-dev/neo-go/pkg/config/netmode" "github.com/nspcc-dev/neo-go/pkg/core" "github.com/nspcc-dev/neo-go/pkg/core/block" "github.com/nspcc-dev/neo-go/pkg/core/chaindump" @@ -138,10 +137,6 @@ func (l *localClient) GetNativeContracts() ([]state.NativeContract, error) { return l.bc.GetNatives(), nil } -func (l *localClient) GetNetwork() (netmode.Magic, error) { - return l.bc.GetConfig().Magic, nil -} - func (l *localClient) GetApplicationLog(h util.Uint256, t *trigger.Type) (*result.ApplicationLog, error) { aer, err := l.bc.GetAppExecResults(h, *t) if err != nil { diff --git a/cmd/frostfs-adm/internal/modules/morph/n3client.go b/cmd/frostfs-adm/internal/modules/morph/n3client.go index 138943b6e..77f207c9f 100644 --- a/cmd/frostfs-adm/internal/modules/morph/n3client.go +++ b/cmd/frostfs-adm/internal/modules/morph/n3client.go @@ -6,7 +6,6 @@ import ( "fmt" "time" - "github.com/nspcc-dev/neo-go/pkg/config/netmode" "github.com/nspcc-dev/neo-go/pkg/core/state" "github.com/nspcc-dev/neo-go/pkg/core/transaction" "github.com/nspcc-dev/neo-go/pkg/crypto/keys" @@ -32,7 +31,6 @@ type Client interface { GetContractStateByID(int32) (*state.Contract, error) GetContractStateByHash(util.Uint160) (*state.Contract, error) GetNativeContracts() ([]state.NativeContract, error) - GetNetwork() (netmode.Magic, error) GetApplicationLog(util.Uint256, *trigger.Type) (*result.ApplicationLog, error) GetVersion() (*result.Version, error) CreateTxFromScript([]byte, *wallet.Account, int64, int64, []rpcclient.SignerAccount) (*transaction.Transaction, error)