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

Method FirstElements

util/partialord/partialord.go:54–63  ·  view source on GitHub ↗

FirstElements Sets elems to be the first elements in the ordering. 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 begin with {D, B, A}

(elems ...string)

Source from the content-addressed store, hash-verified

52// So if were making an ordering over {A, B, C, D, E}, and elems provided is {D, B, A}
53// then we are guaranteed that the total ordering will begin with {D, B, A}
54func (ord *PartialOrdering) FirstElements(elems ...string) {
55 if ord.firstSealed {
56 panic("FirstElements has already been called")
57 }
58 // We make every node in the dag have a dependency on elems[-1]
59 // then we change elems[-1] to depend on elems[-2], and so forth.
60 err := ord.dag.AddFirstElements(elems...)
61 handleDAGErr(err)
62 ord.firstSealed = true
63}
64
65// LastElements Sets elems to be the last elements in the ordering.
66// So if were making an ordering over {A, B, C, D, E}, and elems provided is {D, B, A}

Callers 4

orderBeginBlockersFunction · 0.95
TestAPIFunction · 0.95
TestNonStandardAPIOrderFunction · 0.95
TestSequenceFunction · 0.95

Calls 2

handleDAGErrFunction · 0.85
AddFirstElementsMethod · 0.80

Tested by 3

TestAPIFunction · 0.76
TestNonStandardAPIOrderFunction · 0.76
TestSequenceFunction · 0.76