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

refactor(core)!: make getActionablePendingAction a view function #61

Merged
merged 10 commits into from
Jan 31, 2024

Conversation

beeb
Copy link
Contributor

@beeb beeb commented Jan 29, 2024

The front-end cannot make calls to functions that are not view (they could do a simulate but it's unergonomic).

Thus, the getActionablePendingAction has been made view and a new _getActionablePendingAction internal function has been added, for removing the empty items at the front of the queue.

NOTE: the coverage commands have been updated to ignore fuzzing and invariant tests, since they take too long with the local profile. Also, it would be good practice to have full coverage with only unit tests (without taking fuzzing into account).

beeb added 3 commits January 29, 2024 10:45
…coverage

These tests take too long with the local profile, and it would be good practice to have unit tests covering all branches anyway.
Added tests for the external function, and added an internal function that mutates the queue.
Copy link

github-actions bot commented Jan 29, 2024

LCOV of commit 12b6695 during Coverage report #423

Summary coverage rate:
  lines......: 75.6% (606 of 802 lines)
  functions..: 83.4% (151 of 181 functions)
  branches...: 71.2% (245 of 344 branches)

Files changed coverage rate:
                                                           |Lines       |Functions  |Branches    
  Filename                                                 |Rate     Num|Rate    Num|Rate     Num
  ===============================================================================================
  src/UsdnProtocol/UsdnProtocolActions.sol                 |65.4%    185|77.8%    18|43.8%     64
  src/UsdnProtocol/UsdnProtocolCore.sol                    |81.6%    114|65.2%    23|76.7%     60
  test/unit/UsdnProtocol/utils/Handler.sol                 |80.8%     26|77.3%    22|    -      0

@beeb beeb requested review from fireboss777 and samooyo January 29, 2024 09:54
@beeb beeb added the To review The pull request need to be reviewed before merge label Jan 30, 2024
@beeb beeb requested review from samooyo and Yashiru January 30, 2024 12:23
@beeb beeb changed the title refactor(core): make getActionablePendingAction a view function refactor(core)!: make getActionablePendingAction a view function Jan 30, 2024
samooyo
samooyo previously approved these changes Jan 30, 2024
Copy link
Contributor

@samooyo samooyo left a comment

Choose a reason for hiding this comment

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

ALL GOOD

@beeb beeb merged commit 146adf8 into main Jan 31, 2024
3 checks passed
@beeb beeb deleted the fix/pending-action-view branch January 31, 2024 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
To review The pull request need to be reviewed before merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants