From 810087d8b9d2988526e60b977a145066a60a763e Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 21 Oct 2022 12:01:17 +0400 Subject: [PATCH] [#1946] Bump neo-go module to v0.99.4 Signed-off-by: Leonard Lyubich --- CHANGELOG.md | 2 ++ .../internal/modules/morph/local_client.go | 17 ++++++++++++++++- .../internal/modules/morph/n3client.go | 6 ++---- go.mod | 4 ++-- go.sum | Bin 116716 -> 117053 bytes 5 files changed, 22 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbd71592b..82a791228 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ Changelog for NeoFS Node ### Removed ### Updated +- `neo-go` to `v0.99.4` + ### Updating from v0.33.0 ## [0.33.0] - 2022-10-17 - Anmado (안마도, 鞍馬島) diff --git a/cmd/neofs-adm/internal/modules/morph/local_client.go b/cmd/neofs-adm/internal/modules/morph/local_client.go index dba486b53..2778ee0cc 100644 --- a/cmd/neofs-adm/internal/modules/morph/local_client.go +++ b/cmd/neofs-adm/internal/modules/morph/local_client.go @@ -8,6 +8,7 @@ import ( "os" "sort" + "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" @@ -34,6 +35,7 @@ import ( "github.com/nspcc-dev/neo-go/pkg/vm" "github.com/nspcc-dev/neo-go/pkg/vm/emit" "github.com/nspcc-dev/neo-go/pkg/vm/opcode" + "github.com/nspcc-dev/neo-go/pkg/vm/stackitem" "github.com/nspcc-dev/neo-go/pkg/vm/vmstate" "github.com/nspcc-dev/neo-go/pkg/wallet" "github.com/spf13/viper" @@ -194,6 +196,16 @@ func (l *localClient) SignAndPushInvocationTx(_ []byte, _ *wallet.Account, _ int panic("unexpected call") } +func (l *localClient) TerminateSession(_ uuid.UUID) (bool, error) { + // not used by `morph init` command + panic("unexpected call") +} + +func (l *localClient) TraverseIterator(_, _ uuid.UUID, _ int) ([]stackitem.Item, error) { + // not used by `morph init` command + panic("unexpected call") +} + // GetVersion return default version. func (l *localClient) GetVersion() (*result.Version, error) { return &result.Version{}, nil @@ -333,12 +345,15 @@ func (l *localClient) InvokeScript(script []byte, signers []transaction.Signer) tx.Signers = signers tx.ValidUntilBlock = l.bc.BlockHeight() + 2 - ic := l.bc.GetTestVM(trigger.Application, tx, &block.Block{ + ic, err := l.bc.GetTestVM(trigger.Application, tx, &block.Block{ Header: block.Header{ Index: lastBlock.Index + 1, Timestamp: lastBlock.Timestamp + 1, }, }) + if err != nil { + return nil, fmt.Errorf("get test VM: %w", err) + } ic.VM.GasLimit = 100_0000_0000 ic.VM.LoadScriptWithFlags(script, callflag.All) diff --git a/cmd/neofs-adm/internal/modules/morph/n3client.go b/cmd/neofs-adm/internal/modules/morph/n3client.go index 419791a3b..138943b6e 100644 --- a/cmd/neofs-adm/internal/modules/morph/n3client.go +++ b/cmd/neofs-adm/internal/modules/morph/n3client.go @@ -16,7 +16,6 @@ import ( "github.com/nspcc-dev/neo-go/pkg/rpcclient" "github.com/nspcc-dev/neo-go/pkg/rpcclient/actor" "github.com/nspcc-dev/neo-go/pkg/rpcclient/invoker" - "github.com/nspcc-dev/neo-go/pkg/smartcontract" "github.com/nspcc-dev/neo-go/pkg/smartcontract/trigger" "github.com/nspcc-dev/neo-go/pkg/util" "github.com/nspcc-dev/neo-go/pkg/wallet" @@ -27,6 +26,8 @@ import ( // Client represents N3 client interface capable of test-invoking scripts // and sending signed transactions to chain. type Client interface { + invoker.RPCInvoke + GetBlockCount() (uint32, error) GetContractStateByID(int32) (*state.Contract, error) GetContractStateByHash(util.Uint160) (*state.Contract, error) @@ -36,9 +37,6 @@ type Client interface { GetVersion() (*result.Version, error) CreateTxFromScript([]byte, *wallet.Account, int64, int64, []rpcclient.SignerAccount) (*transaction.Transaction, error) NEP17BalanceOf(util.Uint160, util.Uint160) (int64, error) - InvokeContractVerify(contract util.Uint160, params []smartcontract.Parameter, signers []transaction.Signer, witnesses ...transaction.Witness) (*result.Invoke, error) - InvokeFunction(contract util.Uint160, operation string, params []smartcontract.Parameter, signers []transaction.Signer) (*result.Invoke, error) - InvokeScript([]byte, []transaction.Signer) (*result.Invoke, error) SendRawTransaction(*transaction.Transaction) (util.Uint256, error) GetCommittee() (keys.PublicKeys, error) CalculateNotaryFee(uint8) (int64, error) diff --git a/go.mod b/go.mod index 605115112..c032d0957 100644 --- a/go.mod +++ b/go.mod @@ -15,8 +15,8 @@ require ( github.com/multiformats/go-multiaddr v0.4.0 github.com/nats-io/nats.go v1.16.0 github.com/nspcc-dev/hrw v1.0.9 - github.com/nspcc-dev/neo-go v0.99.2 - github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220809123759-3094d3e0c14b // indirect + github.com/nspcc-dev/neo-go v0.99.4 + github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20220927123257-24c107e3a262 // indirect github.com/nspcc-dev/neofs-api-go/v2 v2.14.0 github.com/nspcc-dev/neofs-contract v0.16.0 github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.6.0.20221013072718-21eef1ae7f7d diff --git a/go.sum b/go.sum index 7e3dd3ba831232a14ddc063fdac5933e515ed5f1..6d92c0d87d78926201cfe6f4ef7a33e3651e0b02 100644 GIT binary patch delta 342 zcmaFU&%SpO`-YCClNT)E_cJoEG%zwWG&VFe(>1k7G)*-(Gfp)#G1pJe*UQaMQOGc~ zO1G@YERM*Hu=ESC^v%l5PYg-5Ff+=t498!FS4}QT)1>P^W>P7 z!IM_98<>DJTSRIHrvz1G7dx99C7J~IWhc8kXXqy;24?1ESh|;LC!6|Y<|HK-NBDbA z7F;bgxnTvDxe1cxx!xi9IcY(mY2I0G#rdWl0cGyNfhD0)$>s)m24UV#zQu-SsqUrD zrs