Skip to content

Commit

Permalink
fix(network): add enqueur to network mock
Browse files Browse the repository at this point in the history
Signed-off-by: Godefroy Ponsinet <godefroy.ponsinet@outlook.com>
  • Loading branch information
90dy committed Mar 8, 2019
1 parent 6f75c5d commit 8188344
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/cmd/berty/daemon.go
Expand Up @@ -164,6 +164,8 @@ func daemon(opts *daemonOptions) error {
}),
),
))
} else {
accountOptions = append(accountOptions, account.WithEnqueurNetwork())
}

if opts.withBot {
Expand Down
8 changes: 8 additions & 0 deletions core/manager/account/options.go
Expand Up @@ -28,6 +28,7 @@ import (
gql "berty.tech/core/api/node/graphql"
graph "berty.tech/core/api/node/graphql/graph/generated"
"berty.tech/core/network"
"berty.tech/core/network/mock"
"berty.tech/core/pkg/errorcodes"
"berty.tech/core/pkg/jaeger"
"berty.tech/core/pkg/notification"
Expand Down Expand Up @@ -73,6 +74,13 @@ func WithBanner(banner string) NewOption {
}
}

func WithEnqueurNetwork() NewOption {
return func(a *Account) error {
a.network = mock.NewEnqueuer(a.rootContext)
return nil
}
}

func WithInitOnly() NewOption {
return func(a *Account) error {
a.initOnly = true
Expand Down

0 comments on commit 8188344

Please sign in to comment.