Skip to content

Commit a2386c1

Browse files
Use instance of config instead of reference
1 parent 528bd94 commit a2386c1

File tree

13 files changed

+28
-28
lines changed

13 files changed

+28
-28
lines changed

api/api.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func SupportedAPIs(
109109
pullAPI *PullAPI,
110110
debugAPI *DebugAPI,
111111
walletAPI *WalletAPI,
112-
config *config.Config,
112+
config config.Config,
113113
) []rpc.API {
114114
apis := []rpc.API{{
115115
Namespace: "eth",
@@ -151,7 +151,7 @@ func SupportedAPIs(
151151

152152
type BlockChainAPI struct {
153153
logger zerolog.Logger
154-
config *config.Config
154+
config config.Config
155155
evm requester.Requester
156156
blocks storage.BlockIndexer
157157
transactions storage.TransactionIndexer
@@ -163,7 +163,7 @@ type BlockChainAPI struct {
163163

164164
func NewBlockChainAPI(
165165
logger zerolog.Logger,
166-
config *config.Config,
166+
config config.Config,
167167
evm requester.Requester,
168168
blocks storage.BlockIndexer,
169169
transactions storage.TransactionIndexer,

api/debug.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ type DebugAPI struct {
4949
transactions storage.TransactionIndexer
5050
receipts storage.ReceiptIndexer
5151
client *requester.CrossSporkClient
52-
config *config.Config
52+
config config.Config
5353
collector metrics.Collector
5454
}
5555

@@ -60,7 +60,7 @@ func NewDebugAPI(
6060
transactions storage.TransactionIndexer,
6161
receipts storage.ReceiptIndexer,
6262
client *requester.CrossSporkClient,
63-
config *config.Config,
63+
config config.Config,
6464
logger zerolog.Logger,
6565
collector metrics.Collector,
6666
) *DebugAPI {

api/net.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import (
99

1010
// NetAPI offers network related RPC methods
1111
type NetAPI struct {
12-
config *config.Config
12+
config config.Config
1313
}
1414

15-
func NewNetAPI(config *config.Config) *NetAPI {
15+
func NewNetAPI(config config.Config) *NetAPI {
1616
return &NetAPI{
1717
config: config,
1818
}

api/pull.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func newLogsFilter(
129129

130130
type PullAPI struct {
131131
logger zerolog.Logger
132-
config *config.Config
132+
config config.Config
133133
blocks storage.BlockIndexer
134134
transactions storage.TransactionIndexer
135135
receipts storage.ReceiptIndexer
@@ -140,7 +140,7 @@ type PullAPI struct {
140140

141141
func NewPullAPI(
142142
logger zerolog.Logger,
143-
config *config.Config,
143+
config config.Config,
144144
blocks storage.BlockIndexer,
145145
transactions storage.TransactionIndexer,
146146
receipts storage.ReceiptIndexer,

api/pull_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func TestFilterExpiryChecker(t *testing.T) {
6060
t.Run(tc.name, func(t *testing.T) {
6161
api := &PullAPI{
6262
filters: make(map[rpc.ID]filter),
63-
config: &config.Config{FilterExpiry: time.Millisecond * 5},
63+
config: config.Config{FilterExpiry: time.Millisecond * 5},
6464
}
6565

6666
tc.setup(api)

api/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ type Server struct {
5353
host string
5454
port int
5555

56-
config *config.Config
56+
config config.Config
5757
collector metrics.Collector
5858
}
5959

@@ -66,7 +66,7 @@ const (
6666
func NewServer(
6767
logger zerolog.Logger,
6868
collector metrics.Collector,
69-
cfg *config.Config,
69+
cfg config.Config,
7070
) *Server {
7171
logger = logger.With().Str("component", "API").Logger()
7272

api/stream.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121

2222
type StreamAPI struct {
2323
logger zerolog.Logger
24-
config *config.Config
24+
config config.Config
2525
blocks storage.BlockIndexer
2626
transactions storage.TransactionIndexer
2727
receipts storage.ReceiptIndexer
@@ -32,7 +32,7 @@ type StreamAPI struct {
3232

3333
func NewStreamAPI(
3434
logger zerolog.Logger,
35-
config *config.Config,
35+
config config.Config,
3636
blocks storage.BlockIndexer,
3737
transactions storage.TransactionIndexer,
3838
receipts storage.ReceiptIndexer,

api/wallet.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ import (
1919

2020
type WalletAPI struct {
2121
net *BlockChainAPI
22-
config *config.Config
22+
config config.Config
2323
}
2424

25-
func NewWalletAPI(config *config.Config, net *BlockChainAPI) *WalletAPI {
25+
func NewWalletAPI(config config.Config, net *BlockChainAPI) *WalletAPI {
2626
return &WalletAPI{
2727
net: net,
2828
config: config,

bootstrap/bootstrap.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ type Publishers struct {
5151

5252
type Bootstrap struct {
5353
logger zerolog.Logger
54-
config *config.Config
54+
config config.Config
5555
client *requester.CrossSporkClient
5656
storages *Storages
5757
publishers *Publishers
@@ -63,7 +63,7 @@ type Bootstrap struct {
6363
db *pebbleDB.DB
6464
}
6565

66-
func New(config *config.Config) (*Bootstrap, error) {
66+
func New(config config.Config) (*Bootstrap, error) {
6767
logger := zerolog.New(config.LogWriter).
6868
With().Timestamp().Str("version", api.Version).
6969
Logger().Level(config.LogLevel)
@@ -432,7 +432,7 @@ func StartEngine(
432432
}
433433

434434
// setupCrossSporkClient sets up a cross-spork AN client.
435-
func setupCrossSporkClient(config *config.Config, logger zerolog.Logger) (*requester.CrossSporkClient, error) {
435+
func setupCrossSporkClient(config config.Config, logger zerolog.Logger) (*requester.CrossSporkClient, error) {
436436
// create access client with cross-spork capabilities
437437
currentSporkClient, err := grpc.NewClient(
438438
config.AccessNodeHost,
@@ -474,7 +474,7 @@ func setupCrossSporkClient(config *config.Config, logger zerolog.Logger) (*reque
474474
// setupStorage creates storage and initializes it with configured starting cadence height
475475
// in case such a height doesn't already exist in the database.
476476
func setupStorage(
477-
config *config.Config,
477+
config config.Config,
478478
client *requester.CrossSporkClient,
479479
logger zerolog.Logger,
480480
) (*pebbleDB.DB, *Storages, error) {
@@ -571,7 +571,7 @@ func setupStorage(
571571
// Run will run complete bootstrap of the EVM gateway with all the engines.
572572
// Run is a blocking call, but it does signal readiness of the service
573573
// through a channel provided as an argument.
574-
func Run(ctx context.Context, cfg *config.Config, ready component.ReadyFunc) error {
574+
func Run(ctx context.Context, cfg config.Config, ready component.ReadyFunc) error {
575575
boot, err := New(cfg)
576576
if err != nil {
577577
return err

cmd/run/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ func parseConfigFromFlags() error {
244244
return nil
245245
}
246246

247-
var cfg = &config.Config{}
247+
var cfg = config.Config{}
248248
var (
249249
coinbase,
250250
gas,

0 commit comments

Comments
 (0)