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

Extend status enum #467

Merged
merged 28 commits into from
May 14, 2023
Merged

Extend status enum #467

merged 28 commits into from
May 14, 2023

Commits on May 2, 2023

  1. refactor: extend status enum

    docs: improve writing and formatting
    docs: fix typos in NatSpec
    feat: add "_calculateStreamedAmount" in linear contract
    feat: add "isCanceled", "isDepleted", "isStream" fields in in stream structs
    perf: dedup `_withdrawableAmountOf`
    refactor: alphabetical ordering
    refactor: delete "isSettled"
    refactor: delete "status" field in stream structs
    refactor: explicit null checks
    refactor: improve error names
    refactor: move withdraw amount check in each streaming contract
    refactor: rename "isActive" to "isWarm"
    refactor: rename "getStatus" to "statusOf"
    test: add "has been canceled" branch in state trees
    test: add a new fuzz test for "cancel"
    test: add a new fuzz test for "withdrawMax"
    test: add constant "MARCH_1_2023"
    test: allow depleted streams in dynamic fuzz tests
    test: allow depleted streams in fork tests
    test: delete unused imports
    test: de-dup "streamedAmountOf" tests
    test: de-dup "withdrawableAmountOf" tests
    test: expect transfer calls in all "withdraw" fuzz tests
    test: improve function and variable names
    test: improve nesting structures in state trees
    test: improve wording in comments
    test: improve wording in state trees
    test: remove status check in "createWithDeltas" tests
    test: remove superfluous comments
    test: rename "whenStreamActive" to "whenStatusStreaming"
    test: test post-withdraw status in fork tests
    test: update tests in light of new contract API
    test: use keywords for time calculations
    test: various enhancements
    PaulRBerg committed May 2, 2023
    Configuration menu
    Copy the full SHA
    eecb246 View commit details
    Browse the repository at this point in the history
  2. refactor: shorten error name

    Rename `WithdrawAmountGreaterThanWithdrawableAmount` to `Overdraw`
    
    Close #458
    PaulRBerg committed May 2, 2023
    Configuration menu
    Copy the full SHA
    2d8ee1e View commit details
    Browse the repository at this point in the history
  3. feat: add "isStream"

    docs: improve writing
    refactor: delete "Status.NULL"
    refactor: rename "isNotNull" to "notNull"
    refactor: rename "isWarm" to "warm"
    refactor: revert on null streams in "statusOf"
    test: add tests for "isStream"
    test: fix pre-conditions in "LockupHandler"
    test: improve function names
    test: refactor modifiers in "LockupHandler"
    test: update tests for "statusOf"
    PaulRBerg committed May 2, 2023
    Configuration menu
    Copy the full SHA
    68bfd90 View commit details
    Browse the repository at this point in the history
  4. feat: add "isCold" and "isWarm" utils

    refactor: refactor "warm" into "notCold"
    refactor: rename "StreamNotWarm" error to "StreamCold"
    test: add tests for "isCold" and "isWarm"
    test: delete superfluous tests
    test: improve names of state trees
    test: improve orders of operations in tests
    PaulRBerg committed May 2, 2023
    Configuration menu
    Copy the full SHA
    96941f6 View commit details
    Browse the repository at this point in the history
  5. test: simplify directory nesting structure

    Refactor `lockup/shared` to `lockup`
    Refactor `lockup/linear` to `lockup-linear`
    Refactor `lockup/dynamic` to `lockup-dynamic`
    PaulRBerg committed May 2, 2023
    Configuration menu
    Copy the full SHA
    eaf6bfd View commit details
    Browse the repository at this point in the history
  6. test: check status in create function tests

    test: improve writing in comments
    test: improve writing in function and variable names
    test: improve state trees
    PaulRBerg committed May 2, 2023
    Configuration menu
    Copy the full SHA
    52120a5 View commit details
    Browse the repository at this point in the history
  7. refactor: de-dup "withdraw" and "withdrawMultiple"

    docs: improve writing in comments
    test: remove "whenCaller" tests in "withdrawMultiple"
    test: fix, improve, and simplify "withdrawMultiple" tests
    test: fix and improve "withdraw" tests
    test: improve naming in state trees
    PaulRBerg committed May 2, 2023
    Configuration menu
    Copy the full SHA
    a67a38f View commit details
    Browse the repository at this point in the history
  8. refactor: rename error

    Rename "WithdrawSenderUnauthorized" to "InvalidSenderWithdrawal"
    PaulRBerg committed May 2, 2023
    Configuration menu
    Copy the full SHA
    f15e073 View commit details
    Browse the repository at this point in the history
  9. test: improve and simplify "cancelMultiple" tests

    test: run "cancelMultiple" fuzz tests
    
    Closes #463
    PaulRBerg committed May 2, 2023
    Configuration menu
    Copy the full SHA
    80d0edd View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    6b62bde View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    bde0f3a View commit details
    Browse the repository at this point in the history
  12. test: differentiate streams in "cancelMultiple"

    test: change order of streams in "withdrawMultiple"
    test: use named args in expect calls helpers
    PaulRBerg committed May 2, 2023
    Configuration menu
    Copy the full SHA
    5faa8ec View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    b6f2bac View commit details
    Browse the repository at this point in the history
  14. test: refactor defaults

    test: alphabetical ordering
    test: add "deployBaseTestContracts"
    test: add "labelBaseTestContracts"
    test: add "SEGMENT_COUNT"
    test: bound instead of assume in "createWithRange" test
    test: deploy base contract via bespoke helper function
    test: fix variable names
    test: improve wording in comments
    test: label base contracts via bespoke helper function
    test: delete "DEFAULT_ASSET"
    test: delete unneeded "Calculations" inheritance
    test: deploy and label base test contracts in "Base_Test.setUp"
    test: hard code bound values in invariant tests
    test: inherit from "Constants" in "Base_Test"
    test: improve wording in comments
    test: replace local max uint256 constant with PRBTest constant
    test: rename "dai" to "usdc"
    PaulRBerg committed May 2, 2023
    Configuration menu
    Copy the full SHA
    e40bcbd View commit details
    Browse the repository at this point in the history

Commits on May 4, 2023

  1. test: add invariant tests for statuses

    perf: mark "isCold" and "isWarm" as "external"
    refactor: change declaration place of "segmentCount"
    test: add "assertNotEq" for "Lockup.Status"
    test: group status invariant tests
    test: improve wording
    PaulRBerg committed May 4, 2023
    Configuration menu
    Copy the full SHA
    f7d62d5 View commit details
    Browse the repository at this point in the history
  2. test: de-dup modifiers

    test: add all shared modifiers in "streamedAmountOf"
    test: add all shared modifiers in "withdrawableAmountOf"
    test: alphabetical ordering
    PaulRBerg committed May 4, 2023
    Configuration menu
    Copy the full SHA
    f9ca075 View commit details
    Browse the repository at this point in the history
  3. test: refactor default params

    test: add private "params" in shared tests
    test: delete internal "defaultParams"
    test: deploy and label directly in "Base_Test.setUp"
    test: define "createDefaultStreamWithTotalAmount" in shared contract
    text: expand "Defaults" with more default values
    test: use direct values instead of loading them from default params
    test: move statements around so make "vm.expectRevert" work
    test: move "Users" in "test/utils/Types"
    test: provide default create function params in "Defaults"
    test: various refactors and improvements
    PaulRBerg committed May 4, 2023
    Configuration menu
    Copy the full SHA
    48818a0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    666d088 View commit details
    Browse the repository at this point in the history
  5. fix: stream not cancelable when status settled

    docs: improve writing
    test: test cold streams in "isCancelable"
    test: fix mistaken comment in invariant tests
    PaulRBerg committed May 4, 2023
    Configuration menu
    Copy the full SHA
    4d07554 View commit details
    Browse the repository at this point in the history

Commits on May 9, 2023

  1. test: move common logic to "Lockup_Shared_Test"

    test: prank back to sender after setting protocol fee
    PaulRBerg committed May 9, 2023
    Configuration menu
    Copy the full SHA
    6856903 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7f8045e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7b4d237 View commit details
    Browse the repository at this point in the history

Commits on May 10, 2023

  1. perf: remove unneeded "notNull" modifier

    docs: document numerical values for "Status" enum
    perf: remove unneeded "streamId" variable
    perf: remove unneeded "uin256()" casting
    test: add missing error strings in assertions
    PaulRBerg committed May 10, 2023
    Configuration menu
    Copy the full SHA
    021362b View commit details
    Browse the repository at this point in the history

Commits on May 11, 2023

  1. refactor: refactor "isCanceled" to "wasCanceled"

    docs: improve writing in comments
    docs: remove superfluous comments
    PaulRBerg committed May 11, 2023
    Configuration menu
    Copy the full SHA
    a3229d5 View commit details
    Browse the repository at this point in the history
  2. perf: simplify withdraw functions

    feat: add "_isDepleted" internal getter
    refactor: delete "_checkParamsAndWithdraw" function
    refactor: delete "StreamPending" error
    test: refine "cancelMultiple" and "withdrawMultiple" tests
    test: update state trees in light of new contract API
    PaulRBerg committed May 11, 2023
    Configuration menu
    Copy the full SHA
    7d21c34 View commit details
    Browse the repository at this point in the history
  3. perf: do not call "statusOf" in "cancel"

    docs: improve writing in comments
    feat: add "_wasCanceled" getter
    refactor: check cold statuses directly in "renounce"
    refactor: delete "notCold" modifier
    refactor: emit specific statuses instead of "StreamCold"
    test: update state trees in light of new contract API
    PaulRBerg committed May 11, 2023
    Configuration menu
    Copy the full SHA
    3fbc3ba View commit details
    Browse the repository at this point in the history
  4. feat: add "isDepleted" and "wasCanceled" getters

    docs: improve writing in comments
    test: test "isDepleted" getter
    test: test "wasCanceled" getter
    PaulRBerg committed May 11, 2023
    Configuration menu
    Copy the full SHA
    ac6f04a View commit details
    Browse the repository at this point in the history

Commits on May 12, 2023

  1. refactor: merge "isDepleted" with "_isDepleted"

    refactor: delete unneeded modifier uses
    refactor: merge "wasCanceled" with "_wasCanceled"
    refactor: remove "onlySenderOrRecipient" modifier
    PaulRBerg committed May 12, 2023
    Configuration menu
    Copy the full SHA
    2a70537 View commit details
    Browse the repository at this point in the history