-
Notifications
You must be signed in to change notification settings - Fork 178
/
all.go
46 lines (42 loc) · 1.4 KB
/
all.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
42
43
44
45
46
package badger
import (
"github.com/dgraph-io/badger/v2"
"github.com/onflow/flow-go/module"
"github.com/onflow/flow-go/storage"
)
func InitAll(metrics module.CacheMetrics, db *badger.DB) *storage.All {
headers := NewHeaders(metrics, db)
guarantees := NewGuarantees(metrics, db)
seals := NewSeals(metrics, db)
index := NewIndex(metrics, db)
payloads := NewPayloads(db, index, guarantees, seals)
blocks := NewBlocks(db, headers, payloads)
setups := NewEpochSetups(metrics, db)
epochCommits := NewEpochCommits(metrics, db)
statuses := NewEpochStatuses(metrics, db)
results := NewExecutionResults(db)
receipts := NewExecutionReceipts(db, results)
chunkDataPacks := NewChunkDataPacks(db)
commits := NewCommits(metrics, db)
transactions := NewTransactions(metrics, db)
transactionResults := NewTransactionResults(db)
collections := NewCollections(db, transactions)
return &storage.All{
Headers: headers,
Guarantees: guarantees,
Seals: seals,
Index: index,
Payloads: payloads,
Blocks: blocks,
Setups: setups,
EpochCommits: epochCommits,
Statuses: statuses,
Results: results,
Receipts: receipts,
ChunkDataPacks: chunkDataPacks,
Commits: commits,
Transactions: transactions,
TransactionResults: transactionResults,
Collections: collections,
}
}