Static
_emptyStatic
_innerStatic
_nextStatic
_provableStatic
emptyStatic
fromStatic
fromStatic
provableStatic
emptyRemove the last element from the list and return it.
If the list is empty, returns a dummy element.
Remove the last element from the list and return it.
This proves that the list is non-empty, and fails otherwise.
Return the last element, but only remove it if condition
is true.
If the list is empty, returns a dummy element.
Low-level, minimal version of pop()
which lets the caller decide whether there is an element to pop.
I.e. this proves:
Note that if the caller passes true
but the list is empty, this will fail.
If the caller passes false
but the list is non-empty, this succeeds and just doesn't pop off an element.
Push a new element to the list.
Push a new element to the list, if the condition
is true.
Static
createCreate a Merkle list type
Optionally, you can tell create()
how to do the hash that pushes a new list element, by passing a nextHash
function.
Iterate through the list in a fixed number of steps any apply a given callback on each element.
Proves that the iteration traverses the entire list. Once past the last element, dummy elements will be passed to the callback.
Note: There are no guarantees about the contents of dummy elements, so the callback is expected to handle the
isDummy
flag separately.