-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/status #180
Feat/status #180
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andreivladbrg really great work on the diagrams. On the statuses of the stream, I have left my comments below. I'd love to know your thoughts on it.
c932f6c
to
c641530
Compare
3e3ce32
to
3021580
Compare
@PaulRBerg @razgraf tagging you to request your opinions on the naming of statuses (also, you can see the diagrams in the PR's OP - or /// @notice Enum representing the different statuses of a stream.
/// @dev There are two types of streams:
/// - ACTIVE: when the amount owed to the recipient is increasing over time.
/// - INACTIVE: when the amount owed to the recipient is not increasing over time.
/// @custom:value0 STREAMING_SOLVENT Active stream when there is no debt.
/// @custom:value1 STREAMING_INSOLVENT Active stream when there is debt.
/// @custom:value2 PAUSED_SOLVENT Paused stream when there is no debt.
/// @custom:value3 PAUSED_INSOLVENT Paused stream when there is debt.
enum Status {
// ACTIVE:
STREAMING_SOLVENT,
STREAMING_INSOLVENT,
// INACTIVE:
PAUSED_SOLVENT,
PAUSED_INSOLVENT
} |
@smol-ninja since we softly agreed on the statuses names, the PR is ready to be reviewed |
d9f2b52
to
a9c5481
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andreivladbrg I loved the diagrams. Fantastic work on it.
Q: Why not replace INACTIVE
keyword with PAUSE
and ACTIVE
with STREAMING
?
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Yes kind of. I changed it a bit to show you what I was thinking. stateDiagram-v2
direction LR
state Streaming {
STREAMING_SOLVENT
STREAMING_INSOLVENT --> STREAMING_SOLVENT : deposit
STREAMING_SOLVENT --> STREAMING_INSOLVENT : time
}
state Paused {
# direction BT
PAUSED_SOLVENT
PAUSED_INSOLVENT
PAUSED_INSOLVENT --> PAUSED_SOLVENT : deposit || void
}
STREAMING_SOLVENT --> PAUSED_SOLVENT : pause
STREAMING_INSOLVENT --> PAUSED_INSOLVENT : pause
STREAMING_INSOLVENT --> PAUSED_SOLVENT : void
PAUSED_SOLVENT --> STREAMING_SOLVENT : restart
PAUSED_INSOLVENT --> STREAMING_INSOLVENT : restart
NULL --> STREAMING_SOLVENT : create
NULL:::grey
Streaming:::lightGreen
Paused:::lightYellow
STREAMING_SOLVENT:::intenseGreen
STREAMING_INSOLVENT:::intenseGreen
PAUSED_INSOLVENT:::intenseYellow
PAUSED_SOLVENT:::intenseYellow
classDef grey fill:#b0b0b0,stroke:#333,stroke-width:2px,color:#000,font-weight:bold;
classDef lightGreen fill:#98FB98,color:#000,font-weight:bold;
classDef intenseGreen fill:#32cd32,stroke:#333,stroke-width:2px,color:#000,font-weight:bold;
classDef lightYellow fill:#ffff99,color:#000,font-weight:bold;
classDef intenseYellow fill:#ffd700,color:#000,font-weight:bold;
And then replace "Active" and "Inactive" with "Streaming" and "Paused" in the |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except one small change.
docs: update diagrams
test: say "given" instead of "when"
1315071
to
704de36
Compare
Linked issues
Changes
status
functionDiagrams
Statuses
Types
Statuses diagram
The transition between statuses is done by specific functions, which can be seen in the text on the edges or by the
time.
Function calls
Notes:
ltu
is always updated toblock.timestamp
The words chosen for the statuses are meant to best express their correct status, but they might be debatable. Feel free to suggest better terminology. While reading the code, it's advise to also real the
diagrams.md
file.I’ve decided to add the diagrams here until we have a field in our docs because it is easier to maintain them here instead of having them in github discussions or as gists.