Code structure organization

pull/557/head
kompotkot 2022-03-06 23:21:24 +00:00
rodzic 838c75ae29
commit d55209df42
2 zmienionych plików z 14 dodań i 13 usunięć

Wyświetl plik

@ -73,19 +73,6 @@ func show(blockNumbers []uint64) error {
return nil
}
// TODO(kompotkot): Find way to remove Number
type Result struct {
ErrorOutput string
ErrorSource string
Number uint64
Output string
}
type Job struct {
BlockNumber uint64
Results chan<- Result
}
// Run verification flow of blockchain with database data
func verify(blockchain string, blockNumbers []uint64, workers int) error {
jobsCh := make(chan Job, workers)

Wyświetl plik

@ -52,3 +52,17 @@ type CorruptBlock struct {
type CorruptBlocks struct {
Blocks []CorruptBlock `json:"blocks"`
}
// Concurrency jobs structure
type Job struct {
BlockNumber uint64
Results chan<- Result
}
// TODO(kompotkot): Find way to remove Number
type Result struct {
ErrorOutput string
ErrorSource string
Number uint64
Output string
}