[#127] Remove magic number from config

With neo-project/neo-modules#358 nodes support RPC to
return used magic number. Therefore client doesn't need
that configuration value any more.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-11-02 11:16:22 +03:00 committed by Alex Vanin
parent 174efc9df3
commit 83119c00ec
3 changed files with 0 additions and 21 deletions

View file

@ -5,7 +5,6 @@ import (
"crypto/ecdsa"
"time"
"github.com/nspcc-dev/neo-go/pkg/config/netmode"
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
"github.com/nspcc-dev/neo-go/pkg/rpc/client"
"github.com/nspcc-dev/neo-go/pkg/util"
@ -24,8 +23,6 @@ type cfg struct {
dialTimeout time.Duration // client dial timeout
magic netmode.Magic // type of Neo blockchain network
logger *logger.Logger // logging component
gas util.Uint160 // native gas script-hash
@ -33,13 +30,10 @@ type cfg struct {
const defaultDialTimeout = 5 * time.Second
const defaultMagic = netmode.PrivNet
func defaultConfig() *cfg {
return &cfg{
ctx: context.Background(),
dialTimeout: defaultDialTimeout,
magic: defaultMagic,
logger: zap.L(),
gas: util.Uint160{},
}
@ -131,16 +125,6 @@ func WithDialTimeout(dur time.Duration) Option {
}
}
// WithMagic returns a client constructor option
// that specifies neo blockchain network type.
//
// If option not provided, netmode.PrivNet is used.
func WithMagic(mag netmode.Magic) Option {
return func(c *cfg) {
c.magic = mag
}
}
// WithLogger returns a client constructor option
// that specifies the component for writing log messages.
//