[#254] Update neo-go to preview4 compatible version

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-12-11 11:33:27 +03:00 committed by Alex Vanin
parent c539657567
commit feec559e47
9 changed files with 23 additions and 18 deletions

View file

@ -71,7 +71,7 @@ func defaultConfiguration(cfg *viper.Viper) {
cfg.SetDefault("contracts.alphabet.jest", "")
cfg.SetDefault("contracts.alphabet.zhivete", "")
// gas native contract in LE
cfg.SetDefault("contracts.gas", "668e0c1f9d7b70a99dd9e06eadd4c784d641afbc")
cfg.SetDefault("contracts.gas", "b5df804bbadefea726afb5d3f4e8a6f6d32d2a20")
cfg.SetDefault("timers.epoch", "5s")
cfg.SetDefault("timers.emit", "30s")

View file

@ -11,6 +11,7 @@ import (
"sync"
"time"
"github.com/nspcc-dev/neo-go/pkg/encoding/fixedn"
"github.com/nspcc-dev/neo-go/pkg/util"
"github.com/nspcc-dev/neofs-api-go/pkg"
"github.com/nspcc-dev/neofs-api-go/pkg/netmap"
@ -197,20 +198,20 @@ type cfgMorph struct {
type cfgAccounting struct {
scriptHash util.Uint160
fee util.Fixed8
fee fixedn.Fixed8
}
type cfgContainer struct {
scriptHash util.Uint160
fee util.Fixed8
fee fixedn.Fixed8
}
type cfgNetmap struct {
scriptHash util.Uint160
wrapper *nmwrapper.Wrapper
fee util.Fixed8
fee fixedn.Fixed8
parsers map[event.Type]event.Parser
@ -299,15 +300,15 @@ func initCfg(path string) *cfg {
apiVersion: pkg.SDKVersion(),
cfgAccounting: cfgAccounting{
scriptHash: u160Accounting,
fee: util.Fixed8(viperCfg.GetInt(cfgAccountingFee)),
fee: fixedn.Fixed8(viperCfg.GetInt(cfgAccountingFee)),
},
cfgContainer: cfgContainer{
scriptHash: u160Container,
fee: util.Fixed8(viperCfg.GetInt(cfgContainerFee)),
fee: fixedn.Fixed8(viperCfg.GetInt(cfgContainerFee)),
},
cfgNetmap: cfgNetmap{
scriptHash: u160Netmap,
fee: util.Fixed8(viperCfg.GetInt(cfgNetmapFee)),
fee: fixedn.Fixed8(viperCfg.GetInt(cfgNetmapFee)),
state: state,
reBootstrapInterval: viperCfg.GetUint64(cfgReBootstrapInterval),
reBootstrapEnabled: viperCfg.GetBool(cfgReBootstrapEnabled),

2
go.mod
View file

@ -16,7 +16,7 @@ require (
github.com/multiformats/go-multiaddr-net v0.1.2 // v0.1.1 => v0.1.2
github.com/multiformats/go-multihash v0.0.13 // indirect
github.com/nspcc-dev/hrw v1.0.9
github.com/nspcc-dev/neo-go v0.91.1-pre.0.20201030072836-71216865717b
github.com/nspcc-dev/neo-go v0.91.1-pre.0.20201215101847-7c2257803f32
github.com/nspcc-dev/neofs-api-go v1.21.2
github.com/nspcc-dev/neofs-crypto v0.3.0
github.com/nspcc-dev/tzhash v1.4.0

BIN
go.sum

Binary file not shown.

View file

@ -5,6 +5,7 @@ import (
"crypto/ecdsa"
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
"github.com/nspcc-dev/neo-go/pkg/encoding/fixedn"
"github.com/nspcc-dev/neo-go/pkg/util"
crypto "github.com/nspcc-dev/neofs-crypto"
"github.com/nspcc-dev/neofs-node/pkg/innerring/invoke"
@ -258,7 +259,7 @@ func New(ctx context.Context, log *zap.Logger, cfg *viper.Viper) (*Server, error
Converter: &server.precision,
MintEmitCacheSize: cfg.GetInt("emit.mint.cache_size"),
MintEmitThreshold: cfg.GetUint64("emit.mint.threshold"),
MintEmitValue: util.Fixed8(cfg.GetInt64("emit.mint.value")),
MintEmitValue: fixedn.Fixed8(cfg.GetInt64("emit.mint.value")),
})
if err != nil {
return nil, err

View file

@ -4,7 +4,7 @@ import (
"crypto/elliptic"
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
"github.com/nspcc-dev/neo-go/pkg/util"
"github.com/nspcc-dev/neo-go/pkg/encoding/fixedn"
"github.com/nspcc-dev/neofs-node/pkg/innerring/invoke"
"go.uber.org/zap"
)
@ -50,7 +50,7 @@ func (np *Processor) processEmit() {
return
}
gasPerNode := util.Fixed8(np.storageEmission / uint64(ln))
gasPerNode := fixedn.Fixed8(np.storageEmission / uint64(ln))
for i := range networkMap.Nodes {
keyBytes := networkMap.Nodes[i].PublicKey()

View file

@ -4,6 +4,7 @@ import (
"sync"
lru "github.com/hashicorp/golang-lru"
"github.com/nspcc-dev/neo-go/pkg/encoding/fixedn"
"github.com/nspcc-dev/neo-go/pkg/util"
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
@ -43,7 +44,7 @@ type (
mintEmitLock *sync.Mutex
mintEmitCache *lru.Cache
mintEmitThreshold uint64
mintEmitValue util.Fixed8
mintEmitValue fixedn.Fixed8
}
// Params of the processor constructor.
@ -59,7 +60,7 @@ type (
Converter PrecisionConverter
MintEmitCacheSize int
MintEmitThreshold uint64 // in epochs
MintEmitValue util.Fixed8
MintEmitValue fixedn.Fixed8
}
)

View file

@ -2,6 +2,7 @@ package client
import (
"github.com/nspcc-dev/neo-go/pkg/core/transaction"
"github.com/nspcc-dev/neo-go/pkg/encoding/fixedn"
"github.com/nspcc-dev/neo-go/pkg/rpc/client"
sc "github.com/nspcc-dev/neo-go/pkg/smartcontract"
"github.com/nspcc-dev/neo-go/pkg/util"
@ -42,7 +43,7 @@ var errScriptDecode = errors.New("could not decode invocation script from neo no
// Invoke invokes contract method by sending transaction into blockchain.
// Supported args types: int64, string, util.Uint160, []byte and bool.
func (c *Client) Invoke(contract util.Uint160, fee util.Fixed8, method string, args ...interface{}) error {
func (c *Client) Invoke(contract util.Uint160, fee fixedn.Fixed8, method string, args ...interface{}) error {
params := make([]sc.Parameter, 0, len(args))
for i := range args {
@ -120,8 +121,8 @@ func (c *Client) TestInvoke(contract util.Uint160, method string, args ...interf
}
// TransferGas to the receiver from local wallet
func (c *Client) TransferGas(receiver util.Uint160, amount util.Fixed8) error {
txHash, err := c.client.TransferNEP5(c.acc, receiver, c.gas, int64(amount), 0)
func (c *Client) TransferGas(receiver util.Uint160, amount fixedn.Fixed8) error {
txHash, err := c.client.TransferNEP17(c.acc, receiver, c.gas, int64(amount), 0)
if err != nil {
return err
}

View file

@ -3,6 +3,7 @@ package client
import (
"errors"
"github.com/nspcc-dev/neo-go/pkg/encoding/fixedn"
"github.com/nspcc-dev/neo-go/pkg/util"
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
)
@ -19,7 +20,7 @@ type StaticClient struct {
scScriptHash util.Uint160 // contract script-hash
fee util.Fixed8 // invocation fee
fee fixedn.Fixed8 // invocation fee
}
// ErrNilStaticClient is returned by functions that expect
@ -29,7 +30,7 @@ var ErrNilStaticClient = errors.New("static client is nil")
// NewStatic creates, initializes and returns the StaticClient instance.
//
// If provided Client instance is nil, ErrNilClient is returned.
func NewStatic(client *Client, scriptHash util.Uint160, fee util.Fixed8) (*StaticClient, error) {
func NewStatic(client *Client, scriptHash util.Uint160, fee fixedn.Fixed8) (*StaticClient, error) {
if client == nil {
return nil, ErrNilClient
}