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

Refine base tests #77

Merged
merged 2 commits into from
May 22, 2024
Merged

Refine base tests #77

merged 2 commits into from
May 22, 2024

Conversation

smol-ninja
Copy link
Member

@smol-ninja smol-ninja commented May 12, 2024

Changelogs

  • Closes Refine base tests #96
  • Replace StdUtils with PRBMathUtils
  • Replace StdAssertions with PRBMathAssertions
  • Constants and Types contracts. Constants is inherited by Base.
  • Add constructor test
  • Alphabetical order in Modifers.sol

@smol-ninja smol-ninja changed the title feat: broker fee Add broker fee during deposits, refine tests. May 12, 2024
@smol-ninja smol-ninja requested a review from andreivladbrg May 12, 2024 13:19
andreivladbrg

This comment was marked as resolved.

@smol-ninja

This comment was marked as resolved.

@smol-ninja smol-ninja changed the title Add broker fee during deposits, refine tests. Refine base tests May 21, 2024
@smol-ninja smol-ninja force-pushed the feat/implement-broker-fee branch from 6678282 to 43bb154 Compare May 21, 2024 15:27
@smol-ninja smol-ninja requested a review from andreivladbrg May 21, 2024 15:28
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.

Why do we need both Constants & Defaults contracts? The variables in Defaults are just duplicated

We can have only Constants, wdyt? @smol-ninja

test: Add constructor test
test: Use constants from Defaults contract
test: Replace StdUtils with PRBMathUtils
test: Replace StdAssertions with PRBMathAssertions

test: inherit Defaults in Base contract

test: remove redundant variables
@andreivladbrg andreivladbrg force-pushed the feat/implement-broker-fee branch from a4532c4 to f46739c Compare May 22, 2024 19:46
@smol-ninja
Copy link
Member Author

Why do we need both Constants & Defaults contracts? The variables in Defaults are just duplicated

The idea was to have one contract for constants and one for default values. The values are not duplicated. Constants has constants while Defaults has default values (inspired from the lockup repo).

We can have only Constants, wdyt

But since there are not many constants, we can merge them as well. But should we not call it Defaults?

@andreivladbrg
Copy link
Member

andreivladbrg commented May 22, 2024

The values are not duplicated. Constants has constants while Defaults has default values

you are correct, i was wrong

But since there are not many constants, we can merge them as well. But should we not call it Defaults?

Yes, we could merge them, but I would prefer to call Constants because in Lockup contracts we define and use the Defaults contract like this (it would not be the same):

// deploy contract
Defaults internal defaults = new Defaults();
// call constant
defaults.MY_CONSTANT();

One disadvantage in having a separate contracts is that it makes debugging messier because you will have a lot of function calls in defaults.

@smol-ninja
Copy link
Member Author

One disadvantage in having a separate contracts is that it makes debugging messier

I agree thats why I made Base contract inherits Defaults so that we don't have to use defaults. anymore. I am fine calling it Constants too.

@andreivladbrg
Copy link
Member

@smol-ninja I have squashed and rebased from, and merged Constants & Defaults, lmk if it looks good

@smol-ninja
Copy link
Member Author

LGTM. Thanks for review. Merging now.

@smol-ninja smol-ninja merged commit b5f70b6 into main May 22, 2024
6 checks passed
@smol-ninja smol-ninja deleted the feat/implement-broker-fee branch May 22, 2024 20:23
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.

Refine base tests
2 participants