You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create the Fragment type, which is a specialized type that deals with chain of blocks[]*types.BlockData which represents a raw chain of blocks to be imported.
The struct only holds the chain of blocks
typeFragmentstruct {
chain []*types.BlockData
}
// Filter returns a new fragments with blocks that satisfies the predicate pfunc (f*Fragment) Filter(pfunc(*types.BlockData) bool) *Fragment// Find return the first occurrence of a types.BlockData that// satisfies the predicate pfunc (f*Fragment) Find(pfunc(*types.BlockData) bool) *types.BlockData// Last returns the first block in the fragment or nil otherwisefunc (f*Fragment) First() *types.BlockData// Last returns the last block in the fragment or nil otherwisefunc (f*Fragment) Last() *types.BlockData// Len returns the amount of blocks in the fragmentfunc (f*Fragment) Len() int// Iter returns an iterator of the blocks in the fragment// it enables the caller to use range keyword in the Fragment instancefunc (f*Fragment) Iter() iter.Seq[*types.BlockData]
// Concat returns a new fragment containing the concatenation// between this fragment and the given as argument fragmentfunc (f*Fragment) Concat(snd*Fragment) *Fragment
The goal is to constraint the the previously type [][]*types.BlockData (slice of slice of blocks data) in a []*Fragments (slice of fragments) with a better API to simplify the usage/manipulation/checks in the full sync strategy
The text was updated successfully, but these errors were encountered:
Issue summary
Fragment
type, which is a specialized type that deals with chain of blocks[]*types.BlockData
which represents a raw chain of blocks to be imported.The struct only holds the chain of blocks
The goal is to constraint the the previously type
[][]*types.BlockData
(slice of slice of blocks data) in a[]*Fragments
(slice of fragments) with a better API to simplify the usage/manipulation/checks in the full sync strategyThe text was updated successfully, but these errors were encountered: