mirror of
https://github.com/logos-blockchain/logos-blockchain-specs.git
synced 2026-01-06 23:23:09 +00:00
24 lines
493 B
Python
24 lines
493 B
Python
"""
|
|
This module maintains the state of the CL.
|
|
|
|
Namely we are interested in:
|
|
- the set of note commitments
|
|
- the set of note nullifiers (spent notes)
|
|
- the set of constraints
|
|
"""
|
|
|
|
from dataclasses import dataclass
|
|
|
|
import note
|
|
import constraint
|
|
|
|
|
|
@dataclass
|
|
class State:
|
|
commitments: set[note.Commitment]
|
|
nullifiers: set[note.Nullifier]
|
|
constraints: dict[bytes, constraint.Constraint]
|
|
|
|
def add_constraint(self, c: constraint.Constraint):
|
|
self.constraints[c.hash()] = c
|