From 68a2f36636fea51aaf62e699811641525fdc1e2c Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Mon, 3 Apr 2023 16:30:05 +0300 Subject: [PATCH] [#203] morph: Mark depracated methods Skip staticcheck for depracated methods. Will be fixed soon. Signed-off-by: Dmitrii Stepanov --- cmd/frostfs-adm/internal/modules/morph/initialize_nns.go | 1 + cmd/frostfs-adm/internal/modules/morph/initialize_register.go | 1 + cmd/frostfs-adm/internal/modules/morph/initialize_test.go | 4 ++-- pkg/morph/client/notary.go | 4 ++++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/frostfs-adm/internal/modules/morph/initialize_nns.go b/cmd/frostfs-adm/internal/modules/morph/initialize_nns.go index b43c2da338..edb7d6de50 100644 --- a/cmd/frostfs-adm/internal/modules/morph/initialize_nns.go +++ b/cmd/frostfs-adm/internal/modules/morph/initialize_nns.go @@ -286,6 +286,7 @@ func parseNNSResolveResult(res stackitem.Item) (util.Uint160, error) { func nnsIsAvailable(c Client, nnsHash util.Uint160, name string) (bool, error) { switch ct := c.(type) { case *rpcclient.Client: + //lint:ignore SA1019 https://git.frostfs.info/TrueCloudLab/frostfs-node/issues/202 return ct.NNSIsAvailable(nnsHash, name) default: b, err := unwrap.Bool(invokeFunction(c, nnsHash, "isAvailable", []any{name}, nil)) diff --git a/cmd/frostfs-adm/internal/modules/morph/initialize_register.go b/cmd/frostfs-adm/internal/modules/morph/initialize_register.go index 1bfda7b540..27e1590cfd 100644 --- a/cmd/frostfs-adm/internal/modules/morph/initialize_register.go +++ b/cmd/frostfs-adm/internal/modules/morph/initialize_register.go @@ -118,6 +118,7 @@ var errGetPriceInvalid = errors.New("`getRegisterPrice`: invalid response") func (c *initializeContext) getCandidateRegisterPrice() (int64, error) { switch ct := c.Client.(type) { case *rpcclient.Client: + //lint:ignore SA1019 https://git.frostfs.info/TrueCloudLab/frostfs-node/issues/202 return ct.GetCandidateRegisterPrice() default: neoHash := neo.Hash diff --git a/cmd/frostfs-adm/internal/modules/morph/initialize_test.go b/cmd/frostfs-adm/internal/modules/morph/initialize_test.go index 3c6adfc3c8..39a35b12e8 100644 --- a/cmd/frostfs-adm/internal/modules/morph/initialize_test.go +++ b/cmd/frostfs-adm/internal/modules/morph/initialize_test.go @@ -101,11 +101,11 @@ func generateTestData(t *testing.T, dir string, size int) { cfg := config.Config{} cfg.ProtocolConfiguration.Magic = 12345 cfg.ProtocolConfiguration.ValidatorsCount = size - cfg.ProtocolConfiguration.SecondsPerBlock = 1 + cfg.ProtocolConfiguration.SecondsPerBlock = 1 //lint:ignore SA1019 https://git.frostfs.info/TrueCloudLab/frostfs-node/issues/202 cfg.ProtocolConfiguration.StandbyCommittee = pubs // sorted by glagolic letters cfg.ProtocolConfiguration.P2PSigExtensions = true cfg.ProtocolConfiguration.VerifyTransactions = true - cfg.ProtocolConfiguration.VerifyBlocks = true + cfg.ProtocolConfiguration.VerifyBlocks = true //lint:ignore SA1019 https://git.frostfs.info/TrueCloudLab/frostfs-node/issues/202 data, err := yaml.Marshal(cfg) require.NoError(t, err) diff --git a/pkg/morph/client/notary.go b/pkg/morph/client/notary.go index 464d76d2a8..9c7071e5a0 100644 --- a/pkg/morph/client/notary.go +++ b/pkg/morph/client/notary.go @@ -423,6 +423,7 @@ func (c *Client) NotarySignAndInvokeTX(mainTx *transaction.Transaction) error { multiaddrAccount.PrivateKey().SignHashable(uint32(magicNumber), mainTx)..., ) + //lint:ignore SA1019 https://git.frostfs.info/TrueCloudLab/frostfs-node/issues/202 resp, err := c.client.SignAndPushP2PNotaryRequest(mainTx, []byte{byte(opcode.RET)}, -1, @@ -518,6 +519,7 @@ func (c *Client) notaryInvoke(committee, invokedByAlpha bool, contract util.Uint } // calculate notary fee + //lint:ignore SA1019 https://git.frostfs.info/TrueCloudLab/frostfs-node/issues/202 notaryFee, err := c.client.CalculateNotaryFee(u8n) if err != nil { return err @@ -525,6 +527,7 @@ func (c *Client) notaryInvoke(committee, invokedByAlpha bool, contract util.Uint // add network fee for cosigners //nolint:staticcheck // waits for neo-go v0.99.3 with notary actors + //lint:ignore SA1019 https://git.frostfs.info/TrueCloudLab/frostfs-node/issues/202 err = c.client.AddNetworkFee( mainTx, notaryFee, @@ -537,6 +540,7 @@ func (c *Client) notaryInvoke(committee, invokedByAlpha bool, contract util.Uint // define witnesses mainTx.Scripts = c.notaryWitnesses(invokedByAlpha, multiaddrAccount, mainTx) + //lint:ignore SA1019 https://git.frostfs.info/TrueCloudLab/frostfs-node/issues/202 resp, err := c.client.SignAndPushP2PNotaryRequest(mainTx, []byte{byte(opcode.RET)}, -1,