Skip to content
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: add "getStreamedAmount" function #266

Merged
merged 3 commits into from
Jan 18, 2023
Merged

Conversation

PaulRBerg
Copy link
Member

@PaulRBerg PaulRBerg commented Jan 14, 2023

Implements #255.

Changelog:

  • feat: add "getStreamedAmount" function
  • perf: simplify "getReturnableAmount" by calling "getStreamedAmount"
  • refactor: move "getWithdrawableAmount" logic to "getStreamedAmount"
  • refactor: order constant functions alphabetically
  • test: add missing check for "currentTime >= stopTime" in "getStreamedAmount" replicas
  • test: better document fuzzing in "getWithdrawableAmount" tests
  • test: simplify "getWithdrawableAmount" tests by fuzzing current time
  • test: test "getStreamedAmount"

@PaulRBerg PaulRBerg force-pushed the prb/get-streamed-amount branch from e39bbab to 1c98818 Compare January 14, 2023 10:33
@PaulRBerg PaulRBerg force-pushed the prb/get-streamed-amount branch 2 times, most recently from 4cb683a to c8963d8 Compare January 17, 2023 10:12
Copy link
Member

@andreivladbrg andreivladbrg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this PR, but some small mistakes were made.

build: upgrade to latest "prb-math"
chore: add explanations for why casting is safe
chore: add more explanatory code comments
chore: delete unused imports
chore: improve wording in code comments
refactor: assign "elapsedSegmentTime" and "totalSegmentTime" only once
refactor: change types to "SD59x18" in "getWithdrawableAmount"
refactor: delete the "segmentCount" param in "_checkProSegments"
refactor: rename "checkCreateLinearParams" to "checkCreateLinearArgs"
refactor: rename "checkCreateProParams" to "checkCreateProArgs"
refactor: rename "proRataAmount" var to "streamedAmount" in "getWithdrawableAmount"
refactor: use casting utilities from PRBMath
test: order helpers alphabetically in "ProTest"
perf: simplify "getReturnableAmount" by calling "getStreamedAmount"
refactor: move "getWithdrawableAmount" logic to "getStreamedAmount"
refactor: order constant functions alphabetically
test: add missing check for "currentTime >= stopTime" in "getStreamedAmount" replicas
test: better document fuzzing in "getWithdrawableAmount" tests
test: simplify "getWithdrawableAmount" tests by fuzzing current time
test: test "getStreamedAmount"
@PaulRBerg PaulRBerg force-pushed the prb/get-streamed-amount branch from c8963d8 to 2cc3934 Compare January 17, 2023 16:48
chore: remove local variable in "getReturnableAmount"
test: correct comments about functions that calculate the streamed amount
@PaulRBerg PaulRBerg merged commit 0d84c53 into main Jan 18, 2023
@PaulRBerg PaulRBerg deleted the prb/get-streamed-amount branch January 18, 2023 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants