MCPcopy Create free account
hub / github.com/akash-network/node / Sequence

Method Sequence

util/partialord/partialord.go:83–89  ·  view source on GitHub ↗

Sequence sets a sequence of ordering constraints. So if were making an ordering over {A, B, C, D, E}, and elems provided is {D, B, A} then we are guaranteed that the total ordering will have D comes before B comes before A. (They're may be elements interspersed, e.g. {D, C, E, B, A} is a valid order

(seq ...string)

Source from the content-addressed store, hash-verified

81// then we are guaranteed that the total ordering will have D comes before B comes before A.
82// (They're may be elements interspersed, e.g. {D, C, E, B, A} is a valid ordering)
83func (ord *PartialOrdering) Sequence(seq ...string) {
84 // We make every node in the sequence have a prior node
85 for i := 0; i < (len(seq) - 1); i++ {
86 err := ord.dag.AddEdge(seq[i], seq[i+1])
87 handleDAGErr(err)
88 }
89}
90
91// TotalOrdering returns a deterministically chosen total ordering that satisfies all specified
92// partial ordering constraints.

Callers 3

orderBeginBlockersFunction · 0.95
orderEndBlockersFunction · 0.95
TestSequenceFunction · 0.95

Calls 2

handleDAGErrFunction · 0.85
AddEdgeMethod · 0.80

Tested by 1

TestSequenceFunction · 0.76