Build a new State primitive for Runtimes (and protocol hooks) that behaves like a Set.
A example for usage of this would be storing the "set of UTXOs" or "set of nullifiers".
Generalized, it's useful where the existence of a specific entity is unique and that's the only "fact" we are interested in.
@state() myStateSet = new StateSet(Field)
stateSet.add(value) => void
stateSet.contains(value) => Bool
stateSet.remove(value) => Bool
Behind the scenes, it will just be a StateMap<Field, Value> where the key is the hash of the value
Build a new State primitive for Runtimes (and protocol hooks) that behaves like a Set.
A example for usage of this would be storing the "set of UTXOs" or "set of nullifiers".
Generalized, it's useful where the existence of a specific entity is unique and that's the only "fact" we are interested in.
@state() myStateSet = new StateSet(Field)stateSet.add(value) => voidstateSet.contains(value) => BoolstateSet.remove(value) => BoolBehind the scenes, it will just be a
StateMap<Field, Value>where the key is the hash of the value