Skip to content

Commit

Permalink
feat(sync): add json tags (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
vgonkivs committed Jul 11, 2023
1 parent b971a8d commit d500a59
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,15 @@ func (s *Syncer[H]) SyncWait(ctx context.Context) error {

// State collects all the information about a sync.
type State struct {
ID uint64 // incrementing ID of a sync
Height uint64 // height at the moment when State is requested for a sync
FromHeight, ToHeight uint64 // the starting and the ending point of a sync
FromHash, ToHash header.Hash
Start, End time.Time
Error string // the error that might happen within a sync
ID uint64 `json:"id"` // incrementing ID of a sync
Height uint64 `json:"height"` // height at the moment when State is requested for a sync
FromHeight uint64 `json:"from_height"` // the starting point of a sync
ToHeight uint64 `json:"to_height"` // the ending point of a sync
FromHash header.Hash `json:"from_hash"`
ToHash header.Hash `json:"to_hash"`
Start time.Time `json:"start"`
End time.Time `json:"end"`
Error string `json:"error,omitempty"` // the error that might happen within a sync
}

// Finished returns true if sync is done, false otherwise.
Expand Down

0 comments on commit d500a59

Please sign in to comment.