*: move wallet config from wallet
to config
package
In order to avoid dependency cycle at the next commits: imports github.com/nspcc-dev/neo-go/pkg/config imports github.com/nspcc-dev/neo-go/pkg/wallet imports github.com/nspcc-dev/neo-go/pkg/vm imports github.com/nspcc-dev/neo-go/pkg/smartcontract/nef imports github.com/nspcc-dev/neo-go/pkg/config
This commit is contained in:
parent
927127e5fb
commit
6b8957243a
5 changed files with 9 additions and 11 deletions
|
@ -6,7 +6,6 @@ import (
|
|||
"github.com/nspcc-dev/neo-go/pkg/core/storage"
|
||||
"github.com/nspcc-dev/neo-go/pkg/network/metrics"
|
||||
"github.com/nspcc-dev/neo-go/pkg/rpc"
|
||||
"github.com/nspcc-dev/neo-go/pkg/wallet"
|
||||
)
|
||||
|
||||
// ApplicationConfiguration config specific to the node.
|
||||
|
@ -26,5 +25,5 @@ type ApplicationConfiguration struct {
|
|||
ProtoTickInterval time.Duration `yaml:"ProtoTickInterval"`
|
||||
Relay bool `yaml:"Relay"`
|
||||
RPC rpc.Config `yaml:"RPC"`
|
||||
UnlockWallet wallet.Config `yaml:"UnlockWallet"`
|
||||
UnlockWallet Wallet `yaml:"UnlockWallet"`
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package wallet
|
||||
package config
|
||||
|
||||
// Config is a wallet info.
|
||||
type Config struct {
|
||||
// Wallet is a wallet info.
|
||||
type Wallet struct {
|
||||
Path string `yaml:"Path"`
|
||||
Password string `yaml:"Password"`
|
||||
}
|
|
@ -9,6 +9,7 @@ import (
|
|||
"github.com/nspcc-dev/dbft/block"
|
||||
"github.com/nspcc-dev/dbft/crypto"
|
||||
"github.com/nspcc-dev/dbft/payload"
|
||||
"github.com/nspcc-dev/neo-go/pkg/config"
|
||||
"github.com/nspcc-dev/neo-go/pkg/config/netmode"
|
||||
coreb "github.com/nspcc-dev/neo-go/pkg/core/block"
|
||||
"github.com/nspcc-dev/neo-go/pkg/core/blockchainer"
|
||||
|
@ -80,7 +81,7 @@ type Config struct {
|
|||
// TimePerBlock minimal time that should pass before next block is accepted.
|
||||
TimePerBlock time.Duration
|
||||
// Wallet is a local-node wallet configuration.
|
||||
Wallet *wallet.Config
|
||||
Wallet *config.Wallet
|
||||
}
|
||||
|
||||
// NewService returns new consensus.Service instance.
|
||||
|
|
|
@ -17,7 +17,6 @@ import (
|
|||
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||
"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/wallet"
|
||||
"github.com/stretchr/testify/require"
|
||||
"go.uber.org/zap/zaptest"
|
||||
)
|
||||
|
@ -202,7 +201,7 @@ func newTestService(t *testing.T) *service {
|
|||
Broadcast: func(*Payload) {},
|
||||
Chain: newTestChain(t),
|
||||
RequestTx: func(...util.Uint256) {},
|
||||
Wallet: &wallet.Config{
|
||||
Wallet: &config.Wallet{
|
||||
Path: "./testdata/wallet1.json",
|
||||
Password: "one",
|
||||
},
|
||||
|
|
|
@ -5,7 +5,6 @@ import (
|
|||
|
||||
"github.com/nspcc-dev/neo-go/pkg/config"
|
||||
"github.com/nspcc-dev/neo-go/pkg/config/netmode"
|
||||
"github.com/nspcc-dev/neo-go/pkg/wallet"
|
||||
"go.uber.org/zap/zapcore"
|
||||
)
|
||||
|
||||
|
@ -63,7 +62,7 @@ type (
|
|||
LogLevel zapcore.Level
|
||||
|
||||
// Wallet is a wallet configuration.
|
||||
Wallet *wallet.Config
|
||||
Wallet *config.Wallet
|
||||
|
||||
// TimePerBlock is an interval which should pass between two successive blocks.
|
||||
TimePerBlock time.Duration
|
||||
|
@ -76,7 +75,7 @@ func NewServerConfig(cfg config.Config) ServerConfig {
|
|||
appConfig := cfg.ApplicationConfiguration
|
||||
protoConfig := cfg.ProtocolConfiguration
|
||||
|
||||
var wc *wallet.Config
|
||||
var wc *config.Wallet
|
||||
if appConfig.UnlockWallet.Path != "" {
|
||||
wc = &appConfig.UnlockWallet
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue