diff --git a/cmd/neofs-ir/defaults.go b/cmd/neofs-ir/defaults.go index c1383715cc..3b4f452282 100644 --- a/cmd/neofs-ir/defaults.go +++ b/cmd/neofs-ir/defaults.go @@ -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") diff --git a/cmd/neofs-node/config.go b/cmd/neofs-node/config.go index 7256e6c826..f4181ceb36 100644 --- a/cmd/neofs-node/config.go +++ b/cmd/neofs-node/config.go @@ -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), diff --git a/go.mod b/go.mod index bb73023163..a22558e120 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 2ade4a85da..f41515d103 100644 Binary files a/go.sum and b/go.sum differ diff --git a/pkg/innerring/innerring.go b/pkg/innerring/innerring.go index 7d46498c86..ad4db2a9c8 100644 --- a/pkg/innerring/innerring.go +++ b/pkg/innerring/innerring.go @@ -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 diff --git a/pkg/innerring/processors/alphabet/process_emit.go b/pkg/innerring/processors/alphabet/process_emit.go index dc5552c28d..f5885c46b6 100644 --- a/pkg/innerring/processors/alphabet/process_emit.go +++ b/pkg/innerring/processors/alphabet/process_emit.go @@ -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() diff --git a/pkg/innerring/processors/neofs/processor.go b/pkg/innerring/processors/neofs/processor.go index 3608b4695e..15ea9547c1 100644 --- a/pkg/innerring/processors/neofs/processor.go +++ b/pkg/innerring/processors/neofs/processor.go @@ -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 } ) diff --git a/pkg/morph/client/client.go b/pkg/morph/client/client.go index ab61efde8b..0d1aed3f62 100644 --- a/pkg/morph/client/client.go +++ b/pkg/morph/client/client.go @@ -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 } diff --git a/pkg/morph/client/static.go b/pkg/morph/client/static.go index 404d546321..f4db5cedfe 100644 --- a/pkg/morph/client/static.go +++ b/pkg/morph/client/static.go @@ -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 }