-
Notifications
You must be signed in to change notification settings - Fork 0
/
wire_gen.go
41 lines (33 loc) · 931 Bytes
/
wire_gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Code generated by Wire. DO NOT EDIT.
//go:generate go run github.com/google/wire/cmd/wire
//go:build !wireinject
// +build !wireinject
package main
import (
"github.com/ethereum/go-ethereum/ethclient"
"github.com/pinebit/eth-listener/token"
)
// Injectors from wire.go:
func WireApp(configPath string) (*App, error) {
config, err := LoadConfig(configPath)
if err != nil {
return nil, err
}
tokensDB := newTokensDB()
accounts := NewAccounts(config)
mainTelegram := NewTelegram(config)
client, err := newEthClient(config)
if err != nil {
return nil, err
}
tokensManager := token.NewTokensManager(client, tokensDB)
app := NewApp(config, tokensDB, accounts, mainTelegram, client, tokensManager)
return app, nil
}
// wire.go:
func newEthClient(config *Config) (*ethclient.Client, error) {
return ethclient.Dial(config.EthUrl)
}
func newTokensDB() token.TokensDB {
return token.NewTokensDB(TokensDBPath)
}